From dbdc164e0f42f9c9247b160035ceac5533ef9b30 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 15 Jan 2020 14:05:36 +0900 Subject: [PATCH] =?UTF-8?q?1.=20=EC=A6=90=EA=B2=A8=EC=B0=BE=EA=B8=B0=20>?= =?UTF-8?q?=20=ED=94=84=EB=A1=9C=ED=95=84=20=EC=98=A4=ED=94=88=20>=20?= =?UTF-8?q?=EB=8F=99=EB=A3=8C=EC=82=AD=EC=A0=9C=EC=8B=9C=20'=EC=86=8C?= =?UTF-8?q?=EC=86=8D=EB=B6=80=EC=84=9C'=EA=B7=B8=EB=A3=B9=EC=97=90?= =?UTF-8?q?=EC=84=9C=EB=8F=84=20=EC=82=AD=EC=A0=9C=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95.=202.=20=EC=86=8C?= =?UTF-8?q?=EC=86=8D=EB=B6=80=EC=84=9C=20=EC=9D=B8=EC=9B=90=EB=93=A4?= =?UTF-8?q?=EC=9D=80=20=ED=83=80=20=EA=B7=B8=EB=A3=B9=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=EC=9D=84=20=EC=98=A4=ED=94=88?= =?UTF-8?q?=ED=95=9C=20=EA=B2=83=20=EC=9D=B4=EC=99=B8=EC=97=90=20=EB=8B=A4?= =?UTF-8?q?=EB=A5=B8=EA=B3=B3=EC=97=90=EC=84=9C=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=ED=95=84=20=EC=98=A4=ED=94=88=EC=8B=9C=20=EB=8F=99=EB=A3=8C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=EC=82=AD=EC=A0=9C=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=91=9C=ED=98=84=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- .../left-sidenav/group.component.ts | 32 +++++++++++-------- .../profile/profile.dialog.component.html | 1 + .../profile/profile.dialog.component.ts | 29 +++++++++++++++++ .../src/app/store/messenger/sync/effects.ts | 5 +-- .../src/assets/i18n/en.json | 3 ++ .../src/assets/i18n/ko.json | 3 ++ .../src/lib/types/openProfileOptions.ts | 2 +- .../src/lib/components/form.component.html | 9 +++++- .../src/lib/ucap-ui-chat.module.ts | 2 ++ .../src/lib/components/profile.component.html | 4 +-- .../src/lib/components/profile.component.ts | 27 +++++++++------- 12 files changed, 88 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 6c90d0be..0ee3a9f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ucap-webmessenger", - "version": "0.0.4", + "version": "0.0.5", "author": { "name": "LG CNS", "email": "lgucap@lgcns.com" 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 977359ea..fb1be996 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 @@ -481,16 +481,18 @@ export class GroupComponent implements OnInit, OnDestroy { ); switch (menuType) { case 'VIEW_PROFILE': + let useBuddyButton = false; + if ( + !!group && + environment.productConfig.CommonSetting.useMyDeptGroup && + environment.productConfig.CommonSetting.myDeptGroupSeq !== group.seq + ) { + useBuddyButton = true; + } this.openProfile.emit({ userSeq: userInfo.seq, openProfileOptions: { - useDelBuddybutton: - !!group && - environment.productConfig.CommonSetting.useMyDeptGroup && - environment.productConfig.CommonSetting.myDeptGroupSeq === - group.seq - ? false - : true + useBuddyButton } }); break; @@ -628,15 +630,19 @@ export class GroupComponent implements OnInit, OnDestroy { } onClickOpenProfile(userSeq: number, group: GroupDetailData) { + let useBuddyButton = false; + if ( + !!group && + environment.productConfig.CommonSetting.useMyDeptGroup && + environment.productConfig.CommonSetting.myDeptGroupSeq !== group.seq + ) { + useBuddyButton = true; + } + this.openProfile.emit({ userSeq, openProfileOptions: { - useDelBuddybutton: - !!group && - environment.productConfig.CommonSetting.useMyDeptGroup && - environment.productConfig.CommonSetting.myDeptGroupSeq === group.seq - ? false - : true + useBuddyButton } }); } 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 6b08580b..bce9f24d 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 @@ -7,6 +7,7 @@ [isBuddy]="isBuddy" [isFavorit]="isFavorit" [openProfileOptions]="data.openProfileOptions" + [useBuddyToggleButton]="useBuddyToggleButton" [authInfo]="authInfo" (openChat)="onClickChat($event)" (sendMessage)="onClickSendMessage($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 3ac14308..2a3681ac 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 @@ -78,8 +78,10 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { isBuddy: boolean; isFavorit: boolean; editableProfileImage: boolean; + useBuddyToggleButton: boolean; selectAllBuddy2Subscription: Subscription; + myDeptUserListSubscription: Subscription; constructor( public dialogRef: MatDialogRef, @@ -128,12 +130,37 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { }) ) .subscribe(); + + if (!!this.data.openProfileOptions) { + this.useBuddyToggleButton = !!this.data.openProfileOptions.useBuddyButton; + } else { + this.getCheckMyDeptUser(); + } } ngOnDestroy(): void { if (!!this.selectAllBuddy2Subscription) { this.selectAllBuddy2Subscription.unsubscribe(); } + if (!!this.myDeptUserListSubscription) { + this.myDeptUserListSubscription.unsubscribe(); + } + } + + getCheckMyDeptUser() { + this.myDeptUserListSubscription = this.store + .pipe( + select( + AppStore.MessengerSelector.QuerySelector.myDepartmentUserInfoList + ), + map(myDeptUserList => { + const users = myDeptUserList.filter( + buddy => buddy.seq === this.data.userInfo.seq + ); + this.useBuddyToggleButton = users.length === 0; + }) + ) + .subscribe(); } onClickChat(userInfo: UserInfoSS) { @@ -339,6 +366,8 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { SyncStore.delBuddyAndClear({ seq: param.userInfo.seq }) ); this.isBuddy = false; + + this.getCheckMyDeptUser(); } } } 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 8ffc6707..e760bb46 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 @@ -1015,8 +1015,9 @@ export class Effects { // 소속부서(내부서) 고정그룹 사용시 소속부서원을 삭제하지 않는다. if ( environment.productConfig.CommonSetting.useMyDeptGroup && - myDeptUserList.filter(deptUser => deptUser.seq === group.seq) - .length > 0 + environment.productConfig.CommonSetting.fixedGroupSeqs.filter( + fixedGroupSeq => fixedGroupSeq === group.seq + ).length > 0 ) { // skip;; } else { diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/en.json b/projects/ucap-webmessenger-app/src/assets/i18n/en.json index 43706be4..20202136 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/en.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/en.json @@ -199,6 +199,9 @@ "notificationIsOn": "Notification is on", "notificationIsOff": "Notification is off", "typeMessage": "Type your message.", + "btnAttachFile": "Attach files", + "btnSticker": "Sticker", + "btnTranslate": "Translate", "event": { "inviteToRoomWith": "{{owner}} invited {{inviter}}.", "exitFromRoomWith": "{{exitor}} has left.", diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json index 2e91f02a..14a009df 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json @@ -199,6 +199,9 @@ "notificationIsOn": "알림 켜짐", "notificationIsOff": "알림 꺼짐", "typeMessage": "대화를 입력하세요.", + "btnAttachFile": "첨부파일", + "btnSticker": "스티커", + "btnTranslate": "번역", "event": { "inviteToRoomWith": "{{owner}}이 {{inviter}}을 초대했습니다.", "exitFromRoomWith": "{{exitor}}님이 퇴장하셨습니다.", diff --git a/projects/ucap-webmessenger-protocol-buddy/src/lib/types/openProfileOptions.ts b/projects/ucap-webmessenger-protocol-buddy/src/lib/types/openProfileOptions.ts index e7ad071d..9a1cda7b 100644 --- a/projects/ucap-webmessenger-protocol-buddy/src/lib/types/openProfileOptions.ts +++ b/projects/ucap-webmessenger-protocol-buddy/src/lib/types/openProfileOptions.ts @@ -1,3 +1,3 @@ export interface OpenProfileOptions { - useDelBuddybutton?: boolean; + useBuddyButton?: boolean; } diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/form.component.html b/projects/ucap-webmessenger-ui-chat/src/lib/components/form.component.html index b08053ed..ea9500a1 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/form.component.html +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/form.component.html @@ -5,7 +5,12 @@ fxLayoutAlign="center center" >
- sentiment_satisfied_alt @@ -28,6 +34,7 @@ mat-icon-button class="material-icons" (click)="onClickTranslation()" + matTooltip="{{ 'chat.btnTranslate' | translate }}" > g_translate diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/ucap-ui-chat.module.ts b/projects/ucap-webmessenger-ui-chat/src/lib/ucap-ui-chat.module.ts index c2df5dd4..0923634d 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/ucap-ui-chat.module.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/ucap-ui-chat.module.ts @@ -34,6 +34,7 @@ import { VideoConferenceComponent as MBVideoConferenceComponent } from './compon import { AllimComponent as MBAllimComponent } from './components/message-box/allim.component'; import { SearchComponent } from './components/search.component'; import { TranslateModule } from '@ngx-translate/core'; +import { MatTooltipModule } from '@angular/material'; const COMPONENTS = [ FormComponent, @@ -72,6 +73,7 @@ const PROVIDERS = [DatePipe]; MatInputModule, MatButtonModule, MatMenuModule, + MatTooltipModule, TranslateModule, 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 efcbb32e..3f58ac48 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 @@ -98,7 +98,7 @@ stroke-linecap="butt" stroke-linejoin="round" class="on" - *ngIf="!isBuddy" + *ngIf="getShowBuddyToggleBtn('ADD')" (click)="onClickAddBuddy()" matTooltip="{{ 'profile.addBuddy' | translate }}" > @@ -120,7 +120,7 @@ stroke-linecap="butt" stroke-linejoin="round" class="on" - *ngIf="getShowBuddyDelBtn()" + *ngIf="getShowBuddyToggleBtn('DEL')" (click)="onClickDelBuddy()" matTooltip="{{ 'profile.removeBuddy' | translate }}" > diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.ts b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.ts index 5a60256f..1e7c984d 100644 --- a/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.ts +++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.ts @@ -41,6 +41,8 @@ export class ProfileComponent implements OnInit { @Input() openProfileOptions?: OpenProfileOptions; @Input() + useBuddyToggleButton: boolean; + @Input() authInfo: AuthResponse; @Output() @@ -225,18 +227,21 @@ export class ProfileComponent implements OnInit { return true; } - getShowBuddyDelBtn(): boolean { - if (!!this.isBuddy) { - if ( - !!this.openProfileOptions && - !this.openProfileOptions.useDelBuddybutton - ) { - return false; - } - - return true; + getShowBuddyToggleBtn(type: 'DEL' | 'ADD'): boolean { + let rtn = false; + if (!this.useBuddyToggleButton) { + return false; } - return false; + if (type === 'ADD') { + if (!this.isBuddy) { + rtn = true; + } + } else if (type === 'DEL') { + if (!!this.isBuddy) { + rtn = true; + } + } + return rtn; } }