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; } }