From f7b782df1453046658833acd2bf2415838e2012c Mon Sep 17 00:00:00 2001 From: leejinho Date: Tue, 17 Dec 2019 17:41:08 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83?= =?UTF-8?q?=EC=8B=9C=20=EC=9B=B9=EB=A7=81=ED=81=AC=20=ED=8C=9D=EC=97=85=20?= =?UTF-8?q?=EB=82=A8=EC=95=84=20=EC=9E=88=EB=8A=94=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/layouts/native/components/top-bar.component.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts index ed8f6f5b..06916af0 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts @@ -76,6 +76,8 @@ export class TopBarComponent implements OnInit, OnDestroy { KEY_LOGIN_INFO ); + this.showWeblink = false; + // WebLink init.. this.initWebLink(); }) From 2a992606b2464e39301a64ef96d598eff88fb91a Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 18 Dec 2019 08:40:45 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EA=B3=A0=EC=A0=95=EA=B7=B8=EB=A3=B9?= =?UTF-8?q?=EC=97=90=20=EB=8C=80=ED=95=9C=20=ED=95=B8=EB=93=A4=EB=A7=81=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/left-sidenav/group.component.ts | 16 ++++++++++++++++ .../group/select-group.dialog.component.ts | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) 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 7cc0f1ec..dea79d60 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 @@ -381,6 +381,22 @@ export class GroupComponent implements OnInit, OnDestroy { } } + /** 수정불가 그룹 핸들링. */ + if ( + !!group && + !!environment.customConfig && + !!environment.customConfig.fixedGroupSeqs + ) { + const fixedGroupSeqs: number[] = environment.customConfig.fixedGroupSeqs; + if (!!fixedGroupSeqs && fixedGroupSeqs.length > 0) { + if (fixedGroupSeqs.indexOf(group.seq) > -1) { + if (menuType === 'REMOVE_FROM_GROUP' || menuType === 'MOVE_BUDDY') { + return false; + } + } + } + } + return true; } async onClickProfileContextMenu( diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.ts index a92a2d71..e50d998a 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.ts @@ -19,6 +19,7 @@ import { ConfirmDialogResult } from '@ucap-webmessenger/ui'; import { GroupDetailData, UserInfo } from '@ucap-webmessenger/protocol-sync'; +import { environment } from '../../../../../environments/environment'; export interface SelectGroupDialogData { title: string; @@ -68,11 +69,27 @@ export class SelectGroupDialogComponent implements OnInit { ) ]).pipe( map(([buddyList, groupList]) => { + /** 수정불가 그룹 */ + let fixedGroupSeqs: number[]; + if ( + !!environment.customConfig && + !!environment.customConfig.fixedGroupSeqs + ) { + fixedGroupSeqs = environment.customConfig.fixedGroupSeqs; + } + const groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[]; }[] = []; for (const group of groupList) { + /** 수정불가 그룹 필터링. */ + if (!!fixedGroupSeqs && fixedGroupSeqs.length > 0) { + if (fixedGroupSeqs.indexOf(group.seq) > -1) { + continue; + } + } + groupBuddyList.push({ group, buddyList: buddyList.filter(buddy => { From 8e40d81f92d2ae3bf8415a792bdba65dca411c00 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 18 Dec 2019 08:49:34 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EC=9B=B9=EB=A7=81=ED=81=AC=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../native/components/top-bar.component.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts index 06916af0..0ff1b622 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts @@ -110,14 +110,14 @@ export class TopBarComponent implements OnInit, OnDestroy { this.weblink = urlInfo.webLink.filter( weblink => - urlInfo.webLinkAllowedList.filter(type => type === weblink.key) - .length > 0 + urlInfo.webLinkAllowedList + .filter( + type => type !== 'WebLinkMailCnt' && type !== 'WebLinkPaymentCnt' + ) + .filter(type => type === weblink.key).length > 0 ); - if ( - urlInfo.webLinkAllowedList.indexOf('WebLinkMail') > -1 && - urlInfo.webLinkAllowedList.indexOf('WebLinkMailCnt') > -1 - ) { + if (urlInfo.webLinkAllowedList.indexOf('WebLinkMail') > -1) { // 메일 카운트 체크. const link = urlInfo.webLink.filter( weblink => weblink.key === 'WebLinkMailCnt' @@ -149,10 +149,7 @@ export class TopBarComponent implements OnInit, OnDestroy { .subscribe(); } } - if ( - urlInfo.webLinkAllowedList.indexOf('WebLinkPayment') > -1 && - urlInfo.webLinkAllowedList.indexOf('WebLinkPaymentCnt') > -1 - ) { + if (urlInfo.webLinkAllowedList.indexOf('WebLinkPayment') > -1) { // 결제 카운트 체크. const link = urlInfo.webLink.filter( weblink => weblink.key === 'WebLinkPaymentCnt' From 0233ef4117cdb43ef1da5983b33f672e9998529c Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 18 Dec 2019 09:56:00 +0900 Subject: [PATCH 4/5] =?UTF-8?q?SMS=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/left-side.component.html | 1 + .../components/left-side.component.ts | 5 +++ .../left-sidenav/organization.component.ts | 3 ++ .../profile/profile.dialog.component.html | 1 + .../profile/profile.dialog.component.ts | 39 ++++++++++++++++++ .../components/main.page.component.html | 3 +- .../components/main.page.component.ts | 34 +++++++++++++-- .../src/lib/utils/SmsUtils.ts | 41 +++++++++++++++++++ .../src/public-api.ts | 2 + .../src/lib/components/profile.component.ts | 31 ++++++++------ 10 files changed, 144 insertions(+), 16 deletions(-) create mode 100644 projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html index 95753c09..6210fdc8 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html @@ -189,6 +189,7 @@ (checkUser)="onCheckUser($event)" (openProfile)="onClickOpenProfile($event)" (sendCall)="onClickSendClickToCall($event)" + (sendSms)="onClickSendSms($event)" (toggleUser)="onToggleUser($event)" class="organization-side" > 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 de92a4d2..df83a1f0 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 @@ -73,6 +73,8 @@ export class LeftSideComponent implements OnInit, OnDestroy { >(); @Output() sendCall = new EventEmitter(); + @Output() + sendSms = new EventEmitter(); @ViewChildren('tabs') tabs: QueryList>; currentTabLable: string; @@ -265,6 +267,9 @@ export class LeftSideComponent implements OnInit, OnDestroy { onClickSendClickToCall(calleeNumber: string) { this.sendCall.emit(calleeNumber); } + onClickSendSms(calleeNumber: string) { + this.sendSms.emit(calleeNumber); + } onSelectedTabChange(event: MatTabChangeEvent) { this.setFabInitial(event.tab.ariaLabel); 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 abe5b8dd..62b18a7a 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 @@ -103,6 +103,8 @@ export class OrganizationComponent >(); @Output() sendCall = new EventEmitter(); + @Output() + sendSms = new EventEmitter(); @ViewChild('cvsvDeptUser', { static: false }) cvsvDeptUser: CdkVirtualScrollViewport; @@ -553,6 +555,7 @@ export class OrganizationComponent break; case 'SEND_SMS': { + this.sendSms.emit(userInfo.hpNumber); } break; } 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 4e5d5c80..ba91ea92 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 @@ -8,6 +8,7 @@ (openChat)="onClickChat($event)" (sendMessage)="onClickSendMessage($event)" (sendCall)="onClickSendClickToCall($event)" + (sendSms)="onClickSendSms($event)" (toggleFavorit)="onClickToggleFavorit($event)" (toggleBuddy)="onClickToggleBuddy($event)" (uploadProfileImage)="onUploadProfileImage($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 f9e2c908..d4b20aa0 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 @@ -48,6 +48,8 @@ import { PromptMessageStatusCode } from '@ucap-webmessenger/api-prompt'; import { NGXLogger } from 'ngx-logger'; +import { SmsUtils } from '@ucap-webmessenger/daesang'; +import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; export interface ProfileDialogData { userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; @@ -74,6 +76,7 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { constructor( public dialogRef: MatDialogRef, + @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @Inject(MAT_DIALOG_DATA) public data: ProfileDialogData, private dialogService: DialogService, private sessionStorageService: SessionStorageService, @@ -222,6 +225,42 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { } } + onClickSendSms(calleeNumber: string) { + const smsUtil = new SmsUtils( + this.sessionStorageService, + this.nativeService + ); + if (!smsUtil.getAuthSms()) { + this.dialogService.open< + AlertDialogComponent, + AlertDialogData, + AlertDialogResult + >(AlertDialogComponent, { + data: { + title: '', + html: `SMS 사용 권한이 없습니다.` + } + }); + return false; + } + + calleeNumber = calleeNumber.replace(/\D/g, ''); + if (!!calleeNumber && calleeNumber.length > 0) { + smsUtil.openSendSms(this.loginRes.tokenString, [calleeNumber]); + } else { + // this.dialogService.open< + // AlertDialogComponent, + // AlertDialogData, + // AlertDialogResult + // >(AlertDialogComponent, { + // data: { + // title: '', + // html: `상대방 번호가 없어 전화를 걸 수 없습니다.` + // } + // }); + } + } + onClickToggleFavorit(param: { userInfo: UserInfoSS; isFavorit: boolean }) { this.store.dispatch( SyncStore.updateBuddy({ diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html index 52d5dfd5..878bd84f 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html +++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html @@ -17,7 +17,8 @@
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 edccad61..7d885103 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 @@ -41,9 +41,13 @@ import { import { MatDrawer } from '@angular/material'; import { NGXLogger } from 'ngx-logger'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; -import { DaesangProtocolService } from '@ucap-webmessenger/daesang'; +import { DaesangProtocolService, SmsUtils } from '@ucap-webmessenger/daesang'; import { CallService } from '@ucap-webmessenger/api-prompt'; -import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types'; +import { + EnvironmentsInfo, + KEY_ENVIRONMENTS_INFO, + KEY_URL_INFO +} from '@app/types'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { MessageApiService, @@ -56,6 +60,7 @@ 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', @@ -280,7 +285,7 @@ export class MainPageComponent implements OnInit, OnDestroy { .subscribe(); } - async onClickSendClickToCall(calleeNumber: string) { + async sendClickToCall(calleeNumber: string) { const madn = this.loginRes.madn; if (!madn || madn.trim().length === 0) { this.dialogService.open< @@ -342,6 +347,29 @@ export class MainPageComponent implements OnInit, OnDestroy { } } + openSms(calleeNumber: string) { + const smsUtil = new SmsUtils( + this.sessionStorageService, + this.nativeService + ); + if (!smsUtil.getAuthSms()) { + this.dialogService.open< + AlertDialogComponent, + AlertDialogData, + AlertDialogResult + >(AlertDialogComponent, { + data: { + title: '', + html: `SMS 사용 권한이 없습니다.` + } + }); + return false; + } + + calleeNumber = calleeNumber.replace(/\D/g, ''); + smsUtil.openSendSms(this.loginRes.tokenString, [calleeNumber]); + } + onCloseRightDrawer() { this.rightDrawer.close(); } diff --git a/projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts b/projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts new file mode 100644 index 00000000..ea8aa7d3 --- /dev/null +++ b/projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts @@ -0,0 +1,41 @@ +import { DaesangUrlInfoResponse } from '@ucap-webmessenger/api-external'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { KEY_URL_INFO } from '@app/types'; +import { NativeService } from '@ucap-webmessenger/native'; + +export class SmsUtils { + constructor( + private sessionStorageService: SessionStorageService, + private nativeService: NativeService + ) {} + + url: string; + + getAuthSms(): boolean { + const urlInfo: DaesangUrlInfoResponse = this.sessionStorageService.get< + DaesangUrlInfoResponse + >(KEY_URL_INFO); + + if ( + !!urlInfo && + !!urlInfo.webLinkAllowedList && + urlInfo.webLinkAllowedList.indexOf('WebLinkSms') > -1 && + !!urlInfo.webLink && + urlInfo.webLink.length > 0 && + urlInfo.webLink.filter(weblink => weblink.key === 'WebLinkSms').length > 0 + ) { + this.url = urlInfo.webLink.filter( + weblink => weblink.key === 'WebLinkSms' + )[0].url; + return true; + } else { + return false; + } + } + + openSendSms(token: string, calleeNumber?: string[]) { + const url = this.url.replace(/(\(%USER_TOKEN%\))/g, token); + + this.nativeService.openDefaultBrowser(url); + } +} diff --git a/projects/ucap-webmessenger-daesang/src/public-api.ts b/projects/ucap-webmessenger-daesang/src/public-api.ts index 1538c751..4f0d5f88 100644 --- a/projects/ucap-webmessenger-daesang/src/public-api.ts +++ b/projects/ucap-webmessenger-daesang/src/public-api.ts @@ -8,6 +8,8 @@ export * from './lib/services/daesang-api.service'; export * from './lib/services/daesang-cipher.service'; export * from './lib/services/daesang-protocol.service'; +export * from './lib/utils/SmsUtils'; + export * from './lib/ucap-daesang.module'; export * from './lib/protocols/data-user'; 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 8480ad13..a08e64f0 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 @@ -5,13 +5,17 @@ import { EventEmitter, Output, ViewChild, - ElementRef + ElementRef, + Inject } from '@angular/core'; import { UserInfo } from '@ucap-webmessenger/protocol-sync'; import { UserInfoF, UserInfoSS } from '@ucap-webmessenger/protocol-query'; import { FileUploadItem } from '@ucap-webmessenger/api'; import { FormControl } from '@angular/forms'; +import { SmsUtils } from '@ucap-webmessenger/daesang'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; @Component({ selector: 'ucap-profile-profile', @@ -39,6 +43,8 @@ export class ProfileComponent implements OnInit { @Output() sendCall = new EventEmitter(); @Output() + sendSms = new EventEmitter(); + @Output() toggleFavorit = new EventEmitter<{ userInfo: UserInfoSS; isFavorit: boolean; @@ -59,7 +65,10 @@ export class ProfileComponent implements OnInit { profileImageFileUploadItem: FileUploadItem; - constructor() {} + constructor( + private sessionStorageService: SessionStorageService, + @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService + ) {} ngOnInit() {} @@ -78,7 +87,9 @@ export class ProfileComponent implements OnInit { this.sendCall.emit(calleeNumber); } - onClickSMS() {} + onClickSMS() { + this.sendSms.emit(this.userInfo.hpNumber); + } onClickVideoConference() {} @@ -169,15 +180,11 @@ export class ProfileComponent implements OnInit { return true; } } else if (type === 'SMS') { - if ( - !!this.userInfo && - !!this.userInfo.hpNumber && - this.userInfo.hpNumber.trim().length > 0 - ) { - return false; - } else { - return true; - } + const smsUtils = new SmsUtils( + this.sessionStorageService, + this.nativeService + ); + return !smsUtils.getAuthSms(); } return true; From 76a66088bddf6bc4eb493e63582f224e24360f3a Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 18 Dec 2019 10:46:42 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EC=97=85=EB=A1=9C=EB=93=9C=20=EC=98=B5?= =?UTF-8?q?=EC=85=98=EC=B2=98=EB=A6=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messenger/dialogs/profile/profile.dialog.component.html | 1 + .../messenger/dialogs/profile/profile.dialog.component.ts | 5 +++++ .../src/environments/environment.daesang.dev.ts | 3 +++ .../src/environments/environment.daesang.prod.ts | 3 +++ .../src/environments/environment.dev.ts | 3 +++ .../src/environments/environment.prod.ts | 3 +++ .../src/environments/environment.type.ts | 4 ++++ .../src/lib/components/profile.component.html | 2 +- .../src/lib/components/profile.component.ts | 2 ++ 9 files changed, 25 insertions(+), 1 deletion(-) 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 ba91ea92..0f6e404f 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 @@ -1,6 +1,7 @@