This commit is contained in:
병준 박 2019-12-24 18:14:19 +09:00
commit 0ac2717bbf
11 changed files with 347 additions and 101 deletions

View File

@ -10,6 +10,7 @@ import {
import path from 'path';
import fse from 'fs-extra';
import semver from 'semver';
import os from 'os';
import AutoLaunch from 'auto-launch';
@ -358,6 +359,27 @@ ipcMain.on(UpdaterChannel.Check, (event: IpcMainEvent, ...args: any[]) => {
}
});
ipcMain.on(
MessengerChannel.GetNetworkInfo,
(event: IpcMainEvent, ...args: any[]) => {
const interfaces = os.networkInterfaces();
const addresses: { ip: string; mac: string }[] = [];
// tslint:disable-next-line: forin
for (const k in interfaces) {
// tslint:disable-next-line: forin
for (const k2 in interfaces[k]) {
const address = interfaces[k][k2];
if (address.family === 'IPv4' && !address.internal) {
addresses.push({ ip: address.address, mac: address.mac });
}
}
}
event.returnValue = addresses;
}
);
ipcMain.on(
MessengerChannel.ChangeAutoLaunch,
(event: IpcMainEvent, ...args: any[]) => {

View File

@ -1,4 +1,4 @@
import { Injectable } from '@angular/core';
import { Injectable, Inject } from '@angular/core';
import {
Resolve,
ActivatedRouteSnapshot,
@ -60,12 +60,13 @@ import {
UrlInfoResponse,
DaesangUrlInfoResponse
} from '@ucap-webmessenger/api-external';
import { DeviceType } from '@ucap-webmessenger/core';
import { StatusCode } from '@ucap-webmessenger/api';
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
@Injectable()
export class AppMessengerResolver implements Resolve<void> {
constructor(
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private store: Store<any>,
private sessionStorageService: SessionStorageService,
private publicApiService: PublicApiService,
@ -84,7 +85,7 @@ export class AppMessengerResolver implements Resolve<void> {
activatedRouteSnapshot: ActivatedRouteSnapshot,
routerStateSnapshot: RouterStateSnapshot
): void | Observable<void> | Promise<void> {
return new Promise<void>((resolve, reject) => {
return new Promise<void>(async (resolve, reject) => {
let loginRes: LoginResponse;
const loginInfo = this.sessionStorageService.get<LoginInfo>(
@ -94,6 +95,24 @@ export class AppMessengerResolver implements Resolve<void> {
KEY_ENVIRONMENTS_INFO
);
let localIp = '';
let localMac = '';
// get network info
await this.nativeService
.getNetworkInfo()
.then(result => {
if (!!result && result.length > 0) {
if (!!result[0].ip) {
localIp = result[0].ip;
}
if (!!result[0].mac) {
localMac = result[0].mac;
}
}
})
.catch(reason => {});
this.publicApiService
.versionInfo2({
deviceType: environmentsInfo.deviceType,
@ -146,12 +165,12 @@ export class AppMessengerResolver implements Resolve<void> {
passwordEncodingType: 1,
clientVersion: '',
reconnect: false,
ip: 'localhost',
hostName: '',
ip: localIp,
hostName: localMac,
ssoMode: SSOMode.AUTH,
userSpecificInformation: 'PRO_000482',
productId: environment.productConfig.productId,
productName: environment.productConfig.productName
andId: '',
andPushRefreshYn: ''
})
.pipe(
catchError(err => {

View File

@ -72,6 +72,12 @@ export class BrowserNativeService extends NativeService {
});
}
getNetworkInfo(): Promise<any> {
return new Promise<any>((resolve, reject) => {
resolve(null);
});
}
changeAutoLaunch(autoLaunch: boolean): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
resolve(true);

View File

@ -78,6 +78,16 @@ export class ElectronNativeService implements NativeService {
return this.logout$;
}
getNetworkInfo(): Promise<any> {
return new Promise<string>((resolve, reject) => {
try {
resolve(this.ipcRenderer.sendSync(MessengerChannel.GetNetworkInfo));
} catch (error) {
reject(error);
}
});
}
changeStatus(): Observable<StatusCode> {
if (!this.changeStatusSubject) {
this.changeStatusSubject = new Subject<StatusCode>();

View File

@ -3,7 +3,8 @@ export enum MessengerChannel {
ChangeStatus = 'UCAP::messenger::changeStatus',
ShowSetting = 'UCAP::messenger::showSetting',
ChangeAutoLaunch = 'UCAP::messenger::changeAutoLaunch',
ChangeStartupHideWindow = 'UCAP::messenger::changeStartupHideWindow'
ChangeStartupHideWindow = 'UCAP::messenger::changeStartupHideWindow',
GetNetworkInfo = 'UCAP::messenger::getNetworkInfo'
}
export enum ChatChannel {

View File

@ -24,6 +24,8 @@ export abstract class NativeService {
abstract changeStatus(): Observable<StatusCode>;
abstract showSetting(): Observable<void>;
abstract getNetworkInfo(): Promise<any>;
abstract changeAutoLaunch(autoLaunch: boolean): Promise<boolean>;
abstract changeStartupHideWindow(
startupHideWindow: boolean

View File

@ -46,14 +46,10 @@ export interface LoginRequest extends ProtocolRequest {
ssoMode: SSOMode;
// 14. 사용자고유정보(s)
userSpecificInformation: string;
// 15. 제품 ID(s)
productId: string;
// 16. 제품명(s)
productName: string;
// 17. EncData(s)
encriptionData?: string;
// 18. AccessToken(s)
accessToken?: string;
// 15. 안드로이드 ID(s)
andId: string;
// 16. push_ID 갱신여부(s)
andPushRefreshYn: string;
}
export interface LoginResponse extends ProtocolResponse {
@ -135,25 +131,20 @@ export const encodeLogin: ProtocolEncoder<LoginRequest> = (
{ type: PacketBodyValue.String, value: req.deviceId },
{ type: PacketBodyValue.String, value: req.token },
{ type: PacketBodyValue.String, value: req.localeCode },
{ type: PacketBodyValue.String, value: req.pushId },
{ type: PacketBodyValue.String, value: req.pushId }, // 6
{ type: PacketBodyValue.String, value: req.companyCode },
{ type: PacketBodyValue.Integer, value: req.passwordEncodingType },
{ type: PacketBodyValue.String, value: req.clientVersion },
{ type: PacketBodyValue.String, value: req.reconnect ? 'Y' : 'N' },
{ type: PacketBodyValue.String, value: req.ip },
{ type: PacketBodyValue.String, value: req.hostName },
{ type: PacketBodyValue.Integer, value: req.encriptionData ? 2 : 1 },
{ type: PacketBodyValue.String, value: req.userSpecificInformation },
{ type: PacketBodyValue.String, value: req.productId },
{ type: PacketBodyValue.String, value: req.productName }
);
{ type: PacketBodyValue.String, value: '' }, // 13
if (req.encriptionData) {
bodyList.push(
{ type: PacketBodyValue.String, value: req.encriptionData },
{ type: PacketBodyValue.String, value: req.accessToken }
{ type: PacketBodyValue.String, value: req.userSpecificInformation },
{ type: PacketBodyValue.String, value: req.andId },
{ type: PacketBodyValue.String, value: req.andPushRefreshYn }
);
}
return bodyList;
};

View File

@ -1,7 +1,7 @@
<div class="bubble-main">
<span class="content" [innerHTML]="content | linefeedtohtml | linky"></span>
<span>
{{ moment(message.sendDate).toDate() | date: 'short' }}
{{ message.sendDate | ucapDate: 'YYYY.MM.DD a hh:mm' }}
</span>
</div>
<div *ngIf="detailButteonShow" class="btn-box">

View File

@ -2,59 +2,106 @@
<mat-card-header>
<div class="profile-img">
<div class="profile-img-mask">
<img ucapImage [base]="profileImageRoot" [path]="userInfo.profileImageFile"
[default]="'assets/images/img_nophoto_50.png'" />
<img
ucapImage
[base]="profileImageRoot"
[path]="userInfo.profileImageFile"
[default]="'assets/images/img_nophoto_50.png'"
/>
</div>
<button mat-mini-fab class="mat-elevation-z6 btn-upload-profile-image" *ngIf="isMe && editableProfileImage"
matTooltip="프로필 이미지 변경" matTooltipPosition="above" [disabled]="
<button
mat-mini-fab
class="mat-elevation-z6 btn-upload-profile-image"
*ngIf="isMe && editableProfileImage"
matTooltip="프로필 이미지 변경"
matTooltipPosition="above"
[disabled]="
profileImageFileUploadItem &&
profileImageFileUploadItem.uploadingProgress$
" (click)="profileImageFileInput.click()">
"
(click)="profileImageFileInput.click()"
>
<span class="mdi mdi-upload mdi-18px"></span>
</button>
<span class="work-status text-accent-darkest">
{{ getWorkstatus(userInfo) }} 휴가중
<span
*ngIf="getWorkstatus(userInfo).length > 0"
class="work-status text-accent-darkest"
>
{{ getWorkstatus(userInfo) }}
</span>
<mat-spinner *ngIf="
<mat-spinner
*ngIf="
profileImageFileUploadItem &&
profileImageFileUploadItem.uploadingProgress$
" mode="determinate" strokeWidth="5" diameter="84"
[value]="profileImageFileUploadItem.uploadingProgress$ | async" class="upload-profile-image-spinner">
"
mode="determinate"
strokeWidth="5"
diameter="84"
[value]="profileImageFileUploadItem.uploadingProgress$ | async"
class="upload-profile-image-spinner"
>
</mat-spinner>
<input type="file" #profileImageFileInput style="display: none" (change)="onChangeFileInput()" />
<input
type="file"
#profileImageFileInput
style="display: none"
(change)="onChangeFileInput()"
/>
</div>
<mat-card-title>
<span class="name">{{ userInfo | ucapTranslate: 'name' }}</span>
<span class="number">(A123456)</span>
<span class="number">{{ userInfo.employeeNum }}</span>
</mat-card-title>
<mat-card-subtitle>
<span class="deptName">{{ userInfo | ucapTranslate: 'deptName' }}</span>
<span class="grade">{{ userInfo | ucapTranslate: 'grade' }}</span>
</mat-card-subtitle>
<div class="intro">{{ userInfo.intro }}가나다라라라마마마바사아자차카타파하가나다라마사아자차카타파하가나다라마사아자차카타파하가나다라마사아자차카타파하가나다라마사아자차카타파하</div>
<div class="intro">{{ userInfo.intro }}</div>
<div *ngIf="!isMe" class="profile-option">
<span *ngIf="isBuddy" class="btn-favorite" (click)="onToggleFavorit()">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="butt" stroke-linejoin="round"
[ngClass]="[isFavorit ? 'on' : '']">
<span *ngIf="isBuddy" class="btn-favorite">
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="butt"
stroke-linejoin="round"
[ngClass]="[isFavorit ? 'on' : '']"
(click)="onToggleFavorit()"
matTooltip="즐겨찾기"
>
<polygon
points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2">
</polygon>
points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"
></polygon>
</svg>
</span>
<span class="btn-groupadd">
<ng-container [ngSwitch]="isBuddy">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="butt" stroke-linejoin="round" class="on"
*ngSwitchCase="false" (click)="onClickAddBuddy()">
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="butt"
stroke-linejoin="round"
class="on"
*ngSwitchCase="false"
(click)="onClickAddBuddy()"
matTooltip="동료추가"
>
<!-- not buddy -->
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
@ -62,9 +109,21 @@
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="1.5" stroke-linecap="butt" stroke-linejoin="round" class="on"
*ngSwitchCase="true" (click)="onClickDelBuddy()">
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="butt"
stroke-linejoin="round"
class="on"
*ngSwitchCase="true"
(click)="onClickDelBuddy()"
matTooltip="동료삭제"
>
<!-- is buddy -->
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="8.5" cy="7" r="4"></circle>
@ -73,10 +132,13 @@
</ng-container>
</span>
</div>
<div *ngIf="isMe" class="profile-edit">
<!-- <div *ngIf="isMe" class="profile-edit">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M12.3 3.7l4 4L4 20H0v-4L12.3 3.7zm1.4-1.4L16 0l4 4-2.3 2.3-4-4z" /></svg>
</div>
<path
d="M12.3 3.7l4 4L4 20H0v-4L12.3 3.7zm1.4-1.4L16 0l4 4-2.3 2.3-4-4z"
/>
</svg>
</div> -->
</mat-card-header>
<mat-card-content>
@ -97,11 +159,11 @@
-->
<li class="company">
<dt class="division">회사</dt>
<dd>회사명</dd>
<dd>{{ userInfo.workplace | ucapStringEmptycheck }}</dd>
</li>
<li>
<dt class="division">담당업무</dt>
<dd>담당업무 정보</dd>
<dd>{{ userInfo.responsibilities | ucapStringEmptycheck }}</dd>
</li>
<li>
<dt>근무지</dt>
@ -117,34 +179,74 @@
</li>
<li>
<dt class="division">이메일</dt>
<dd>{{ userInfo.email }}</dd>
<dd>{{ userInfo.email | ucapStringEmptycheck }}</dd>
</li>
<li>
<dt class="division">사무실</dt>
<dd>{{ userInfo.lineNumber }}1234567890123456789012345678901234567890</dd>
<button mat-mini-fab class="mat-elevation-z userInfo-call" *ngIf="!isMe" matTooltip="전화"
matTooltipPosition="above" [disabled]="getDisabledBtn('LINE')" (click)="onClickCall('LINE')">
<svg id="레이어_1" data-name="레이어 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M18.61,16.55c-0.42,1.03-2.29,1.97-3.12,2.01c-0.83,0.04-0.85,0.64-5.37-1.32c-4.51-1.96-7.23-6.73-7.45-7.04
<dd>
{{
userInfo.lineNumber
| ucapStringFormatterPhone
| ucapStringEmptycheck
}}
</dd>
<button
mat-mini-fab
class="mat-elevation-z userInfo-call"
*ngIf="!isMe"
matTooltip="전화"
matTooltipPosition="above"
[disabled]="getDisabledBtn('LINE')"
(click)="onClickCall('LINE')"
>
<svg
id="레이어_1"
data-name="레이어 1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M18.61,16.55c-0.42,1.03-2.29,1.97-3.12,2.01c-0.83,0.04-0.85,0.64-5.37-1.32c-4.51-1.96-7.23-6.73-7.45-7.04
C2.46,9.9,0.92,7.71,1,5.51c0.08-2.2,1.29-3.24,1.72-3.67c0.43-0.43,0.92-0.51,1.22-0.51c0.36-0.01,0.59-0.01,0.85,0
c0.26,0.01,0.66-0.06,1,0.85c0.34,0.91,1.16,3.14,1.26,3.37c0.1,0.23,0.17,0.49,0.01,0.78C6.91,6.63,6.82,6.81,6.59,7.06
c-0.24,0.25-0.5,0.57-0.71,0.76C5.65,8.04,5.4,8.27,5.65,8.73c0.25,0.46,1.1,1.96,2.39,3.19c1.66,1.59,3.1,2.11,3.54,2.35
c0.44,0.24,0.71,0.21,0.98-0.07c0.27-0.29,1.18-1.26,1.49-1.7c0.32-0.44,0.62-0.35,1.02-0.19c0.41,0.16,2.58,1.33,3.03,1.57
c0.44,0.24,0.74,0.36,0.84,0.55C19.05,14.62,19.02,15.52,18.61,16.55L18.61,16.55z" />
c0.44,0.24,0.74,0.36,0.84,0.55C19.05,14.62,19.02,15.52,18.61,16.55L18.61,16.55z"
/>
</svg>
</button>
</li>
<li>
<dt class="division">핸드폰</dt>
<dd>{{ userInfo.hpNumber }}</dd>
<button mat-mini-fab class="mat-elevation-z userInfo-call" *ngIf="!isMe" matTooltip="모바일"
matTooltipPosition="above" [disabled]="getDisabledBtn('MOBILE')" (click)="onClickCall('MOBILE')">
<svg id="레이어_1" data-name="레이어 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M18.61,16.55c-0.42,1.03-2.29,1.97-3.12,2.01c-0.83,0.04-0.85,0.64-5.37-1.32c-4.51-1.96-7.23-6.73-7.45-7.04
<dd>
{{
userInfo.hpNumber | ucapStringFormatterPhone | ucapStringEmptycheck
}}
</dd>
<button
mat-mini-fab
class="mat-elevation-z userInfo-call"
*ngIf="!isMe"
matTooltip="모바일"
matTooltipPosition="above"
[disabled]="getDisabledBtn('MOBILE')"
(click)="onClickCall('MOBILE')"
>
<svg
id="레이어_1"
data-name="레이어 1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M18.61,16.55c-0.42,1.03-2.29,1.97-3.12,2.01c-0.83,0.04-0.85,0.64-5.37-1.32c-4.51-1.96-7.23-6.73-7.45-7.04
C2.46,9.9,0.92,7.71,1,5.51c0.08-2.2,1.29-3.24,1.72-3.67c0.43-0.43,0.92-0.51,1.22-0.51c0.36-0.01,0.59-0.01,0.85,0
c0.26,0.01,0.66-0.06,1,0.85c0.34,0.91,1.16,3.14,1.26,3.37c0.1,0.23,0.17,0.49,0.01,0.78C6.91,6.63,6.82,6.81,6.59,7.06
c-0.24,0.25-0.5,0.57-0.71,0.76C5.65,8.04,5.4,8.27,5.65,8.73c0.25,0.46,1.1,1.96,2.39,3.19c1.66,1.59,3.1,2.11,3.54,2.35
c0.44,0.24,0.71,0.21,0.98-0.07c0.27-0.29,1.18-1.26,1.49-1.7c0.32-0.44,0.62-0.35,1.02-0.19c0.41,0.16,2.58,1.33,3.03,1.57
c0.44,0.24,0.74,0.36,0.84,0.55C19.05,14.62,19.02,15.52,18.61,16.55L18.61,16.55z" />
c0.44,0.24,0.74,0.36,0.84,0.55C19.05,14.62,19.02,15.52,18.61,16.55L18.61,16.55z"
/>
</svg>
</button>
</li>
@ -153,23 +255,44 @@
<mat-card-actions>
<div fxFlex fxLayout="row" fxLayoutAlign="space-around center">
<div class="button-text-item">
<button mat-mini-fab class="mat-elevation-z bg-accent-darkest" [matTooltip]="isMe ? 'MyTalk' : '1:1 대화'"
matTooltipPosition="above" (click)="onClickOpenChat()">
<svg id="레이어_1" data-name="레이어 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<button
mat-mini-fab
class="mat-elevation-z bg-accent-darkest"
[matTooltip]="isMe ? 'MyTalk' : '1:1 대화'"
matTooltipPosition="above"
(click)="onClickOpenChat()"
>
<svg
id="레이어_1"
data-name="레이어 1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M26.57,14a9.05,9.05,0,0,0-12.82,0,9.07,9.07,0,0,0-.57,12.2,3.57,3.57,0,0,1-1.46,1.61.84.84,0,0,0-.46.89.86.86,0,0,0,.71.71,4.34,4.34,0,0,0,.71.05,5.32,5.32,0,0,0,3.19-1.06A9.07,9.07,0,0,0,26.57,14Z"
transform="translate(-11.09 -11.32)" />
transform="translate(-11.09 -11.32)"
/>
<path
d="M20.16,20.53a.14.14,0,0,1-.14-.14.14.14,0,0,1,.14-.14.14.14,0,0,1,.13.14A.13.13,0,0,1,20.16,20.53Z"
transform="translate(-11.09 -11.32)" />
<path class="cls-1" d="M20.16,19.75a.64.64,0,1,0,.64.64.64.64,0,0,0-.64-.64Z"
transform="translate(-11.09 -11.32)" />
transform="translate(-11.09 -11.32)"
/>
<path
class="cls-1"
d="M20.16,19.75a.64.64,0,1,0,.64.64.64.64,0,0,0-.64-.64Z"
transform="translate(-11.09 -11.32)"
/>
<circle cx="12.35" cy="9.07" r="0.14" />
<path class="cls-1" d="M23.44,19.75a.64.64,0,1,0,.64.64.64.64,0,0,0-.64-.64Z"
transform="translate(-11.09 -11.32)" />
<path
class="cls-1"
d="M23.44,19.75a.64.64,0,1,0,.64.64.64.64,0,0,0-.64-.64Z"
transform="translate(-11.09 -11.32)"
/>
<circle cx="5.78" cy="9.07" r="0.14" />
<path class="cls-1" d="M16.88,19.75a.64.64,0,1,0,.63.64.64.64,0,0,0-.63-.64Z"
transform="translate(-11.09 -11.32)" />
<path
class="cls-1"
d="M16.88,19.75a.64.64,0,1,0,.63.64.64.64,0,0,0-.63-.64Z"
transform="translate(-11.09 -11.32)"
/>
</svg>
</button>
<span *ngIf="!isMe" class="button-text">대화</span>
@ -177,32 +300,54 @@
</div>
<div class="button-text-item" *ngIf="!isMe">
<button mat-mini-fab class="mat-elevation-z" *ngIf="!isMe" matTooltip="SMS" matTooltipPosition="above"
[disabled]="getDisabledBtn('SMS')" (click)="onClickSMS()">
<button
mat-mini-fab
class="mat-elevation-z"
*ngIf="!isMe"
matTooltip="SMS"
matTooltipPosition="above"
[disabled]="getDisabledBtn('SMS')"
(click)="onClickSMS()"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path
d="M2 2c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm2 0v14h12V2H4zm6 17a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
d="M2 2c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm2 0v14h12V2H4zm6 17a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"
/>
</svg>
</button>
<span class="button-text">SMS</span>
</div>
<div class="button-text-item" *ngIf="!isMe">
<button mat-mini-fab class="mat-elevation-z bg-accent-darkest" *ngIf="!isMe" matTooltip="화상회의"
matTooltipPosition="above" (click)="onClickVideoConference()">
<button
mat-mini-fab
class="mat-elevation-z bg-accent-darkest"
*ngIf="!isMe"
matTooltip="화상회의"
matTooltipPosition="above"
(click)="onClickVideoConference()"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path
d="M16 7l4-4v14l-4-4v3a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v3zm-8 7a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-2a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" />
d="M16 7l4-4v14l-4-4v3a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v3zm-8 7a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-2a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"
/>
</svg>
</button>
<span class="button-text">화상</span>
</div>
<div class="button-text-item" *ngIf="!isMe">
<button mat-mini-fab class="mat-elevation-z bg-accent-darkest" *ngIf="!isMe" matTooltip="쪽지"
matTooltipPosition="above" (click)="onClickMessage()">
<button
mat-mini-fab
class="mat-elevation-z bg-accent-darkest"
*ngIf="!isMe"
matTooltip="쪽지"
matTooltipPosition="above"
(click)="onClickMessage()"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M0 0l20 10L0 20V0zm0 8v4l10-2L0 8z" /></svg>
<path d="M0 0l20 10L0 20V0zm0 8v4l10-2L0 8z" />
</svg>
</button>
<span class="button-text">쪽지</span>
</div>

View File

@ -0,0 +1,44 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'ucapStringEmptycheck' })
export class StringEmptyCheckPipe implements PipeTransform {
transform(value: string): string {
return value.trim().length > 0 ? value.trim() : '-';
}
}
@Pipe({ name: 'ucapStringFormatterPhone' })
export class StringFormatterPhonePipe implements PipeTransform {
transform(value: string, hidden?: boolean): string {
const num = value.trim().replace(/[-, ]/g, '');
let formatNum = '';
if (num.length === 0) {
return num;
}
if (num.length === 11) {
if (!!hidden && hidden) {
formatNum = num.replace(/(\d{3})(\d{4})(\d{4})/, '$1-****-$3');
} else {
formatNum = num.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3');
}
} else if (num.length === 8) {
formatNum = num.replace(/(\d{4})(\d{4})/, '$1-$2');
} else {
if (num.indexOf('02') === 0) {
if (!!hidden && hidden) {
formatNum = num.replace(/(\d{2})(\d{4})(\d{4})/, '$1-****-$3');
} else {
formatNum = num.replace(/(\d{2})(\d{4})(\d{4})/, '$1-$2-$3');
}
} else {
if (!!hidden && hidden) {
formatNum = num.replace(/(\d{3})(\d{3})(\d{4})/, '$1-***-$3');
} else {
formatNum = num.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3');
}
}
}
return formatNum;
}
}

View File

@ -67,6 +67,10 @@ import { TranslatePipe } from './pipes/translate.pipe';
import { DatePipe } from './pipes/date.pipe';
import { MatTabsModule } from '@angular/material';
import {
StringEmptyCheckPipe,
StringFormatterPhonePipe
} from './pipes/string.pipe';
const COMPONENTS = [
FileUploadQueueComponent,
@ -102,7 +106,9 @@ const PIPES = [
SecondsToMinutesPipe,
LinkyPipe,
TranslatePipe,
DatePipe
DatePipe,
StringEmptyCheckPipe,
StringFormatterPhonePipe
];
const SERVICES = [
BottomSheetService,