Merge branch 'master' of https://git.loafle.net/ucap-web/next-ucap-messenger
This commit is contained in:
commit
76dd6883d3
|
@ -189,6 +189,7 @@
|
|||
(checkUser)="onCheckUser($event)"
|
||||
(openProfile)="onClickOpenProfile($event)"
|
||||
(sendCall)="onClickSendClickToCall($event)"
|
||||
(sendSms)="onClickSendSms($event)"
|
||||
(toggleUser)="onToggleUser($event)"
|
||||
class="organization-side"
|
||||
></app-layout-chat-left-sidenav-organization>
|
||||
|
|
|
@ -73,6 +73,8 @@ export class LeftSideComponent implements OnInit, OnDestroy {
|
|||
>();
|
||||
@Output()
|
||||
sendCall = new EventEmitter<string>();
|
||||
@Output()
|
||||
sendSms = new EventEmitter<string>();
|
||||
|
||||
@ViewChildren('tabs') tabs: QueryList<ElementRef<HTMLDivElement>>;
|
||||
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);
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -103,6 +103,8 @@ export class OrganizationComponent
|
|||
>();
|
||||
@Output()
|
||||
sendCall = new EventEmitter<string>();
|
||||
@Output()
|
||||
sendSms = new EventEmitter<string>();
|
||||
|
||||
@ViewChild('cvsvDeptUser', { static: false })
|
||||
cvsvDeptUser: CdkVirtualScrollViewport;
|
||||
|
@ -553,6 +555,7 @@ export class OrganizationComponent
|
|||
break;
|
||||
case 'SEND_SMS':
|
||||
{
|
||||
this.sendSms.emit(userInfo.hpNumber);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<ucap-profile-profile
|
||||
[userInfo]="userInfo"
|
||||
[profileImageRoot]="sessionVerinfo.profileRoot"
|
||||
[editableProfileImage]="editableProfileImage"
|
||||
[isMe]="isMe"
|
||||
[myMadn]="loginRes.madn"
|
||||
[isBuddy]="isBuddy"
|
||||
|
@ -8,6 +9,7 @@
|
|||
(openChat)="onClickChat($event)"
|
||||
(sendMessage)="onClickSendMessage($event)"
|
||||
(sendCall)="onClickSendClickToCall($event)"
|
||||
(sendSms)="onClickSendSms($event)"
|
||||
(toggleFavorit)="onClickToggleFavorit($event)"
|
||||
(toggleBuddy)="onClickToggleBuddy($event)"
|
||||
(uploadProfileImage)="onUploadProfileImage($event)"
|
||||
|
|
|
@ -48,6 +48,9 @@ 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';
|
||||
import { environment } from '../../../../../environments/environment';
|
||||
|
||||
export interface ProfileDialogData {
|
||||
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
|
||||
|
@ -69,11 +72,13 @@ export class ProfileDialogComponent implements OnInit, OnDestroy {
|
|||
isMe: boolean;
|
||||
isBuddy: boolean;
|
||||
isFavorit: boolean;
|
||||
editableProfileImage: boolean;
|
||||
|
||||
selectAllBuddy2Subscription: Subscription;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ProfileDialogData, ProfileDialogResult>,
|
||||
@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({
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
<div class="left-side">
|
||||
<app-layout-messenger-left-side
|
||||
(openProfile)="onClickOpenProfile($event)"
|
||||
(sendCall)="onClickSendClickToCall($event)"
|
||||
(sendCall)="sendClickToCall($event)"
|
||||
(sendSms)="openSms($event)"
|
||||
></app-layout-messenger-left-side>
|
||||
</div>
|
||||
</as-split-area>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@ export const environment: Environment = {
|
|||
notification: {
|
||||
chatMessage: true
|
||||
}
|
||||
},
|
||||
CommonSetting: {
|
||||
editableProfileImage: false
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -50,6 +50,9 @@ export const environment: Environment = {
|
|||
notification: {
|
||||
chatMessage: true
|
||||
}
|
||||
},
|
||||
CommonSetting: {
|
||||
editableProfileImage: false
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -50,6 +50,9 @@ export const environment: Environment = {
|
|||
notification: {
|
||||
chatMessage: true
|
||||
}
|
||||
},
|
||||
CommonSetting: {
|
||||
editableProfileImage: true
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -50,6 +50,9 @@ export const environment: Environment = {
|
|||
notification: {
|
||||
chatMessage: true
|
||||
}
|
||||
},
|
||||
CommonSetting: {
|
||||
editableProfileImage: true
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -62,6 +62,10 @@ export interface Environment {
|
|||
intervalHour: number;
|
||||
};
|
||||
defaultSettings: Settings;
|
||||
|
||||
CommonSetting: {
|
||||
editableProfileImage: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
customConfig?: any;
|
||||
|
|
41
projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts
Normal file
41
projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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';
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<button
|
||||
mat-mini-fab
|
||||
class="mat-elevation-z6 upload-profile-image-btn"
|
||||
*ngIf="isMe"
|
||||
*ngIf="isMe && editableProfileImage"
|
||||
matTooltip="프로필 이미지 변경"
|
||||
matTooltipPosition="above"
|
||||
[disabled]="
|
||||
|
|
|
@ -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',
|
||||
|
@ -22,6 +26,8 @@ export class ProfileComponent implements OnInit {
|
|||
@Input()
|
||||
profileImageRoot: string;
|
||||
@Input()
|
||||
editableProfileImage: boolean;
|
||||
@Input()
|
||||
isMe: boolean;
|
||||
@Input()
|
||||
isBuddy: boolean;
|
||||
|
@ -39,6 +45,8 @@ export class ProfileComponent implements OnInit {
|
|||
@Output()
|
||||
sendCall = new EventEmitter<string>();
|
||||
@Output()
|
||||
sendSms = new EventEmitter<string>();
|
||||
@Output()
|
||||
toggleFavorit = new EventEmitter<{
|
||||
userInfo: UserInfoSS;
|
||||
isFavorit: boolean;
|
||||
|
@ -59,7 +67,10 @@ export class ProfileComponent implements OnInit {
|
|||
|
||||
profileImageFileUploadItem: FileUploadItem;
|
||||
|
||||
constructor() {}
|
||||
constructor(
|
||||
private sessionStorageService: SessionStorageService,
|
||||
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
|
||||
) {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
|
@ -78,7 +89,9 @@ export class ProfileComponent implements OnInit {
|
|||
this.sendCall.emit(calleeNumber);
|
||||
}
|
||||
|
||||
onClickSMS() {}
|
||||
onClickSMS() {
|
||||
this.sendSms.emit(this.userInfo.hpNumber);
|
||||
}
|
||||
|
||||
onClickVideoConference() {}
|
||||
|
||||
|
@ -169,15 +182,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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user