From 5236f0e37b1e71461f4e82e23eef2dbafee7dc5d Mon Sep 17 00:00:00 2001 From: leejinho Date: Thu, 26 Dec 2019 17:34:52 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=86=8D=EB=B6=80=EC=84=9C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20=ED=94=84=EB=A1=9C=ED=95=84=20=EC=9C=A0=ED=9A=A8?= =?UTF-8?q?=EC=84=B1=20=EC=B2=B4=ED=81=AC=EB=B6=80=EB=B6=84=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/left-side.component.ts | 18 ++- .../left-sidenav/group.component.html | 4 +- .../left-sidenav/group.component.ts | 38 +++++- .../left-sidenav/message.component.ts | 7 +- .../left-sidenav/organization.component.html | 2 +- .../left-sidenav/organization.component.ts | 11 +- .../components/messages.component.ts | 4 +- .../components/right-drawer.component.ts | 12 +- .../profile/profile.dialog.component.html | 1 + .../profile/profile.dialog.component.ts | 4 + .../components/main.page.component.ts | 21 ++-- .../src/app/store/messenger/query/actions.ts | 6 +- .../src/app/store/messenger/query/effects.ts | 21 +++- .../src/app/store/messenger/query/reducers.ts | 10 +- .../src/app/store/messenger/query/state.ts | 14 ++- .../src/app/store/messenger/sync/effects.ts | 117 +++++++++++++----- .../src/assets/i18n/en.json | 5 +- .../src/assets/i18n/ko.json | 5 +- .../environments/environment.daesang.dev.ts | 3 + .../environments/environment.daesang.prod.ts | 3 + .../src/environments/environment.dev.ts | 3 + .../src/environments/environment.prod.ts | 3 + .../src/environments/environment.type.ts | 6 + .../src/lib/types/openProfileOptions.ts | 3 + .../src/public-api.ts | 1 + .../components/expansion-panel.component.html | 28 +++-- .../components/expansion-panel.component.ts | 15 ++- .../src/lib/ucap-ui-group.module.ts | 3 + .../lib/components/list-item.component.html | 3 + .../src/lib/components/profile.component.html | 84 ++++++------- .../src/lib/components/profile.component.ts | 21 +++- 31 files changed, 335 insertions(+), 141 deletions(-) create mode 100644 projects/ucap-webmessenger-protocol-buddy/src/lib/types/openProfileOptions.ts diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts index 633e848e..1f57ddf6 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts @@ -31,6 +31,7 @@ import { } from '@ucap-webmessenger/protocol-query'; import { MatTabChangeEvent } from '@angular/material'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; +import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { MessageApiService, MessageType } from '@ucap-webmessenger/api-message'; @@ -69,9 +70,10 @@ export enum MainMenu { }) export class LeftSideComponent implements OnInit, OnDestroy { @Output() - openProfile = new EventEmitter< - UserInfo | UserInfoSS | UserInfoF | UserInfoDN - >(); + openProfile = new EventEmitter<{ + userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; + openProfileOptions?: OpenProfileOptions; + }>(); @Output() sendCall = new EventEmitter(); @Output() @@ -262,8 +264,14 @@ export class LeftSideComponent implements OnInit, OnDestroy { } } - onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { - this.openProfile.emit(userInfo); + onClickOpenProfile(params: { + userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; + openProfileOptions?: OpenProfileOptions; + }) { + this.openProfile.emit({ + userInfo: params.userInfo, + openProfileOptions: params.openProfileOptions + }); } onClickSendClickToCall(calleeNumber: string) { this.sendCall.emit(calleeNumber); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html index 0f3e4108..2ce40f96 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html @@ -38,7 +38,7 @@ [presence]="getStatusBulkInfo(userInfo) | async" [sessionVerinfo]="sessionVerinfo" (click)="onSelectBuddy(userInfo)" - (openProfile)="onClickOpenProfile($event)" + (openProfile)="onClickOpenProfile($event, group)" (contextmenu)="onContextMenuProfile($event, userInfo, group, false)" class="list-item-frame ucap-clickable" > @@ -159,7 +159,7 @@ > diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts index 935e1ef3..3e972fa7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts @@ -44,6 +44,7 @@ import { SSVC_TYPE_QUERY_DEPT_USER_RES, DeptUserData } from '@ucap-webmessenger/protocol-query'; +import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy'; import { ucapAnimations, @@ -84,9 +85,10 @@ export class GroupComponent implements OnInit, OnDestroy { @Output() newGroupAndMember = new EventEmitter(); @Output() - openProfile = new EventEmitter< - UserInfo | UserInfoSS | UserInfoF | UserInfoDN - >(); + openProfile = new EventEmitter<{ + userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; + openProfileOptions?: OpenProfileOptions; + }>(); @ViewChild('groupExpansionPanel', { static: false }) groupExpansionPanel: GroupExpansionPanelComponent; @@ -430,7 +432,18 @@ export class GroupComponent implements OnInit, OnDestroy { ); switch (menuType) { case 'VIEW_PROFILE': - this.openProfile.emit(userInfo); + this.openProfile.emit({ + userInfo, + openProfileOptions: { + useDelBuddybutton: + !!group && + environment.productConfig.CommonSetting.useMyDeptGroup && + environment.productConfig.CommonSetting.myDeptGroupSeq === + group.seq + ? false + : true + } + }); break; case 'CHAT': this.onSelectBuddy(userInfo); @@ -557,8 +570,21 @@ export class GroupComponent implements OnInit, OnDestroy { } } - onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { - this.openProfile.emit(userInfo); + onClickOpenProfile( + userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN, + group: GroupDetailData + ) { + this.openProfile.emit({ + userInfo, + openProfileOptions: { + useDelBuddybutton: + !!group && + environment.productConfig.CommonSetting.useMyDeptGroup && + environment.productConfig.CommonSetting.myDeptGroupSeq === group.seq + ? false + : true + } + }); } onContextMenuProfile( diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts index 1d8dc7e2..b996a74e 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts @@ -9,13 +9,10 @@ import { AfterViewChecked } from '@angular/core'; import { Subscription, of } from 'rxjs'; -import { Store, select } from '@ngrx/store'; -import { tap, map, catchError, take } from 'rxjs/operators'; +import { Store } from '@ngrx/store'; +import { map, catchError, take } from 'rxjs/operators'; import { NGXLogger } from 'ngx-logger'; -import * as AppStore from '@app/store'; - -import { UserInfo } from '@ucap-webmessenger/protocol-room'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { DialogService } from '@ucap-webmessenger/ui'; 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 2979062d..71c6622a 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 @@ -82,7 +82,7 @@ (); @Output() - openProfile = new EventEmitter< - UserInfo | UserInfoSS | UserInfoF | UserInfoDN - >(); + openProfile = new EventEmitter<{ + userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; + }>(); @Output() sendCall = new EventEmitter(); @Output() @@ -395,9 +395,10 @@ export class OrganizationComponent onCheckAllUser(value: boolean) { this.checkAllUser.emit({ isChecked: value, - userInfos: this.isShowSearch + userInfos: (this.isShowSearch ? this.searchUserInfos : this.selectedDepartmentUserInfoList + ).filter(user => user.seq !== this.loginRes.userSeq) }); } @@ -416,7 +417,7 @@ export class OrganizationComponent } onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { - this.openProfile.emit(userInfo); + this.openProfile.emit({ userInfo }); } onClickSendClickToCall(calleeNumber: string) { this.sendCall.emit(calleeNumber); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index 42428131..27604478 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -108,7 +108,7 @@ import { environment } from '../../../../environments/environment'; }) export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { @Output() - openProfile = new EventEmitter(); + openProfile = new EventEmitter<{ userInfo: UserInfo }>(); @ViewChild('chatForm', { static: false }) private chatForm: UCapUiChatFormComponent; @@ -1192,7 +1192,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { this.roomInfo.roomType !== RoomType.Allim_Elephant && this.roomInfo.roomType !== RoomType.Allim_TMS ) { - this.openProfile.emit(userInfo); + this.openProfile.emit({ userInfo }); } } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer.component.ts index 65945641..9372c82d 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer.component.ts @@ -4,22 +4,22 @@ import { UserInfo } from '@ucap-webmessenger/protocol-room'; import { UserInfoSS, UserInfoF, - UserInfoDN, + UserInfoDN } from '@ucap-webmessenger/protocol-query'; @Component({ selector: 'app-layout-messenger-right-drawer', templateUrl: './right-drawer.component.html', - styleUrls: ['./right-drawer.component.scss'], + styleUrls: ['./right-drawer.component.scss'] }) export class RightDrawerComponent implements OnInit { @Input() selectedRightDrawer: RightDrawer; @Output() - openProfile = new EventEmitter< - UserInfo | UserInfoSS | UserInfoF | UserInfoDN - >(); + openProfile = new EventEmitter<{ + userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; + }>(); @Output() closeRightDrawer = new EventEmitter(); @@ -30,7 +30,7 @@ export class RightDrawerComponent implements OnInit { ngOnInit() {} onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { - this.openProfile.emit(userInfo); + this.openProfile.emit({ userInfo }); } onClickClose() { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.html index 0f6e404f..a2b90345 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.html @@ -6,6 +6,7 @@ [myMadn]="loginRes.madn" [isBuddy]="isBuddy" [isFavorit]="isFavorit" + [openProfileOptions]="data.openProfileOptions" (openChat)="onClickChat($event)" (sendMessage)="onClickSendMessage($event)" (sendCall)="onClickSendClickToCall($event)" diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts index efe594cf..6a05e426 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts @@ -36,6 +36,7 @@ import { } from '../group/select-group.dialog.component'; import { FileUploadItem } from '@ucap-webmessenger/api'; import { CommonApiService } from '@ucap-webmessenger/api-common'; +import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy'; import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types'; import { StatusCode } from '@ucap-webmessenger/api'; import { @@ -54,6 +55,7 @@ import { environment } from '../../../../../environments/environment'; export interface ProfileDialogData { userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; + openProfileOptions?: OpenProfileOptions; } export interface ProfileDialogResult {} @@ -102,6 +104,8 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { this.editableProfileImage = environment.productConfig.CommonSetting.editableProfileImage; + + console.log(data.openProfileOptions); } ngOnInit() { diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts index b6997e94..0f636717 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts @@ -42,13 +42,10 @@ import { import { MatDrawer } from '@angular/material'; import { NGXLogger } from 'ngx-logger'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; +import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy'; import { DaesangProtocolService, SmsUtils } from '@ucap-webmessenger/daesang'; import { CallService } from '@ucap-webmessenger/api-prompt'; -import { - EnvironmentsInfo, - KEY_ENVIRONMENTS_INFO, - KEY_URL_INFO -} from '@app/types'; +import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { MessageApiService, @@ -63,7 +60,6 @@ import { MessageDetailDialogResult, MessageDetailDialogData } from '@app/layouts/messenger/dialogs/message/message-detail.dialog.component'; -import { DaesangUrlInfoResponse } from '@ucap-webmessenger/api-external'; @Component({ selector: 'app-page-messenger-main', @@ -96,8 +92,7 @@ export class MainPageComponent implements OnInit, OnDestroy { private callService: CallService, private sessionStorageService: SessionStorageService, private dialogService: DialogService, - private logger: NGXLogger, - private changeDetectorRef: ChangeDetectorRef + private logger: NGXLogger ) { this.environmentsInfo = this.sessionStorageService.get( KEY_ENVIRONMENTS_INFO @@ -244,7 +239,10 @@ export class MainPageComponent implements OnInit, OnDestroy { this.leftSideComponentWidth = this.defaultLeftSideComponentWidth; } - onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { + onClickOpenProfile(params: { + userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; + openProfileOptions?: OpenProfileOptions; + }) { // [GROUP] // this.queryProtocolService // .dataUser({ @@ -275,7 +273,7 @@ export class MainPageComponent implements OnInit, OnDestroy { this.daesangProtocolService .dataUserDaesang({ divCd: 'OPENPROF', - seq: userInfo.seq, + seq: params.userInfo.seq, senderCompanyCode: this.loginRes.userInfo.companyCode, senderEmployeeType: this.loginRes.userInfo.employeeType }) @@ -289,7 +287,8 @@ export class MainPageComponent implements OnInit, OnDestroy { ProfileDialogResult >(ProfileDialogComponent, { data: { - userInfo: res.userInfo + userInfo: res.userInfo, + openProfileOptions: params.openProfileOptions } }); } diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/query/actions.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/query/actions.ts index 1030975d..a6613ed0 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/query/actions.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/query/actions.ts @@ -39,7 +39,6 @@ export const deptFailure = createAction( '[Messenger::Query] Dept Failure', props<{ error: any }>() ); - export const deptUser = createAction( '[Messenger::Query] Dept User', props() @@ -54,3 +53,8 @@ export const deptUserFailure = createAction( '[Messenger::Query] Dept User Failure', props<{ error: any }>() ); + +export const myDeptUserSuccess = createAction( + '[Messenger::Query] My Dept User Success', + props<{ userInfos: UserInfoSS[] }>() +); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/query/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/query/effects.ts index e969e38b..e9ad9149 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/query/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/query/effects.ts @@ -11,7 +11,8 @@ import { deptFailure, deptUser, deptUserSuccess, - deptUserFailure + deptUserFailure, + myDeptUserSuccess } from './actions'; import { @@ -28,6 +29,9 @@ import { } from '@ucap-webmessenger/protocol-query'; import { Store } from '@ngrx/store'; +import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; +import { KEY_LOGIN_RES_INFO } from '@app/types'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; @Injectable() export class Effects { @@ -94,6 +98,18 @@ export class Effects { res: res as DeptUserResponse }) ); + + const loginResInfo: LoginResponse = this.sessionStorageService.get< + LoginResponse + >(KEY_LOGIN_RES_INFO); + + if (req.seq === loginResInfo.departmentCode) { + this.store.dispatch( + myDeptUserSuccess({ + userInfos + }) + ); + } break; } }), @@ -108,6 +124,7 @@ export class Effects { constructor( private actions$: Actions, private store: Store, - private queryProtocolService: QueryProtocolService + private queryProtocolService: QueryProtocolService, + private sessionStorageService: SessionStorageService ) {} } 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 fecef243..8238fd93 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 @@ -5,7 +5,8 @@ import { deptSuccess, deptUserSuccess, deptUser, - deptUserFailure + deptUserFailure, + myDeptUserSuccess } from './actions'; import * as AuthenticationStore from '@app/store/account/authentication'; @@ -49,6 +50,13 @@ export const reducer = createReducer( }; }), + on(myDeptUserSuccess, (state, action) => { + return { + ...state, + myDepartmentUserInfoList: action.userInfos + }; + }), + on(AuthenticationStore.logoutInitialize, (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 7947a52b..4b1cbcec 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 @@ -14,6 +14,8 @@ export interface State { selectedDepartmentUserInfoList: UserInfoSS[] | null; selectedDepartmentStatus: DeptUserResponse | null; selectedDepartmentProcessing: boolean; + + myDepartmentUserInfoList: UserInfoSS[] | null; } export const initialState: State = { @@ -21,15 +23,13 @@ export const initialState: State = { departmentInfoList: null, selectedDepartmentUserInfoList: null, selectedDepartmentStatus: null, - selectedDepartmentProcessing: false + selectedDepartmentProcessing: false, + myDepartmentUserInfoList: null }; export function selectors(selector: Selector) { return { - auth: createSelector( - selector, - (state: State) => state.auth - ), + auth: createSelector(selector, (state: State) => state.auth), departmentInfoList: createSelector( selector, (state: State) => state.departmentInfoList @@ -45,6 +45,10 @@ export function selectors(selector: Selector) { selectedDepartmentProcessing: createSelector( selector, (state: State) => state.selectedDepartmentProcessing + ), + myDepartmentUserInfoList: createSelector( + selector, + (state: State) => state.myDepartmentUserInfoList ) }; } diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts index 85fc1edb..ad440f8f 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts @@ -111,6 +111,7 @@ import { DialogService, AlertDialogData } from '@ucap-webmessenger/ui'; +import { UserInfoSS } from '@ucap-webmessenger/protocol-query'; @Injectable() export class Effects { @@ -719,9 +720,15 @@ export class Effects { GroupDetailData > ) - ) + ), + this.store.pipe( + select( + (state: any) => + state.messenger.query.myDepartmentUserInfoList as UserInfoSS[] + ) + ) // 내 부서원 비교. ), - tap(([action, buddyList, groupList]) => { + tap(([action, buddyList, groupList, myDeptUserList]) => { // Add Buddy const addBuddyList: number[] = []; action.trgtUserSeq.forEach(item => { @@ -734,15 +741,23 @@ export class Effects { let delBuddyInGroup: number[] = action.oldGroup.userSeqs.filter( v => action.trgtUserSeq.indexOf(v) < 0 ); - // tslint:disable-next-line: no-shadowed-variable - delBuddyInGroup = delBuddyInGroup.filter(delBuddy => { + + // 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다. + if (environment.productConfig.CommonSetting.useMyDeptGroup) { + delBuddyInGroup = delBuddyInGroup.filter( + delbuddy => + myDeptUserList.filter(deptUser => deptUser.seq === delbuddy) + .length === 0 + ); + } + delBuddyInGroup = delBuddyInGroup.filter(delbuddy => { let exist = false; // tslint:disable-next-line: forin for (const key in groupList) { const group: GroupDetailData = groupList[key]; if ( group.seq !== action.oldGroup.seq && - group.userSeqs.filter(v => v === delBuddy).length > 0 + group.userSeqs.filter(v => v === delbuddy).length > 0 ) { exist = true; break; @@ -856,20 +871,36 @@ export class Effects { GroupDetailData > ) - ) + ), + this.store.pipe( + select( + (state: any) => + state.messenger.query.myDepartmentUserInfoList as UserInfoSS[] + ) + ) // 내 부서원 비교. ), - exhaustMap(([action, groupList]) => { + exhaustMap(([action, groupList, myDeptUserList]) => { // Del Buddy const trgtBuddys = action.group.userSeqs; - // tslint:disable-next-line: no-shadowed-variable - const delBuddyList = trgtBuddys.filter(delBuddy => { + + let delBuddyList: number[] = []; + // 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다. + if (environment.productConfig.CommonSetting.useMyDeptGroup) { + delBuddyList = trgtBuddys.filter( + delbuddy => + myDeptUserList.filter(deptUser => deptUser.seq === delbuddy) + .length === 0 + ); + } + + delBuddyList = trgtBuddys.filter(delbuddy => { let exist = false; // tslint:disable-next-line: forin for (const key in groupList) { const group: GroupDetailData = groupList[key]; if ( group.seq !== action.group.seq && - group.userSeqs.filter(v => v === delBuddy).length > 0 + group.userSeqs.filter(v => v === delbuddy).length > 0 ) { exist = true; break; @@ -961,36 +992,60 @@ export class Effects { GroupDetailData > ) - ) + ), + this.store.pipe( + select( + (state: any) => + state.messenger.query.myDepartmentUserInfoList as UserInfoSS[] + ) + ) // 내 부서원 비교. ), - tap(([req, groupList]) => { + tap(([req, groupList, myDeptUserList]) => { // tslint:disable-next-line: forin for (const key in groupList) { const group: GroupDetailData = groupList[key]; if (group.userSeqs.indexOf(req.seq) > -1) { - // Group Clear.. - this.store.dispatch( - updateGroup({ - groupSeq: group.seq, - groupName: group.name, - userSeqs: group.userSeqs.filter( - userSeq => userSeq !== req.seq - ) - }) - ); + // 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다. + if ( + environment.productConfig.CommonSetting.useMyDeptGroup && + myDeptUserList.filter(deptUser => deptUser.seq === group.seq) + .length > 0 + ) { + // skip;; + } else { + // Group Clear.. + this.store.dispatch( + updateGroup({ + groupSeq: group.seq, + groupName: group.name, + userSeqs: group.userSeqs.filter( + userSeq => userSeq !== req.seq + ) + }) + ); + } } } - // Favorit Clear.. - this.store.dispatch( - updateBuddy({ - seq: req.seq, - isFavorit: false - }) - ); + // 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다. + if ( + environment.productConfig.CommonSetting.useMyDeptGroup && + myDeptUserList.filter(deptUser => deptUser.seq === req.seq).length > + 0 + ) { + // skip;; + } else { + // Favorit Clear.. + this.store.dispatch( + updateBuddy({ + seq: req.seq, + isFavorit: false + }) + ); - // Buddy Clear.. - this.store.dispatch(delBuddy({ userSeqs: [req.seq] })); + // Buddy Clear.. + this.store.dispatch(delBuddy({ userSeqs: [req.seq] })); + } }) ); }, diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/en.json b/projects/ucap-webmessenger-app/src/assets/i18n/en.json index 5ed246ae..9f621032 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/en.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/en.json @@ -606,7 +606,10 @@ "addNew": "Add new group", "expandMore": "Expand all groups", "expandLess": "Collapse all groups", - "name": "Group name" + "name": "Group name", + "nameFavorit": "Favorit", + "nameMyDept": "My Dept", + "nameDefault": "Default" }, "chat": { "room": "Chat room", diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json index fd8b1ae2..a586d45d 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json @@ -606,7 +606,10 @@ "addNew": "새 그룹 추가", "expandMore": "그룹 전체 열기", "expandLess": "그룹 전체 닫기", - "name": "그룹 이름" + "name": "그룹 이름", + "nameFavorit": "즐겨찾기", + "nameMyDept": "소속부서", + "nameDefault": "기본" }, "chat": { "room": "대화방", diff --git a/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts b/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts index 99b02ebc..945d7cac 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts @@ -66,6 +66,9 @@ export const environment: Environment = { CommonSetting: { editableProfileImage: false, + useMyDeptGroup: true, + myDeptGroupSeq: -5, + useTimerRoom: false, timerRoomDefaultInterval: 24 * 60 * 60, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts b/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts index 8187edd2..eaec84ba 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts @@ -66,6 +66,9 @@ export const environment: Environment = { CommonSetting: { editableProfileImage: false, + useMyDeptGroup: true, + myDeptGroupSeq: -5, + useTimerRoom: false, timerRoomDefaultInterval: 24 * 60 * 60, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.dev.ts b/projects/ucap-webmessenger-app/src/environments/environment.dev.ts index 9c5cfb17..cf1e7866 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.dev.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.dev.ts @@ -66,6 +66,9 @@ export const environment: Environment = { CommonSetting: { editableProfileImage: true, + useMyDeptGroup: false, + myDeptGroupSeq: -999, + useTimerRoom: true, timerRoomDefaultInterval: 24 * 60 * 60, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.prod.ts b/projects/ucap-webmessenger-app/src/environments/environment.prod.ts index f7df8e9c..e0dbafc0 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.prod.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.prod.ts @@ -66,6 +66,9 @@ export const environment: Environment = { CommonSetting: { editableProfileImage: true, + useMyDeptGroup: false, + myDeptGroupSeq: -999, + useTimerRoom: true, timerRoomDefaultInterval: 24 * 60 * 60, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.type.ts b/projects/ucap-webmessenger-app/src/environments/environment.type.ts index 512028b9..fb97ced7 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.type.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.type.ts @@ -64,8 +64,14 @@ export interface Environment { defaultSettings: Settings; CommonSetting: { + /** 내 프로필 이미지 수정 가능 여부 */ editableProfileImage: boolean; + /** 소속부서(내부서) 그룹핑 사용여부 */ + useMyDeptGroup: boolean; + /** 소속부서(내부서) 고정 그룹 SEQ */ + myDeptGroupSeq: number; + /** 타이머대화방 사용유무 */ useTimerRoom: boolean; /** 타이머대화방 기본 interval */ diff --git a/projects/ucap-webmessenger-protocol-buddy/src/lib/types/openProfileOptions.ts b/projects/ucap-webmessenger-protocol-buddy/src/lib/types/openProfileOptions.ts new file mode 100644 index 00000000..e7ad071d --- /dev/null +++ b/projects/ucap-webmessenger-protocol-buddy/src/lib/types/openProfileOptions.ts @@ -0,0 +1,3 @@ +export interface OpenProfileOptions { + useDelBuddybutton?: boolean; +} diff --git a/projects/ucap-webmessenger-protocol-buddy/src/public-api.ts b/projects/ucap-webmessenger-protocol-buddy/src/public-api.ts index 7c4bab7d..b003bc4f 100644 --- a/projects/ucap-webmessenger-protocol-buddy/src/public-api.ts +++ b/projects/ucap-webmessenger-protocol-buddy/src/public-api.ts @@ -7,6 +7,7 @@ export * from './lib/protocols/update'; export * from './lib/services/buddy-protocol.service'; +export * from './lib/types/openProfileOptions'; export * from './lib/types/service'; export * from './lib/ucap-buddy-protocol.module'; diff --git a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html index 346122ae..611b10ac 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html +++ b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html @@ -52,26 +52,38 @@ {{ treeControl.isExpanded(node) ? 'expand_less' : 'expand_more' }} + 내 프로필 - 즐겨찾기 - - ({{ node.countOfChildren }}명) + {{ + 'group.nameFavorit' | translate + }} + + + {{ + 'group.nameDefault' | translate + }} + + + {{ + 'group.nameMyDept' | translate + }} + + {{ node.groupDetail.name }} - - ({{ node.countOfChildren }}명) + + ({{ node.countOfChildren }}명) + { groupNode.children.push({ - nodeType: NodeType.Buddy, + nodeType, groupDetail: item.group, userInfo }); diff --git a/projects/ucap-webmessenger-ui-group/src/lib/ucap-ui-group.module.ts b/projects/ucap-webmessenger-ui-group/src/lib/ucap-ui-group.module.ts index c3b3a80f..3b2d44b1 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/ucap-ui-group.module.ts +++ b/projects/ucap-webmessenger-ui-group/src/lib/ucap-ui-group.module.ts @@ -16,6 +16,7 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; import { ExpansionPanelComponent } from './components/expansion-panel.component'; import { ExpansionPanelItemDirective } from './directives/expansion-panel-item.directive'; +import { TranslateModule } from '@ngx-translate/core'; const COMPONENTS = [ExpansionPanelComponent]; const DIALOGS = []; @@ -30,6 +31,8 @@ const SERVICES = []; ScrollingModule, + TranslateModule, + MatButtonModule, MatExpansionModule, MatIconModule, diff --git a/projects/ucap-webmessenger-ui-message/src/lib/components/list-item.component.html b/projects/ucap-webmessenger-ui-message/src/lib/components/list-item.component.html index b1d43fcd..4b54f7b0 100644 --- a/projects/ucap-webmessenger-ui-message/src/lib/components/list-item.component.html +++ b/projects/ucap-webmessenger-ui-message/src/lib/components/list-item.component.html @@ -19,6 +19,9 @@ {{ message.regDate | ucapDate: 'MM:DD' }} +
+ New +
diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html index ac470c43..9a8ace9a 100644 --- a/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html +++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html @@ -86,50 +86,48 @@ - - - - - - - - + + + + + + + - - - - - - - + + + + + +