From 0830b017dfbc95636b935bf1f62f90651b02b6e2 Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 6 Jan 2020 09:26:32 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=85=EB=AC=B4=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20::=20=EB=8F=99=EB=A3=8C=EA=B7=B8=EB=A3=B9.=20?= =?UTF-8?q?=EC=A1=B0=EC=A7=81=EB=8F=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/template.page.component.ts | 4 +- .../src/lib/models/common-user-info.ts | 6 +++ .../ucap-webmessenger-core/src/public-api.ts | 2 + .../src/lib/protocols/data-user.ts | 2 +- .../src/lib/models/user-info-dn.ts | 3 +- .../src/lib/models/user-info-f.ts | 3 +- .../src/lib/models/user-info-ss.ts | 6 +-- .../src/lib/protocols/dept-user.ts | 2 +- .../src/public-api.ts | 1 + .../userInfo.ts => models/user-Info.ts} | 3 +- .../src/public-api.ts | 2 +- .../src/lib/components/profile.component.ts | 2 +- .../components/user-list-item.component.html | 8 +++- .../components/user-list-item.component.ts | 46 ++++++++++++++++++- 14 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 projects/ucap-webmessenger-core/src/lib/models/common-user-info.ts rename projects/ucap-webmessenger-protocol-sync/src/lib/{types/userInfo.ts => models/user-Info.ts} (92%) diff --git a/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.ts index f07a9226..39a8baec 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.ts @@ -9,7 +9,8 @@ import { RoleCode } from '@ucap-webmessenger/protocol-authentication'; import { StatusBulkInfo, TerminalStatusInfo, - TerminalStatusNumber + TerminalStatusNumber, + WorkStatusType } from '@ucap-webmessenger/protocol-status'; import { Router } from '@angular/router'; import { Company } from '@ucap-webmessenger/api-external'; @@ -17,7 +18,6 @@ import { EventType, Info, EventJson } from '@ucap-webmessenger/protocol-event'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { StatusCode as ApiStatusCode } from '@ucap-webmessenger/api'; import { StatusCode } from '@ucap-webmessenger/core'; -import { WorkStatusType } from 'projects/ucap-webmessenger-protocol-status/src/lib/types/work-status.type'; @Component({ selector: 'app-template.page', diff --git a/projects/ucap-webmessenger-core/src/lib/models/common-user-info.ts b/projects/ucap-webmessenger-core/src/lib/models/common-user-info.ts new file mode 100644 index 00000000..9a44af5a --- /dev/null +++ b/projects/ucap-webmessenger-core/src/lib/models/common-user-info.ts @@ -0,0 +1,6 @@ +import { WorkStatusType } from '@ucap-webmessenger/protocol-status'; + +export interface CommonUserInfo { + /** 업무 상태 */ + workstatus?: WorkStatusType; +} diff --git a/projects/ucap-webmessenger-core/src/public-api.ts b/projects/ucap-webmessenger-core/src/public-api.ts index 002389f9..1ae5d654 100644 --- a/projects/ucap-webmessenger-core/src/public-api.ts +++ b/projects/ucap-webmessenger-core/src/public-api.ts @@ -2,6 +2,8 @@ * Public API Surface of ucap-webmessenger-core */ +export * from './lib/models/common-user-info'; + export * from './lib/types/app-type.type'; export * from './lib/types/call-alarm.type'; export * from './lib/types/call-forward.type'; diff --git a/projects/ucap-webmessenger-daesang/src/lib/protocols/data-user.ts b/projects/ucap-webmessenger-daesang/src/lib/protocols/data-user.ts index dfd487b3..50f02885 100644 --- a/projects/ucap-webmessenger-daesang/src/lib/protocols/data-user.ts +++ b/projects/ucap-webmessenger-daesang/src/lib/protocols/data-user.ts @@ -11,7 +11,7 @@ import { UserInfoSS, DataUserResponse } from '@ucap-webmessenger/protocol-query'; -import { WorkStatusType } from 'projects/ucap-webmessenger-protocol-status/src/lib/types/work-status.type'; +import { WorkStatusType } from '@ucap-webmessenger/protocol-status'; // export interface UserInfoSSForDaesang extends UserInfoSS { // /****** For daesang ******/ diff --git a/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-dn.ts b/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-dn.ts index 2375e75b..7df90ca5 100644 --- a/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-dn.ts +++ b/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-dn.ts @@ -1,6 +1,7 @@ import { RoleCode } from '@ucap-webmessenger/protocol-authentication'; +import { CommonUserInfo } from '@ucap-webmessenger/core'; -export interface UserInfoDN { +export interface UserInfoDN extends CommonUserInfo { /** 사용자SEQ */ seq: number; /** 사용자명 */ diff --git a/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-f.ts b/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-f.ts index cc09a238..52882f54 100644 --- a/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-f.ts +++ b/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-f.ts @@ -1,7 +1,8 @@ import { EmployeeType } from '@ucap-webmessenger/protocol-room'; import { RoleCode } from '@ucap-webmessenger/protocol-authentication'; +import { CommonUserInfo } from '@ucap-webmessenger/core'; -export interface UserInfoF { +export interface UserInfoF extends CommonUserInfo { /** 사용자SEQ */ seq: number; /** 사용자명 */ diff --git a/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-ss.ts b/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-ss.ts index 0554c9c9..c74c0201 100644 --- a/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-ss.ts +++ b/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-ss.ts @@ -1,9 +1,9 @@ import { RoleCode } from '@ucap-webmessenger/protocol-authentication'; -import { CallMode } from '@ucap-webmessenger/core'; +import { CallMode, CommonUserInfo } from '@ucap-webmessenger/core'; import { EmployeeType } from '@ucap-webmessenger/protocol-room'; -import { WorkStatusType } from 'projects/ucap-webmessenger-protocol-status/src/lib/types/work-status.type'; +import { WorkStatusType } from '@ucap-webmessenger/protocol-status'; -export interface UserInfoSS { +export interface UserInfoSS extends CommonUserInfo { /** 사용자SEQ */ seq: number; /** 사용자명 */ diff --git a/projects/ucap-webmessenger-protocol-query/src/lib/protocols/dept-user.ts b/projects/ucap-webmessenger-protocol-query/src/lib/protocols/dept-user.ts index 9ff08006..f2a2a3ae 100644 --- a/projects/ucap-webmessenger-protocol-query/src/lib/protocols/dept-user.ts +++ b/projects/ucap-webmessenger-protocol-query/src/lib/protocols/dept-user.ts @@ -15,7 +15,7 @@ import { RoleCode } from '@ucap-webmessenger/protocol-authentication'; import { DeptSearchType } from '../types/dept-search.type'; import { CallMode } from '@ucap-webmessenger/core'; import { UserInfoSS } from '../models/user-info-ss'; -import { WorkStatusType } from 'projects/ucap-webmessenger-protocol-status/src/lib/types/work-status.type'; +import { WorkStatusType } from '@ucap-webmessenger/protocol-status'; export interface DeptUserRequest extends ProtocolRequest { /** DivCD(s) */ diff --git a/projects/ucap-webmessenger-protocol-status/src/public-api.ts b/projects/ucap-webmessenger-protocol-status/src/public-api.ts index 23f2868c..2be2d6eb 100644 --- a/projects/ucap-webmessenger-protocol-status/src/public-api.ts +++ b/projects/ucap-webmessenger-protocol-status/src/public-api.ts @@ -16,5 +16,6 @@ export * from './lib/services/status-protocol.service'; export * from './lib/types/message-index.type'; export * from './lib/types/service'; export * from './lib/types/terminal-status.type'; +export * from './lib/types/work-status.type'; export * from './lib/ucap-status-protocol.module'; diff --git a/projects/ucap-webmessenger-protocol-sync/src/lib/types/userInfo.ts b/projects/ucap-webmessenger-protocol-sync/src/lib/models/user-Info.ts similarity index 92% rename from projects/ucap-webmessenger-protocol-sync/src/lib/types/userInfo.ts rename to projects/ucap-webmessenger-protocol-sync/src/lib/models/user-Info.ts index 7b046613..05413d33 100644 --- a/projects/ucap-webmessenger-protocol-sync/src/lib/types/userInfo.ts +++ b/projects/ucap-webmessenger-protocol-sync/src/lib/models/user-Info.ts @@ -1,7 +1,8 @@ import { RoleCode } from '@ucap-webmessenger/protocol-authentication'; import { EmployeeType } from '@ucap-webmessenger/protocol-room'; +import { CommonUserInfo } from '@ucap-webmessenger/core'; -export interface UserInfo { +export interface UserInfo extends CommonUserInfo { /** 사용자SEQ */ seq: number; /** 사용자명 */ diff --git a/projects/ucap-webmessenger-protocol-sync/src/public-api.ts b/projects/ucap-webmessenger-protocol-sync/src/public-api.ts index 7ec5d221..8eb3069a 100644 --- a/projects/ucap-webmessenger-protocol-sync/src/public-api.ts +++ b/projects/ucap-webmessenger-protocol-sync/src/public-api.ts @@ -4,6 +4,7 @@ export * from './lib/models/buddy-info'; export * from './lib/models/group-info'; +export * from './lib/models/user-Info'; export * from './lib/protocols/buddy'; export * from './lib/protocols/group'; @@ -14,4 +15,3 @@ export * from './lib/services/sync-protocol.service'; export * from './lib/ucap-sync-protocol.module'; export * from './lib/types/service'; -export * from './lib/types/userInfo'; 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 5364b38e..e0883e6d 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 @@ -16,7 +16,7 @@ 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'; -import { WorkStatusType } from 'projects/ucap-webmessenger-protocol-status/src/lib/types/work-status.type'; +import { WorkStatusType } from '@ucap-webmessenger/protocol-status'; @Component({ selector: 'ucap-profile-profile', diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html index 3dc26399..34e02756 100644 --- a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html +++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html @@ -23,9 +23,13 @@
-
- 오후 + {{ getWorkstatusInfo('text') }} {{ userInfo | ucapTranslate: 'name' }} {{ userInfo | ucapTranslate: 'grade' }} diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.ts b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.ts index ec35776b..8daf0f1b 100644 --- a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.ts +++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.ts @@ -12,7 +12,11 @@ import { UserInfoF, UserInfoDN } from '@ucap-webmessenger/protocol-query'; -import { StatusBulkInfo, StatusInfo } from '@ucap-webmessenger/protocol-status'; +import { + StatusBulkInfo, + StatusInfo, + WorkStatusType +} from '@ucap-webmessenger/protocol-status'; import { NGXLogger } from 'ngx-logger'; import { StatusCode } from '@ucap-webmessenger/core'; @@ -112,4 +116,44 @@ export class UserListItemComponent implements OnInit { this.openProfile.emit(userSeq); } + + getWorkstatusInfo(type: string): string { + let workstatus = this.userInfo.workstatus; + + if ( + !!this.presence && + !!this.presence.workstatus && + this.presence.workstatus.trim().length > 0 + ) { + workstatus = this.presence.workstatus; + } + + let text = ''; + // morning-off: 오전 afternoon-off: 오후 day-off: 휴가 long-time: 장기 leave-of-absence: 휴직 + let style = ''; + switch (workstatus) { + case WorkStatusType.VacationAM: + style = 'morning-off'; + text = '오전'; + break; + case WorkStatusType.VacationPM: + style = 'afternoon-off'; + text = '오후'; + break; + case WorkStatusType.VacationAll: + style = 'day-off'; + text = '휴가'; + break; + case WorkStatusType.LeaveOfAbsence: + style = 'leave-of-absence'; + text = '휴직'; + break; + case WorkStatusType.LongtermRefresh: + style = 'long-time'; + text = '장기'; + break; + } + + return type === 'text' ? text : style; + } }