From 3d219837bd2f6b8f21a7e042ac448de2f0fde972 Mon Sep 17 00:00:00 2001 From: leejh Date: Tue, 22 Oct 2019 17:05:29 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EB=8A=A5=EC=B6=94=EA=B0=80=20::=20?= =?UTF-8?q?=EC=A1=B0=EC=A7=81=EB=8F=84=20>=20=EB=B6=80=EC=84=9C=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20::=20=EB=B6=80=EC=84=9C=EC=9B=90=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=ED=94=84=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=8A=A4=20=EC=B6=94=EA=B0=80.=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20::=20=EC=9C=A0=EC=A0=80=EC=84=A0=ED=83=9D=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20>=20=EC=84=A0=ED=83=9D=EB=90=9C=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20met-chips=20=EB=A1=9C=20=EB=B3=80=EA=B2=BD.=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20::=20sync=5Fgroup2=20=EC=88=98=ED=96=89?= =?UTF-8?q?=EC=8B=9C=20syncDate=20=EC=97=90=20'=20'=20blank=20=ED=95=98?= =?UTF-8?q?=EB=82=98=20=EC=A3=BC=EB=8A=94=EA=B2=83=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20::=20=EC=84=9C=EB=B2=84=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=ED=95=B4=EB=8B=B9=20=EB=B6=80=EB=B6=84=20=ED=8C=8C=EC=8B=B1?= =?UTF-8?q?=20=EB=B6=88=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../left-sidenav/organization.component.html | 33 ++++++++--- .../left-sidenav/organization.component.scss | 31 +++++----- .../left-sidenav/organization.component.ts | 56 +++++++++++++++++-- .../chat/create-chat.dialog.component.html | 22 ++++---- .../messenger/messenger.layout.module.ts | 2 + .../src/app/store/messenger/query/reducers.ts | 26 ++++++++- .../src/app/store/messenger/query/state.ts | 8 ++- .../src/lib/protocols/group.ts | 2 +- 8 files changed, 135 insertions(+), 45 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html index a56a1a1c..3c7629cd 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html @@ -1,16 +1,31 @@ -
+
- +
-
+
- (선택된부서명) + {{ getSelectedDepartmentName() }}
-
- +
+ +
+
+
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.scss index 1558c8ce..ca14095b 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.scss +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.scss @@ -5,25 +5,24 @@ overflow-y: auto; } } -.btn-box{ - height:80px; +.btn-box { + height: 80px; position: absolute; - bottom:0; - border-top:1px solid #ddd; + bottom: 0; + border-top: 1px solid #ddd; align-items: center; - width:100%; - background-color:#ffffff; + width: 100%; + background-color: #ffffff; } -.select-dept{ - border-top:1px solid #dddddd; - height:40px; - width:100%; - display:inline-flex; +.select-dept { + border-top: 1px solid #dddddd; + height: 40px; + width: 100%; + display: inline-flex; align-items: center; - padding:0 10px; + padding: 0 10px; } -.select-list{ - height: calc(100% - 120px); - overflow: auto; +.select-list { + height: calc(100% - 120px); + overflow: auto; } - diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts index 78161ad3..e40e0ecb 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts @@ -1,6 +1,13 @@ -import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; +import { + Component, + OnInit, + OnDestroy, + Output, + EventEmitter, + Input +} from '@angular/core'; import { ucapAnimations } from '@ucap-webmessenger/ui'; -import { Observable } from 'rxjs'; +import { Observable, Subscription } from 'rxjs'; import { DeptInfo, QueryProtocolService, @@ -18,7 +25,7 @@ import * as AppStore from '@app/store'; import * as QueryStore from '@app/store/messenger/query'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { LoginInfo, KEY_LOGIN_INFO } from '@app/types'; -import { take, map, switchMap } from 'rxjs/operators'; +import { take, map, tap, delay } from 'rxjs/operators'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { KEY_VER_INFO } from '@app/types/ver-info.type'; @@ -28,7 +35,7 @@ import { KEY_VER_INFO } from '@app/types/ver-info.type'; styleUrls: ['./organization.component.scss'], animations: ucapAnimations }) -export class OrganizationComponent implements OnInit { +export class OrganizationComponent implements OnInit, OnDestroy { @Input() /** 사용자 선택용으로 사용시 true 로 유입 */ isUserSelect = false; @@ -45,6 +52,9 @@ export class OrganizationComponent implements OnInit { departmentInfoList$: Observable; selectedDepartmentUserInfoList$: Observable; selectedDepartmentStatus$: Observable; + selectedDepartmentProcessing = false; + selectedDepartmentProcessingSubscription: Subscription; + selectedDepartmentName: string; loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); sessionVerinfo = this.sessionStorageService.get( @@ -62,6 +72,19 @@ export class OrganizationComponent implements OnInit { this.departmentInfoList$ = this.store.pipe( select(AppStore.MessengerSelector.QuerySelector.departmentInfoList) ); + + this.selectedDepartmentProcessingSubscription = this.store + .pipe( + delay(0), + select( + AppStore.MessengerSelector.QuerySelector.selectedDepartmentProcessing + ), + tap(processing => { + this.selectedDepartmentProcessing = processing; + }) + ) + .subscribe(); + this.selectedDepartmentUserInfoList$ = this.store.pipe( select( AppStore.MessengerSelector.QuerySelector.selectedDepartmentUserInfoList @@ -87,11 +110,21 @@ export class OrganizationComponent implements OnInit { senderEmployeeType: loginRes.userInfo.employeeType }) ); + return loginRes; + }), + map(loginRes => { + this.selectedDepartmentName = loginRes.userInfo.deptName; }) ) .subscribe(); } + ngOnDestroy(): void { + if (!!this.selectedDepartmentProcessingSubscription) { + this.selectedDepartmentProcessingSubscription.unsubscribe(); + } + } + onSelectedOrganization(deptInfo: DeptInfo) { this.store .pipe( @@ -109,11 +142,26 @@ export class OrganizationComponent implements OnInit { senderEmployeeType: loginRes.userInfo.employeeType }) ); + }), + map(() => { + this.selectedDepartmentName = deptInfo.name; }) ) .subscribe(); } + getSelectedDepartmentName() { + if (!!this.selectedDepartmentProcessing) { + return '부서조회중..'; + } + + if (!!this.selectedDepartmentName) { + return this.selectedDepartmentName; + } else { + return '조회중..'; + } + } + /** 리스트 checkable 할 경우 checkbox 의 isChecked 를 관장하며 리스트의 전체선택 여부를 판단한다. */ getCheckedUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { if (!!this.selectedUserList && this.selectedUserList.length > 0) { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html index 74c41d99..2bf4e6d5 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html @@ -83,19 +83,17 @@
-
    -
  • + + {{ userInfo.name }} - - -
  • -
+ clear + +
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts index bb2012de..0f96942a 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts @@ -1,3 +1,4 @@ +import { MatChipsModule } from '@angular/material/chips'; import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; @@ -49,6 +50,7 @@ import { ReactiveFormsModule } from '@angular/forms'; MatProgressBarModule, MatTabsModule, MatToolbarModule, + MatChipsModule, UCapUiModule, UCapUiChatModule, UCapUiRoomModule, diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts index 1cf7e2c0..4e26fb20 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts @@ -1,6 +1,12 @@ import { createReducer, on } from '@ngrx/store'; import { initialState } from './state'; -import { authSuccess, deptSuccess, deptUserSuccess } from './actions'; +import { + authSuccess, + deptSuccess, + deptUserSuccess, + deptUser, + deptUserFailure +} from './actions'; import * as AuthenticationStore from '@app/store/account/authentication'; @@ -20,13 +26,29 @@ export const reducer = createReducer( }; }), + on(deptUser, (state, action) => { + return { + ...state, + selectedDepartmentProcessing: true + }; + }), + on(deptUserSuccess, (state, action) => { return { ...state, selectedDepartmentUserInfoList: action.userInfos, - selectedDepartmentStatus: action.res + selectedDepartmentStatus: action.res, + selectedDepartmentProcessing: false }; }), + + on(deptUserFailure, (state, action) => { + return { + ...state, + selectedDepartmentProcessing: false + }; + }), + on(AuthenticationStore.logout, (state, action) => { return { ...initialState diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/query/state.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/query/state.ts index 03340cf0..7947a52b 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/query/state.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/query/state.ts @@ -13,13 +13,15 @@ export interface State { selectedDepartmentUserInfoList: UserInfoSS[] | null; selectedDepartmentStatus: DeptUserResponse | null; + selectedDepartmentProcessing: boolean; } export const initialState: State = { auth: null, departmentInfoList: null, selectedDepartmentUserInfoList: null, - selectedDepartmentStatus: null + selectedDepartmentStatus: null, + selectedDepartmentProcessing: false }; export function selectors(selector: Selector) { @@ -39,6 +41,10 @@ export function selectors(selector: Selector) { selectedDepartmentStatus: createSelector( selector, (state: State) => state.selectedDepartmentStatus + ), + selectedDepartmentProcessing: createSelector( + selector, + (state: State) => state.selectedDepartmentProcessing ) }; } diff --git a/projects/ucap-webmessenger-protocol-sync/src/lib/protocols/group.ts b/projects/ucap-webmessenger-protocol-sync/src/lib/protocols/group.ts index a1a9405c..f1a20682 100644 --- a/projects/ucap-webmessenger-protocol-sync/src/lib/protocols/group.ts +++ b/projects/ucap-webmessenger-protocol-sync/src/lib/protocols/group.ts @@ -43,7 +43,7 @@ export const encodeGroup: ProtocolEncoder = ( ) => { const bodyList: PacketBody[] = []; - bodyList.push({ type: PacketBodyValue.String, value: req.syncDate || '' }); + bodyList.push({ type: PacketBodyValue.String, value: req.syncDate || ' ' }); return bodyList; };