From 1ccd32957f1c766b3d19b51bbf47a7e946ad3da4 Mon Sep 17 00:00:00 2001 From: leejinho Date: Sun, 15 Dec 2019 17:43:48 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A1=B0=EC=A7=81=EB=8F=84=20=EB=B6=80?= =?UTF-8?q?=EC=84=9C=EC=9B=90=EC=9D=98=20context=20=EB=A9=94=EB=89=B4=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=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.ts | 73 ++++++++++++++++++- .../src/app/resolvers/messenger.resolver.ts | 1 - 3 files changed, 105 insertions(+), 2 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 0b8a1051..79f9b241 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 @@ -67,6 +67,7 @@ (checkUser)="onCheckUser($event)" (openProfile)="onClickOpenProfile($event)" (click)="onToggleUser(userInfo)" + (contextmenu)="onContextMenuOrgUser($event, userInfo)" > @@ -88,6 +89,7 @@ (checkUser)="onCheckUser($event)" (openProfile)="onClickOpenProfile($event)" (click)="onToggleUser(userInfo)" + (contextmenu)="onContextMenuOrgUser($event, userInfo)" > @@ -138,3 +140,34 @@ + +
+ + + + + + + + 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 d149dbdf..ad5f6e68 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 @@ -32,7 +32,13 @@ import * as SyncStore from '@app/store/messenger/sync'; import * as ChatStore from '@app/store/messenger/chat'; import * as StatusStore from '@app/store/messenger/status'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; -import { LoginInfo, KEY_LOGIN_INFO, KEY_VER_INFO } from '@app/types'; +import { + LoginInfo, + KEY_LOGIN_INFO, + KEY_VER_INFO, + EnvironmentsInfo, + KEY_ENVIRONMENTS_INFO +} from '@app/types'; import { take, map, tap, delay, catchError } from 'rxjs/operators'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { @@ -44,6 +50,12 @@ import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { Company } from '@ucap-webmessenger/api-external'; import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; +import { MatMenuTrigger } from '@angular/material'; +import { + MessageWriteDialogComponent, + MessageWriteDialogResult, + MessageWriteDialogData +} from '../../dialogs/message/message-write.dialog.component'; @Component({ selector: 'app-layout-chat-left-sidenav-organization', @@ -53,6 +65,10 @@ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; }) export class OrganizationComponent implements OnInit, OnDestroy, AfterViewChecked { + @ViewChild('orgUserContextMenuTrigger', { static: true }) + orgUserContextMenuTrigger: MatMenuTrigger; + orgUserContextMenuPosition = { x: '0px', y: '0px' }; + @Input() showTitle = true; @Input() @@ -106,6 +122,7 @@ export class OrganizationComponent loginInfo: LoginInfo; loginRes: LoginResponse; sessionVerinfo: VersionInfo2Response; + environmentsInfo: EnvironmentsInfo; isShowSearch = false; searchUserInfos: UserInfoSS[] = []; @@ -124,6 +141,9 @@ export class OrganizationComponent this.sessionVerinfo = this.sessionStorageService.get( KEY_VER_INFO ); + this.environmentsInfo = this.sessionStorageService.get( + KEY_ENVIRONMENTS_INFO + ); } ngOnInit() { @@ -440,4 +460,55 @@ export class OrganizationComponent onClickConference() { this.logger.debug('onClickConference', this.selectedUserList); } + + onContextMenuOrgUser( + event: MouseEvent, + userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN + ) { + event.preventDefault(); + event.stopPropagation(); + + this.orgUserContextMenuPosition.x = event.clientX + 'px'; + this.orgUserContextMenuPosition.y = event.clientY + 'px'; + this.orgUserContextMenuTrigger.menu.focusFirstItem('mouse'); + this.orgUserContextMenuTrigger.menuData = { userInfo }; + this.orgUserContextMenuTrigger.openMenu(); + } + + async onClickContextMenu(type: string, userInfo: UserInfo) { + console.log(userInfo); + switch (type) { + case 'CALL_LINE': + { + } + break; + case 'CALL_MOBILE': + { + } + break; + case 'SEND_MESSAGE': + { + this.dialogService.open< + MessageWriteDialogComponent, + MessageWriteDialogData, + MessageWriteDialogResult + >(MessageWriteDialogComponent, { + width: '600px', + height: '600px', + disableClose: true, + hasBackdrop: false, + data: { + loginRes: this.loginRes, + environmentsInfo: this.environmentsInfo, + receiverList: [userInfo] + } + }); + } + break; + case 'SEND_SMS': + { + } + break; + } + } } diff --git a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts index 65b68e40..2feb3a2c 100644 --- a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts +++ b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts @@ -119,7 +119,6 @@ export class AppMessengerResolver implements Resolve { }) .pipe( map(response => { - console.log(response); if (response.statusCode === StatusCode.Success) { this.sessionStorageService.set< UrlInfoResponse | DaesangUrlInfoResponse