This commit is contained in:
병준 박 2019-12-15 18:07:43 +09:00
commit 497f04efca
30 changed files with 602 additions and 161 deletions

View File

@ -9,6 +9,7 @@ import {
export interface UrlInfoRequest extends APIRequest {
deviceType: DeviceType;
loginId?: string;
}
export interface UrlInfoResponse extends APIResponse {
@ -26,8 +27,19 @@ export interface UrlInfoResponse extends APIResponse {
synapViewUrl?: string;
}
export interface DaesangUrlInfoResponse extends UrlInfoResponse {
webLink: WebLink[];
webLinkAllowedList: string[];
}
export interface WebLink {
key: string;
title: string;
url: string;
}
const urlInfoEncodeMap = {
deviceType: 'p_device_type'
deviceType: 'p_device_type',
loginId: 'p_user_id'
};
export const encodeUrlInfo: APIEncoder<UrlInfoRequest> = (
@ -54,3 +66,149 @@ export const decodeUrlInfo: APIDecoder<UrlInfoResponse> = (res: any) => {
synapViewUrl: res.SynapViewURL
} as UrlInfoResponse;
};
export const decodeUrlInfoDaesang: APIDecoder<DaesangUrlInfoResponse> = (
res: any
) => {
const webLink: WebLink[] = [];
if (!!res.WebLinkWebhard) {
const arr = res.WebLinkWebhard.split(',');
webLink.push({
key: 'WebLinkWebhard',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkDsp) {
const arr = res.WebLinkDsp.split(',');
webLink.push({
key: 'WebLinkDsp',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkSms) {
const arr = res.WebLinkSms.split(',');
webLink.push({
key: 'WebLinkSms',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkConf) {
const arr = res.WebLinkConf.split(',');
webLink.push({
key: 'WebLinkConf',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkEp) {
const arr = res.WebLinkEp.split(',');
webLink.push({
key: 'WebLinkEp',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkSop) {
const arr = res.WebLinkSop.split(',');
webLink.push({
key: 'WebLinkSop',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkSom) {
const arr = res.WebLinkSom.split(',');
webLink.push({
key: 'WebLinkSom',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkElephant) {
const arr = res.WebLinkElephant.split(',');
webLink.push({
key: 'WebLinkElephant',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkItsvcdesk) {
const arr = res.WebLinkItsvcdesk.split(',');
webLink.push({
key: 'WebLinkItsvcdesk',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkUrgntNews) {
const arr = res.WebLinkUrgntNews.split(',');
webLink.push({
key: 'WebLinkUrgntNews',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkMailCnt) {
const arr = res.WebLinkMailCnt.split(',');
webLink.push({
key: 'WebLinkMailCnt',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkMail) {
const arr = res.WebLinkMail.split(',');
webLink.push({
key: 'WebLinkMail',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkPaymentCnt) {
const arr = res.WebLinkPaymentCnt.split(',');
webLink.push({
key: 'WebLinkPaymentCnt',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkPayment) {
const arr = res.WebLinkPayment.split(',');
webLink.push({
key: 'WebLinkPayment',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
if (!!res.WebLinkChgPassword) {
const arr = res.WebLinkChgPassword.split(',');
webLink.push({
key: 'WebLinkChgPassword',
title: arr.length > 1 ? arr[0] : '',
url: arr.length > 1 ? arr[1] : arr[0]
});
}
return {
statusCode: res.StatusCode,
errorMessage: res.ErrorMessage,
portCheckUrl: res.PortCheckURL,
messageUrl: res.MsgURL,
messageUrl2: res.MsgURL2,
passwordUrl: res.PasswordURL,
planUrl: res.PlanURL,
planUrl2: res.PlanURL2,
vocUrl: res.VocURL,
confUrl: res.ConfURL,
uprApiUrl: res.UprApiURL,
uprSvcUrl: res.UprSvcURL,
uprDownloadUrl: res.UprDownloadURL,
synapViewUrl: res.SynapViewURL,
webLink,
webLinkAllowedList: res.WebLinkAllowedList.split(',')
} as DaesangUrlInfoResponse;
};

View File

@ -8,25 +8,27 @@ import {
CheckUserInfoExRequest,
CheckUserInfoExResponse,
encodeCheckUserInfoEx,
decodeCheckUserInfoEx,
decodeCheckUserInfoEx
} from '../apis/check-user-info-ex';
import {
CompanyListRequest,
CompanyListResponse,
encodeCompanyList,
decodeCompanyList,
decodeCompanyList
} from '../apis/company-list';
import {
TokenUpdateRequest,
TokenUpdateResponse,
encodeTokenUpdate,
decodeTokenUpdate,
decodeTokenUpdate
} from '../apis/token-update';
import {
UrlInfoResponse,
UrlInfoRequest,
encodeUrlInfo,
decodeUrlInfo,
DaesangUrlInfoResponse,
decodeUrlInfoDaesang
} from '../apis/url-info';
import { _MODULE_CONFIG } from '../config/token';
@ -35,7 +37,7 @@ import { Urls } from '../config/urls';
import { UrlConfig } from '@ucap-webmessenger/core';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class ExternalApiService {
readonly urls: Urls;
@ -58,7 +60,7 @@ export class ExternalApiService {
this.urls.checkUserInfoEx,
{},
{
params: encodeCheckUserInfoEx(req),
params: encodeCheckUserInfoEx(req)
}
)
.pipe(map(res => decodeCheckUserInfoEx(res)));
@ -70,7 +72,7 @@ export class ExternalApiService {
this.urls.companyList,
{},
{
params: encodeCompanyList(req),
params: encodeCompanyList(req)
}
)
.pipe(map(res => decodeCompanyList(res)));
@ -82,7 +84,7 @@ export class ExternalApiService {
this.urls.tokenUpdate,
{},
{
params: encodeTokenUpdate(req),
params: encodeTokenUpdate(req)
}
)
.pipe(map(res => decodeTokenUpdate(res)));
@ -94,9 +96,22 @@ export class ExternalApiService {
this.urls.urlInfo,
{},
{
params: encodeUrlInfo(req),
params: encodeUrlInfo(req)
}
)
.pipe(map(res => decodeUrlInfo(res)));
}
public urlInfoDaesang(
req: UrlInfoRequest
): Observable<DaesangUrlInfoResponse> {
return this.httpClient
.post<any>(
this.urls.urlInfo,
{},
{
params: encodeUrlInfo(req)
}
)
.pipe(map(res => decodeUrlInfoDaesang(res)));
}
}

View File

@ -32,9 +32,7 @@ import {
import { MatTabChangeEvent } from '@angular/material';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { MessageApiService, MessageType } from '@ucap-webmessenger/api-message';
import { DeviceType } from '@ucap-webmessenger/core';
import { UnreadCountRequest } from 'projects/ucap-webmessenger-api-message/src/lib/apis/unread-count';
@ -45,7 +43,12 @@ import {
MessageWriteDialogResult,
MessageWriteDialogData
} from '../dialogs/message/message-write.dialog.component';
import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types';
import {
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO,
KEY_VER_INFO,
KEY_LOGIN_RES_INFO
} from '@app/types';
import { MessageBoxComponent } from './left-sidenav/message.component';
export enum MainMenu {

View File

@ -25,7 +25,7 @@ import {
} from '@ucap-webmessenger/protocol-sync';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { KEY_VER_INFO } from '@app/types';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { MatMenuTrigger } from '@angular/material';
import { FormGroup, FormBuilder } from '@angular/forms';

View File

@ -26,9 +26,9 @@ import {
KEY_LOGIN_INFO,
UserSelectDialogType,
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO
KEY_ENVIRONMENTS_INFO,
KEY_VER_INFO
} from '@app/types';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { ExpansionPanelComponent as GroupExpansionPanelComponent } from '@ucap-webmessenger/ui-group';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';

View File

@ -18,7 +18,6 @@ import * as AppStore from '@app/store';
import { UserInfo } from '@ucap-webmessenger/protocol-room';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { DialogService } from '@ucap-webmessenger/ui';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
@ -48,7 +47,11 @@ import {
MessageDetailDialogResult,
MessageDetailDialogData
} from '../../dialogs/message/message-detail.dialog.component';
import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types';
import {
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO,
KEY_VER_INFO
} from '@app/types';
@Component({
selector: 'app-layout-chat-left-sidenav-message',

View File

@ -67,6 +67,7 @@
(checkUser)="onCheckUser($event)"
(openProfile)="onClickOpenProfile($event)"
(click)="onToggleUser(userInfo)"
(contextmenu)="onContextMenuOrgUser($event, userInfo)"
>
</ucap-profile-user-list-item>
</cdk-virtual-scroll-viewport>
@ -88,6 +89,7 @@
(checkUser)="onCheckUser($event)"
(openProfile)="onClickOpenProfile($event)"
(click)="onToggleUser(userInfo)"
(contextmenu)="onContextMenuOrgUser($event, userInfo)"
>
</ucap-profile-user-list-item>
</cdk-virtual-scroll-viewport>
@ -138,3 +140,34 @@
</ul>
</div>
</div>
<div
style="visibility: hidden; position: fixed"
[style.left]="orgUserContextMenuPosition.x"
[style.top]="orgUserContextMenuPosition.y"
#orgUserContextMenuTrigger="matMenuTrigger"
[matMenuTriggerFor]="orgUserContextMenu"
></div>
<mat-menu
#orgUserContextMenu="matMenu"
[hasBackdrop]="false"
(ucapClickOutside)="orgUserContextMenuTrigger.closeMenu()"
>
<ng-template matMenuContent let-userInfo="userInfo">
<button mat-menu-item (click)="onClickContextMenu('CALL_LINE', userInfo)">
내선번호 전화걸기
</button>
<button mat-menu-item (click)="onClickContextMenu('CALL_MOBILE', userInfo)">
모바일 전화걸기
</button>
<button
mat-menu-item
(click)="onClickContextMenu('SEND_MESSAGE', userInfo)"
>
쪽지 보내기
</button>
<button mat-menu-item (click)="onClickContextMenu('SEND_SMS', userInfo)">
SMS 보내기
</button>
</ng-template>
</mat-menu>

View File

@ -32,10 +32,15 @@ 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 } 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 { KEY_VER_INFO } from '@app/types/ver-info.type';
import {
SelectGroupDialogComponent,
SelectGroupDialogData,
@ -45,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',
@ -54,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()
@ -107,6 +122,7 @@ export class OrganizationComponent
loginInfo: LoginInfo;
loginRes: LoginResponse;
sessionVerinfo: VersionInfo2Response;
environmentsInfo: EnvironmentsInfo;
isShowSearch = false;
searchUserInfos: UserInfoSS[] = [];
@ -125,6 +141,9 @@ export class OrganizationComponent
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
KEY_VER_INFO
);
this.environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>(
KEY_ENVIRONMENTS_INFO
);
}
ngOnInit() {
@ -441,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;
}
}
}

View File

@ -61,7 +61,7 @@ import {
FileInfo,
FormComponent as UCapUiChatFormComponent
} from '@ucap-webmessenger/ui-chat';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { KEY_VER_INFO } from '@app/types';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import {
MatMenuTrigger,

View File

@ -15,9 +15,12 @@ import { CommonApiService } from '@ucap-webmessenger/api-common';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types';
import {
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO,
KEY_VER_INFO
} from '@app/types';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
import { NGXLogger } from 'ngx-logger';
import { SnackBarService } from '@ucap-webmessenger/ui';

View File

@ -17,7 +17,6 @@ import * as RoomStore from '@app/store/messenger/room';
import { UserInfo, RoomInfo } from '@ucap-webmessenger/protocol-room';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import {
DialogService,
ConfirmDialogComponent,
@ -35,9 +34,12 @@ import {
CreateChatDialogResult,
CreateChatDialogData
} from '../../dialogs/chat/create-chat.dialog.component';
import { UserSelectDialogType } from '@app/types';
import {
UserSelectDialogType,
KEY_LOGIN_RES_INFO,
KEY_VER_INFO
} from '@app/types';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { MatMenuTrigger, MatDialog } from '@angular/material';
@Component({

View File

@ -1,3 +1,4 @@
import { ChangePasswordDialogComponent } from './change-password.dialog.component';
import { NoticeDialogComponent } from './notice.dialog.component';
export const DIALOGS = [ChangePasswordDialogComponent];
export const DIALOGS = [ChangePasswordDialogComponent, NoticeDialogComponent];

View File

@ -0,0 +1,16 @@
<mat-card class="confirm-card mat-elevation-z">
<mat-card-header>
<mat-card-title>{{ data.title }}</mat-card-title>
<!-- <mat-card-subtitle>Confirm</mat-card-subtitle> -->
</mat-card-header>
<mat-card-content>
<div #messageContainer class="notice">
{{ data.message }}
</div>
</mat-card-content>
<mat-card-actions class="button-farm flex-row">
<button mat-stroked-button (click)="onClickConfirm()" class="mat-primary">
Confirm
</button>
</mat-card-actions>
</mat-card>

View File

@ -0,0 +1,22 @@
.mat-card{
padding:10px;
.mat-card-header{
margin-bottom:20px;
.mat-card-title{
margin:0 -16px;
padding-bottom:10px;
}
}
.button-farm {
text-align:right;
.mat-primary{
margin-left:4px;
}
}
}
form{
.mat-form-field{
width:100%;
}
}

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NoticeDialogComponent } from './notice.dialog.component';
describe('ui::AlertDialogComponent', () => {
let component: NoticeDialogComponent;
let fixture: ComponentFixture<NoticeDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [NoticeDialogComponent]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NoticeDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,44 @@
import {
Component,
OnInit,
Inject,
ViewChild,
ElementRef
} from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
export interface NoticeDialogData {
title: string;
message?: string;
html?: string;
}
// tslint:disable-next-line: no-empty-interface
export interface NoticeDialogResult {}
@Component({
selector: 'app-notice-dialog',
templateUrl: './notice.dialog.component.html',
styleUrls: ['./notice.dialog.component.scss']
})
export class NoticeDialogComponent implements OnInit {
@ViewChild('messageContainer', { static: true })
messageContainer: ElementRef;
tempAgeLimits = [];
constructor(
public dialogRef: MatDialogRef<NoticeDialogComponent, NoticeDialogResult>,
@Inject(MAT_DIALOG_DATA) public data: NoticeDialogData
) {}
ngOnInit(): void {
if (!!this.data.html) {
this.messageContainer.nativeElement.innerHTML = this.data.html;
}
}
onClickConfirm(): void {
this.dialogRef.close({});
}
}

View File

@ -25,8 +25,7 @@ import * as StatusStore from '@app/store/messenger/status';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { Company } from '@ucap-webmessenger/api-external';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { LoginInfo, KEY_LOGIN_INFO, KEY_VER_INFO } from '@app/types';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import {
UserInfo,

View File

@ -1,7 +1,6 @@
import { Component, OnInit, Inject, ViewChild, OnDestroy } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { KEY_LOGIN_RES_INFO, KEY_VER_INFO } from '@app/types';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { Store, select } from '@ngrx/store';

View File

@ -1,7 +1,6 @@
import { Component, OnInit, Inject, Renderer2 } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { KEY_LOGIN_RES_INFO, KEY_VER_INFO } from '@app/types';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { Store } from '@ngrx/store';

View File

@ -234,7 +234,7 @@
<div class="container">
<div class="img-item">
<ul>
<li *ngFor="let link of weblink">
<li *ngFor="let link of weblink" (click)="onClickWebLink(link)">
<div class="icon" [matTooltip]="link.title">
<span class="mdi mdi-star-circle-outline mdi-48px"></span>
</div>

View File

@ -16,7 +16,17 @@ import * as UpdateStore from '@app/store/setting/update';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { tap } from 'rxjs/operators';
import { RightDrawer } from '@app/types';
import {
RightDrawer,
KEY_URL_INFO,
LoginInfo,
KEY_LOGIN_INFO
} from '@app/types';
import {
WebLink,
DaesangUrlInfoResponse
} from '@ucap-webmessenger/api-external';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
@Component({
selector: 'app-layout-native-top-bar',
@ -33,123 +43,13 @@ export class TopBarComponent implements OnInit, OnDestroy {
updateInfo$: Observable<UpdateInfo>;
showWeblink = false;
weblink: {
title: string;
url: string;
order: number;
activeYn: boolean;
}[] = [
{
order: 0,
title: '웹하드',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=WHD_78&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: 'DSP',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=GWS_01&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: 'SMS',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=SMS_21&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: '화상회의',
activeYn: true,
url:
'http://dsview.daesang.com/plugin/sso_login.asp?userid=(%USER_FIELD4%)'
},
{
order: 0,
title: 'EP',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=EPS_07&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: 'S & OP회의',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=SOP_05&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: 'S & OM회의',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=SOM_09&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: '코끼리',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=http%3A%2F%2Fdsp%2Edaesang%2Ecom%3A80%2FDS%5F10%2Femate%5Fapp%2Felephant%2Fmaster%2Ensf%2Fmain%2Ehtml%3Freadform%26kind%3D3'
},
{
order: 0,
title: 'IT서비스데스크',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=HPD_13&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: '개인속보',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=DSB_43&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: '메일 count url',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=http://dsp.daesang.com/common/sysorg.nsf/unreadmailcount2?openagent%26empno=(%USER_FIELD4%)'
},
{
order: 0,
title: '메일 link url',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=%2Fportal%2Ensf%2Fmailredirect%3Fopenpage%26mode%3Dm'
},
{
order: 0,
title: '결제 count url',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=http://dsp.daesang.com/common/sysorg.nsf/unreadmailcount2?openagent%26empno=(%USER_FIELD4%)'
},
{
order: 0,
title: '결제 link url',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=%2Fportal%2Ensf%2Fmailredirect%3Fopenpage%26mode%3Dm'
},
{
order: 0,
title: '3개월 비밀번호 변경창 url',
activeYn: true,
url: 'sso.daesang.com / modify.do'
}
];
loginInfo: LoginInfo;
weblink: WebLink[] = [];
constructor(
private store: Store<any>,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private sessionStorageService: SessionStorageService
) {}
ngOnInit() {
@ -160,6 +60,13 @@ export class TopBarComponent implements OnInit, OnDestroy {
select(AppStore.AccountSelector.AuthenticationSelector.loginRes),
tap(loginRes => {
this.loginRes = loginRes;
this.loginInfo = this.sessionStorageService.get<LoginInfo>(
KEY_LOGIN_INFO
);
// WebLink init..
this.initWebLink();
})
)
.subscribe();
@ -169,6 +76,47 @@ export class TopBarComponent implements OnInit, OnDestroy {
);
}
initWebLink(): void {
const urlInfo: DaesangUrlInfoResponse = this.sessionStorageService.get<
DaesangUrlInfoResponse
>(KEY_URL_INFO);
if (!!urlInfo && !!urlInfo.webLink) {
this.weblink = urlInfo.webLink.filter(
weblink =>
urlInfo.webLinkAllowedList.filter(type => type === weblink.key)
.length > 0
);
if (
urlInfo.webLinkAllowedList.indexOf('WebLinkMail') > -1 &&
urlInfo.webLinkAllowedList.indexOf('WebLinkMailCnt') > -1
) {
// 메일 카운트 체크.
const link = urlInfo.webLink.filter(
weblink => weblink.key === 'WebLinkMailCnt'
);
if (link.length > 0) {
const WebLinkMailCnt = link[0];
// this.onClickWebLink(WebLinkMailCnt);
}
}
if (
urlInfo.webLinkAllowedList.indexOf('WebLinkPayment') > -1 &&
urlInfo.webLinkAllowedList.indexOf('WebLinkPaymentCnt') > -1
) {
// 결제 카운트 체크.
const link = urlInfo.webLink.filter(
weblink => weblink.key === 'WebLinkPaymentCnt'
);
if (link.length > 0) {
const WebLinkPaymentCnt = link[0];
// this.onClickWebLink(WebLinkPaymentCnt);
}
}
}
}
ngOnDestroy(): void {}
onClickClose() {
@ -202,6 +150,14 @@ export class TopBarComponent implements OnInit, OnDestroy {
onToggleWebLinkSelector(): void {
this.showWeblink = !this.showWeblink;
}
onClickWebLink(link: WebLink): void {
const loginPw = this.loginInfo.loginPw;
const token = this.loginRes.tokenString;
const url = link.url.replace('(%USER_TOKEN%)', token);
this.nativeService.openDefaultBrowser(url);
}
onClickUpdate() {
this.store.dispatch(UpdateStore.applyInstantUpdate());

View File

@ -2,9 +2,12 @@
<div class="login-wrapper" fxLayout="column" fxLayoutAlign="center center">
<ucap-account-login
[companyList]="companyList$ | async"
[curCompanyCode]="fixedCompany"
[notiText]="fixedNotiBtnText"
[loginBtnEnable]="loginBtnEnable"
[loginBtnText]="loginBtnText"
(login)="onLogin($event)"
(notiClick)="onClickNoti($event)"
>
</ucap-account-login>
</div>

View File

@ -17,6 +17,11 @@ import {
AlertDialogResult
} from '@ucap-webmessenger/ui';
import { StringUtil } from '@ucap-webmessenger/core';
import {
NoticeDialogComponent,
NoticeDialogResult,
NoticeDialogData
} from '@app/layouts/messenger/dialogs/account/notice.dialog.component';
@Component({
selector: 'app-page-account-login',
@ -24,6 +29,9 @@ import { StringUtil } from '@ucap-webmessenger/core';
styleUrls: ['./login.page.component.scss']
})
export class LoginPageComponent implements OnInit, OnDestroy {
fixedCompany: string;
fixedNotiBtnText: string;
companyList$: Observable<Company[]>;
loginFailureCount: Subscription;
@ -102,6 +110,14 @@ export class LoginPageComponent implements OnInit, OnDestroy {
})
)
.subscribe();
this.customInitilize();
}
customInitilize() {
// Daesang..
this.fixedCompany = 'GUC100';
this.fixedNotiBtnText = '이용 주의사항';
}
ngOnDestroy(): void {
@ -151,7 +167,30 @@ export class LoginPageComponent implements OnInit, OnDestroy {
);
}
onClickTemplate() {
this.router.navigate(['/template']);
onClickNoti() {
// For Daesang,,
this.dialogService.open<
NoticeDialogComponent,
NoticeDialogData,
NoticeDialogResult
>(NoticeDialogComponent, {
width: '500px',
data: {
title: '이용시 주의사항',
html: `
<p>1. / .</p>
<p>2. ( ) .</p>
<p>3. , , Clean Desk를 .</p>
<p>4. .</p>
<p>5. PC에 .</p>
<p>6. . .</p>
<p>7. ( ) .</p>
`
}
});
}
// onClickTemplate() {
// this.router.navigate(['/template']);
// }
}

View File

@ -4,7 +4,7 @@ import {
ActivatedRouteSnapshot,
RouterStateSnapshot
} from '@angular/router';
import { Observable, throwError, forkJoin } from 'rxjs';
import { Observable, throwError, forkJoin, of } from 'rxjs';
import {
map,
tap,
@ -27,7 +27,8 @@ import {
LoginInfo,
KEY_LOGIN_INFO,
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO
KEY_ENVIRONMENTS_INFO,
KEY_URL_INFO
} from '@app/types';
import { InnerProtocolService } from '@ucap-webmessenger/protocol-inner';
import {
@ -47,12 +48,18 @@ import * as VersionInfoStore from '@app/store/setting/version-info';
import * as OptionStore from '@app/store/messenger/option';
import * as QueryStore from '@app/store/messenger/query';
import * as SyncStore from '@app/store/messenger/sync';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { KEY_LOGIN_RES_INFO, KEY_VER_INFO } from '@app/types';
import { environment } from '../../environments/environment';
import { SnackBarService } from '@ucap-webmessenger/ui';
import { AppNativeService } from '@app/services/native.service';
import {
ExternalApiService,
UrlInfoResponse,
DaesangUrlInfoResponse
} from '@ucap-webmessenger/api-external';
import { DeviceType } from '@ucap-webmessenger/core';
import { StatusCode } from '@ucap-webmessenger/api';
@Injectable()
export class AppMessengerResolver implements Resolve<void> {
@ -60,6 +67,7 @@ export class AppMessengerResolver implements Resolve<void> {
private store: Store<any>,
private sessionStorageService: SessionStorageService,
private publicApiService: PublicApiService,
private externalApiService: ExternalApiService,
private protocolService: ProtocolService,
private queryProtocolService: QueryProtocolService,
private optionProtocolService: OptionProtocolService,
@ -103,6 +111,24 @@ export class AppMessengerResolver implements Resolve<void> {
switchMap(res => {
return this.protocolService.connect(res.serverIp);
}),
switchMap(() => {
return this.externalApiService
.urlInfoDaesang({
deviceType: environmentsInfo.deviceType,
loginId: loginInfo.loginId
})
.pipe(
map(response => {
if (response.statusCode === StatusCode.Success) {
this.sessionStorageService.set<
UrlInfoResponse | DaesangUrlInfoResponse
>(KEY_URL_INFO, response);
} else {
}
}),
catchError(error => of(this.logger.error({ error })))
);
}),
switchMap(() => this.innerProtocolService.conn({})),
switchMap(res => {
return this.authenticationProtocolService

View File

@ -5,9 +5,12 @@ import {
LocalStorageService
} from '@ucap-webmessenger/web-storage';
import { LocaleCode } from '@ucap-webmessenger/core';
import { LoginInfo, KEY_LOGIN_INFO } from '../types';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import {
LoginInfo,
KEY_LOGIN_INFO,
KEY_LOGIN_RES_INFO,
KEY_VER_INFO
} from '../types';
import { PasswordUtil } from '@ucap-webmessenger/pi';
import { DaesangCipherService } from '@ucap-webmessenger/daesang';

View File

@ -3,3 +3,6 @@ export * from './login-info.type';
export * from './userselect.dialog.type';
export * from './right-drawer.type';
export * from './sticker-info.type';
export * from './url-info.type';
export * from './ver-info.type';
export * from './login-res-info.type';

View File

@ -0,0 +1 @@
export const KEY_URL_INFO = 'ucap::URL_INFO';

View File

@ -2,7 +2,7 @@
<div class="mat-title">LOGIN TO YOUR ACCOUNT</div>
<form name="loginForm" [formGroup]="loginForm" novalidate>
<mat-form-field>
<mat-form-field [style.display]="!!curCompanyCode ? 'none' : 'block'">
<mat-label>Company</mat-label>
<mat-select formControlName="companyCode" required>
<mat-option
@ -69,5 +69,9 @@
<span class="text">Don't have an account?</span>
<a class="link">Create an account</a>
</div>
<div class="policy"><a class="link">개인정보 처리방침</a></div>
<div class="policy">
<a class="link" (click)="onClickNoti()">{{
!!notiText ? notiText : '개인정보 처리방침'
}}</a>
</div>
</div>

View File

@ -22,9 +22,13 @@ export class LoginComponent implements OnInit {
@Input()
companyList?: Company[];
@Input()
curCompanyCode?: string;
@Input()
loginBtnText?: string;
@Input()
loginBtnEnable: boolean;
@Input()
notiText?: string;
@Output()
login = new EventEmitter<{
@ -34,6 +38,8 @@ export class LoginComponent implements OnInit {
rememberMe: boolean;
notValid: () => void;
}>();
@Output()
notiClick = new EventEmitter();
@ViewChild('loginPw', { static: true }) loginPwElementRef: ElementRef;
@ -56,6 +62,10 @@ export class LoginComponent implements OnInit {
remember: [false]
});
if (!!this.curCompanyCode) {
this.loginForm.get('companyCode').setValue(this.curCompanyCode);
}
if (loginInfo && loginInfo.companyCode && loginInfo.loginId) {
this.loginForm.get('companyCode').setValue(loginInfo.companyCode);
this.loginForm.get('loginId').setValue(loginInfo.loginId);
@ -79,4 +89,8 @@ export class LoginComponent implements OnInit {
}
});
}
onClickNoti(): void {
this.notiClick.emit();
}
}

View File

@ -140,7 +140,7 @@
>
</ucap-chat-message-box-text>
<div *ngSwitchDefault>
mass-translation
<!-- mass-translation
<ucap-chat-message-box-mass-translation></ucap-chat-message-box-mass-translation>
notice
<ucap-chat-message-box-notice></ucap-chat-message-box-notice>
@ -152,7 +152,8 @@
<div class="message">
{{ message.sentMessage }}
</div>
</div> -->
{{ message.type }} / {{ message.sentMessage }}
</div>
</ng-container>
</div>