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/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/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/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 => { 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..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 @@ , + @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @Inject(MAT_DIALOG_DATA) public data: ProfileDialogData, private dialogService: DialogService, private sessionStorageService: SessionStorageService, @@ -94,6 +99,9 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { ); this.userInfo = data.userInfo; + + this.editableProfileImage = + environment.productConfig.CommonSetting.editableProfileImage; } ngOnInit() { @@ -222,6 +230,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/layouts/native/components/top-bar.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts index ed8f6f5b..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 @@ -76,6 +76,8 @@ export class TopBarComponent implements OnInit, OnDestroy { KEY_LOGIN_INFO ); + this.showWeblink = false; + // WebLink init.. this.initWebLink(); }) @@ -108,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' @@ -147,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' 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-app/src/environments/environment.daesang.dev.ts b/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts index e26a38dd..72decdd7 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts @@ -50,6 +50,9 @@ export const environment: Environment = { notification: { chatMessage: true } + }, + CommonSetting: { + editableProfileImage: false } }, 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 a9f86eb7..1d1e4261 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts @@ -50,6 +50,9 @@ export const environment: Environment = { notification: { chatMessage: true } + }, + CommonSetting: { + editableProfileImage: false } }, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.dev.ts b/projects/ucap-webmessenger-app/src/environments/environment.dev.ts index 2ba18fb5..806d123f 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.dev.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.dev.ts @@ -50,6 +50,9 @@ export const environment: Environment = { notification: { chatMessage: true } + }, + CommonSetting: { + editableProfileImage: true } }, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.prod.ts b/projects/ucap-webmessenger-app/src/environments/environment.prod.ts index eb6f9934..c29d2b50 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.prod.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.prod.ts @@ -50,6 +50,9 @@ export const environment: Environment = { notification: { chatMessage: true } + }, + CommonSetting: { + editableProfileImage: true } }, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.type.ts b/projects/ucap-webmessenger-app/src/environments/environment.type.ts index baf4e477..666fc6c4 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.type.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.type.ts @@ -62,6 +62,10 @@ export interface Environment { intervalHour: number; }; defaultSettings: Settings; + + CommonSetting: { + editableProfileImage: boolean; + }; }; customConfig?: any; 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.html b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html index d84702eb..843e7637 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 @@ -33,7 +33,7 @@