From 9c21041c427bb136ce593f0fd79ffd8f0cd78d5a Mon Sep 17 00:00:00 2001 From: leejh Date: Thu, 10 Oct 2019 18:35:23 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20>=20=EC=A6=90=EA=B2=A8?= =?UTF-8?q?=EC=B0=BE=EA=B8=B0=20=EC=98=81=EC=97=AD=20=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/left-sidenav/group.component.html | 7 ++----- .../components/left-sidenav/group.component.ts | 11 +++++++++++ .../src/lib/components/expansion-panel.component.html | 6 +++++- .../src/lib/components/expansion-panel.component.ts | 3 +++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html index 70372913..9c1da020 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html @@ -36,11 +36,8 @@
- +
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 7df6d991..848aba09 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 @@ -37,6 +37,7 @@ export class GroupComponent implements OnInit { groupBuddyList$: Observable< { group: GroupDetailData; buddyList: UserInfo[] }[] >; + favoritBuddyList$: Observable; companyList$: Observable; companyCode: string; @@ -110,6 +111,16 @@ export class GroupComponent implements OnInit { return groupBuddyList; }) ); + + this.favoritBuddyList$ = this.store + .pipe(select(AppStore.MessengerSelector.SyncSelector.buddyInfoList)) + .pipe( + map(buddyInfoList => { + return buddyInfoList + .filter(buddy => buddy.isFavorit) + .sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0)); + }) + ); } async onClickGroupMenu(menuType: string) { diff --git a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html index 8c186d51..f2608e58 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html +++ b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.html @@ -1,9 +1,13 @@ - + 즐겨찾기 + + + diff --git a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts index d1914eac..fa5823dc 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts +++ b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts @@ -22,6 +22,9 @@ export class ExpansionPanelComponent implements OnInit { @Input() groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[] }[]; + @Input() + favoritBuddyList: UserInfo[]; + @Output() selectBuddy = new EventEmitter(); From a8375e977b514e9b3720f8dda6c852ef19f5279c Mon Sep 17 00:00:00 2001 From: leejh Date: Thu, 10 Oct 2019 18:38:36 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EC=A1=B0=EC=A7=81=EB=8F=84=20>=20=EB=B6=80?= =?UTF-8?q?=EC=84=9C=EC=9B=90=20ucap-profile-user-item-list=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=A0=81=EC=9A=A9.=20=EB=A7=A8?= =?UTF-8?q?=20=EC=B2=98=EC=9D=8C=20=EB=82=B4=20=EB=B6=80=EC=84=9C=EC=9B=90?= =?UTF-8?q?=20=EC=84=A0=ED=83=9D=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../left-sidenav/organization.component.html | 18 +++++++---- .../left-sidenav/organization.component.ts | 32 +++++++++++++++---- .../messenger/messenger.layout.module.ts | 3 +- .../src/lib/models/dept-info.ts | 22 ++++++------- 4 files changed, 51 insertions(+), 24 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html index 0d4974f8..4683d146 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html @@ -1,13 +1,19 @@
- +
-
- {{ userInfo.name }} +
+ (선택된부서명) +
+
+ + +
+
+ (하단버튼영역)
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 6d4da9ec..5a7be66b 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 @@ -28,6 +28,8 @@ export class OrganizationComponent implements OnInit { selectedDepartmentUserInfoList$: Observable; selectedDepartmentStatus$: Observable; + loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); + constructor( private store: Store, private queryProtocolService: QueryProtocolService, @@ -47,10 +49,6 @@ export class OrganizationComponent implements OnInit { this.selectedDepartmentStatus$ = this.store.pipe( select(AppStore.MessengerSelector.QuerySelector.selectedDepartmentStatus) ); - } - - onSelectedOrganization(deptInfo: DeptInfo) { - const loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); this.store .pipe( @@ -60,11 +58,33 @@ export class OrganizationComponent implements OnInit { this.store.dispatch( QueryStore.deptUser({ divCd: 'ORG', - companyCode: loginInfo.companyCode, + companyCode: this.loginInfo.companyCode, + seq: loginRes.departmentCode, + search: '', + searchRange: DeptSearchType.All, + senderCompanyCode: this.loginInfo.companyCode, + senderEmployeeType: loginRes.userInfo.employeeType + }) + ); + }) + ) + .subscribe(); + } + + onSelectedOrganization(deptInfo: DeptInfo) { + this.store + .pipe( + take(1), + select(AppStore.AccountSelector.AuthenticationSelector.loginRes), + map(loginRes => { + this.store.dispatch( + QueryStore.deptUser({ + divCd: 'ORG', + companyCode: this.loginInfo.companyCode, seq: deptInfo.seq, search: '', searchRange: DeptSearchType.All, - senderCompanyCode: loginInfo.companyCode, + senderCompanyCode: this.loginInfo.companyCode, senderEmployeeType: loginRes.userInfo.employeeType }) ); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts index 433e2d78..3dc60ce6 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts @@ -17,7 +17,7 @@ import { DragDropModule } from '@angular/cdk/drag-drop'; import { UCapUiModule } from '@ucap-webmessenger/ui'; import { UCapUiChatModule } from '@ucap-webmessenger/ui-chat'; import { UCapUiRoomModule } from '@ucap-webmessenger/ui-room'; - +import { UCapUiProfileModule } from '@ucap-webmessenger/ui-profile'; import { UCapUiGroupModule } from '@ucap-webmessenger/ui-group'; import { UCapUiOrganizationModule } from '@ucap-webmessenger/ui-organization'; @@ -40,6 +40,7 @@ import { DIALOGS } from './dialogs'; UCapUiModule, UCapUiChatModule, UCapUiRoomModule, + UCapUiProfileModule, UCapUiGroupModule, UCapUiOrganizationModule ], diff --git a/projects/ucap-webmessenger-protocol-query/src/lib/models/dept-info.ts b/projects/ucap-webmessenger-protocol-query/src/lib/models/dept-info.ts index 4d3ea6a2..e8404dbc 100644 --- a/projects/ucap-webmessenger-protocol-query/src/lib/models/dept-info.ts +++ b/projects/ucap-webmessenger-protocol-query/src/lib/models/dept-info.ts @@ -1,26 +1,26 @@ import { DeptType } from '../types/dept.type'; export interface DeptInfo { - // 부서SEQ + /** 부서SEQ */ seq: number; - // 부서명 + /** 부서명 */ name: string; - // 기관코드 + /** 기관코드 */ companyCode: string; - // 부서타입 + /** 부서타입 */ type: DeptType; - // 본부SEQ + /** 본부SEQ */ rootSeq: number; - // 상위부서SEQ + /** 상위부서SEQ */ parentSeq: number; - // 조회순서 + /** 조회순서 */ order: string; - // 조회레벨 + /** 조회레벨 */ depth: number; - // ActiveYN + /** ActiveYN */ isActive: boolean; - // 부서명(영어) + /** 부서명(영어) */ nameEn: string; - // 부서명(중국어) + /** 부서명(중국어) */ nameCn: string; } From 5dd24638c8b063db4eacc9028a34a72cc7c1c061 Mon Sep 17 00:00:00 2001 From: leejh Date: Thu, 10 Oct 2019 18:39:04 +0900 Subject: [PATCH 3/5] =?UTF-8?q?ucap-profile-user-list-item=20>=20intro=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=EC=B2=98=EB=A6=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lib/components/user-list-item.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f9edff1a..fd6a0ba8 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 @@ -17,7 +17,7 @@ {{ userInfo.deptName }}
-
+
{{ userInfo.intro }}
From 55d593904babca247e1010743eb3ea95c0674d72 Mon Sep 17 00:00:00 2001 From: leejh Date: Fri, 11 Oct 2019 11:39:19 +0900 Subject: [PATCH 4/5] save sessionstorage for verinfo2 response data --- .../src/app/resolvers/messenger.resolver.ts | 2 ++ .../src/app/types/ver-info.type.ts | 20 +++++++++++ .../components/user-list-item.component.ts | 35 ++++++++++++------- 3 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 projects/ucap-webmessenger-app/src/app/types/ver-info.type.ts diff --git a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts index d20fadb4..da7c8781 100644 --- a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts +++ b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts @@ -44,6 +44,7 @@ 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 { VerInfo2, KEY_VER_INFO } from '@app/types/ver-info.type'; @Injectable() export class AppMessengerResolver implements Resolve { @@ -83,6 +84,7 @@ export class AppMessengerResolver implements Resolve { .pipe( take(1), tap(res => { + this.sessionStorageService.set(KEY_VER_INFO, res); this.store.dispatch(VersionInfoStore.versionInfo2Success({ res })); }), switchMap(res => { diff --git a/projects/ucap-webmessenger-app/src/app/types/ver-info.type.ts b/projects/ucap-webmessenger-app/src/app/types/ver-info.type.ts new file mode 100644 index 00000000..4268a1b8 --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/types/ver-info.type.ts @@ -0,0 +1,20 @@ +import { SyncMode } from '@ucap-webmessenger/api-public'; + +export const KEY_VER_INFO = 'ucap::VER_INFO'; + +export interface VerInfo2 { + protocolCode?: number; + syncMode?: SyncMode; + appVersion?: string; + installUrl?: string; + serverIp?: string; + uploadUrl?: string; + downloadUrl?: string; + profileUploadUrl?: string; + profileRoot?: string; + fileTerm?: number; + fileAllowSize?: number; + authIp?: boolean; + launcherAppVersion?: string; + launcherInstallUrl?: string; +} 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 4b2ff2ea..541eecea 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 @@ -11,6 +11,8 @@ import * as AppStore from '@app/store'; import { Subscription } from 'rxjs'; import { NGXLogger } from 'ngx-logger'; import { tap } from 'rxjs/operators'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { KEY_VER_INFO, VerInfo2 } from '@app/types/ver-info.type'; @Component({ selector: 'ucap-profile-user-list-item', @@ -29,24 +31,31 @@ export class UserListItemComponent implements OnInit, OnDestroy { @Input() compactable = false; - private profileImageRootSubscription: Subscription; + // private profileImageRootSubscription: Subscription; - constructor(private store: Store, private logger: NGXLogger) {} + constructor( + private store: Store, + private logger: NGXLogger, + private sessionStorageService: SessionStorageService + ) {} ngOnInit() { - this.profileImageRootSubscription = this.store - .pipe( - select(AppStore.SettingSelector.VersionInfoSelector.profileImageRoot), - tap(profileImageRoot => { - this.profileImageRoot = this.profileImageRoot || profileImageRoot; - }) - ) - .subscribe(); + // this.profileImageRootSubscription = this.store + // .pipe( + // select(AppStore.SettingSelector.VersionInfoSelector.profileImageRoot), + // tap(profileImageRoot => { + // this.profileImageRoot = this.profileImageRoot || profileImageRoot; + // }) + // ) + // .subscribe(); + + const verInfo = this.sessionStorageService.get(KEY_VER_INFO); + this.profileImageRoot = this.profileImageRoot || verInfo.profileRoot; } ngOnDestroy(): void { - if (!!this.profileImageRootSubscription) { - this.profileImageRootSubscription.unsubscribe(); - } + // if (!!this.profileImageRootSubscription) { + // this.profileImageRootSubscription.unsubscribe(); + // } } } From be0e24b9221fee9d7e0e861a49b745076c909da7 Mon Sep 17 00:00:00 2001 From: leejh Date: Fri, 11 Oct 2019 11:40:35 +0900 Subject: [PATCH 5/5] modify chat message component / TEXT modify userinfo in chat event list --- .../components/messages.component.html | 24 ++----- .../components/messages.component.ts | 7 +- .../src/lib/types/event.type.ts | 46 ++++++------- .../message-box/mass.component.html | 8 +++ .../components/message-box/mass.component.ts | 6 +- .../message-box/text.component.html | 8 +++ .../components/message-box/text.component.ts | 6 +- .../lib/components/messages.component.html | 65 ++++++++++++++----- .../src/lib/components/messages.component.ts | 37 ++++++++++- 9 files changed, 143 insertions(+), 64 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html index 60985e68..c2cf30a0 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html @@ -5,23 +5,14 @@
-
- @@ -34,17 +25,12 @@
- +
- + +
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index c929bc5a..25deb750 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -17,7 +17,7 @@ import * as EventStore from '@app/store/messenger/event'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { LoginInfo, KEY_LOGIN_INFO } from '@app/types'; -import { RoomInfo } from '@ucap-webmessenger/protocol-room'; +import { RoomInfo, UserInfo } from '@ucap-webmessenger/protocol-room'; import { tap } from 'rxjs/operators'; @Component({ @@ -35,6 +35,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked { eventList$: Observable; roomInfo: RoomInfo; roomInfoSubscription: Subscription; + userInfoList$: Observable; eventListProcessing$: Observable; constructor( @@ -64,6 +65,10 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked { ) .subscribe(); + this.userInfoList$ = this.store.pipe( + select(AppStore.MessengerSelector.RoomSelector.userInfoList) + ); + this.eventListProcessing$ = this.store.pipe( select(AppStore.MessengerSelector.EventSelector.infoListProcessing) ); diff --git a/projects/ucap-webmessenger-protocol-event/src/lib/types/event.type.ts b/projects/ucap-webmessenger-protocol-event/src/lib/types/event.type.ts index ed24aa90..ea028046 100644 --- a/projects/ucap-webmessenger-protocol-event/src/lib/types/event.type.ts +++ b/projects/ucap-webmessenger-protocol-event/src/lib/types/event.type.ts @@ -1,48 +1,48 @@ export enum EventType { - // J: 대화참여 + /** J: 대화참여 */ Join = 'J', - // C: 대화전송 + /** C: 대화전송 */ Character = 'C', - // F: 파일전송 + /** F: 파일전송 */ File = 'F', - // S: 스티커 + /** S: 스티커 */ Sticker = 'S', - // T: Mass Text + /** T: Mass Text */ MassText = 'T', - // E: 대화퇴장 + /** E: 대화퇴장 */ Exit = 'E', - // P: 일정 + /** P: 일정 */ Plan = 'P', - // V: 화상회의 + /** V: 화상회의 */ VideoConference = 'V', - // L: 링크(Legacy) + /** L: 링크(Legacy) */ Link = 'L', - // R: 대화방명변경 + /** R: 대화방명변경 */ RenameRoom = 'R', - // Y: 번역 + /** Y: 번역 */ Translation = 'Y', - // Z: 대용량 번역 + /** Z: 대용량 번역 */ MassTranslation = 'Z', - // U: 회수된 메시지 + /** U: 회수된 메시지 */ RecalledMessage = 'U', - // N: 방Timer 변경 안내 + /** N: 방Timer 변경 안내 */ GuideForRoomTimerChanged = 'N', - // X: iOS캡쳐알림 + /** X: iOS캡쳐알림 */ NotificationForiOSCapture = 'X', - // B: 타이머대화방알림 + /** B: 타이머대화방알림 */ NotificationForTimerRoom = 'B', - // Q: 2개월전 메시지 + /** Q: 2개월전 메시지 */ Before2MonthsAgo = 'Q', - // G: 강제 퇴장 + /** G: 강제 퇴장 */ ForcedExit = 'G', - // H: 챗봇대화 시작 + /** H: 챗봇대화 시작 */ ChatbotStart = 'H', - // K: 챗봇대화 종료 + /** K: 챗봇대화 종료 */ ChatbotEnd = 'K', - // I: 챗봇대화 전송 + /** I: 챗봇대화 전송 */ ChatbotSend = 'I', - // A: 챗봇 대용량 대화 전송 + /** A: 챗봇 대용량 대화 전송 */ ChatbotSendMass = 'A', - // M: 동영상 스트리밍 + /** M: 동영상 스트리밍 */ VideoStreamming = 'M' } diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.html b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.html index e69de29b..04a3f68e 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.html +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.html @@ -0,0 +1,8 @@ +

+ + {{ message.sentMessage }} + + + {{ message.sendDate | date: 'short' }} + +

diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.ts index 082a081e..ce58dbd1 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.ts @@ -1,4 +1,5 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; +import { Info } from '@ucap-webmessenger/protocol-event'; @Component({ selector: 'ucap-chat-message-box-mass', @@ -6,6 +7,9 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./mass.component.scss'] }) export class MassComponent implements OnInit { + @Input() + message: Info; + constructor() {} ngOnInit() {} diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/text.component.html b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/text.component.html index e69de29b..04a3f68e 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/text.component.html +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/text.component.html @@ -0,0 +1,8 @@ +

+ + {{ message.sentMessage }} + + + {{ message.sendDate | date: 'short' }} + +

diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/text.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/text.component.ts index 23a19dca..a2e54116 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/text.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/text.component.ts @@ -1,4 +1,5 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; +import { Info } from '@ucap-webmessenger/protocol-event'; @Component({ selector: 'ucap-chat-message-box-text', @@ -6,6 +7,9 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./text.component.scss'] }) export class TextComponent implements OnInit { + @Input() + message: Info; + constructor() {} ngOnInit() {} diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.html b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.html index 310dcf57..261e2898 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.html +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.html @@ -1,27 +1,60 @@
-
+ }"> +
+
    +
  • + +
  • +
  • + {{ getUserName(message.senderSeq) }} +
  • +
+
-
Character
+ +
Join
+
+ date splitter + + file + + image + + information + + mass-translation + + notice + + recall + + + sticker + + translation + + video + + video-conference + + +
+
+ {{ message.sentMessage }} +
+
+ {{ message.sendDate | date: 'short' }} +
+
+
- -
-
- {{ message.sentMessage }} -
-
- {{ message.sendDate | date: 'short' }} -
-
diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index 2a712d15..797d512e 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -1,8 +1,13 @@ import { Component, OnInit, Input } from '@angular/core'; import { Info, EventType } from '@ucap-webmessenger/protocol-event'; -import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; +import { + LoginResponse, + UserInfo +} from '@ucap-webmessenger/protocol-authentication'; import { NGXLogger } from 'ngx-logger'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { KEY_VER_INFO, VerInfo2 } from '@app/types/ver-info.type'; @Component({ selector: 'ucap-chat-messages', @@ -14,12 +19,38 @@ export class MessagesComponent implements OnInit { loginRes: LoginResponse; @Input() messages: Info[]; + @Input() + userInfos?: UserInfo[]; EventType = EventType; + profileImageRoot: string; - constructor(private logger: NGXLogger) {} + constructor( + private logger: NGXLogger, + private sessionStorageService: SessionStorageService + ) {} ngOnInit() { - this.logger.debug('type of userSeq', typeof this.loginRes.userSeq); + const verInfo = this.sessionStorageService.get(KEY_VER_INFO); + this.profileImageRoot = this.profileImageRoot || verInfo.profileRoot; + } + + getUserName(seq: number): string { + const userInfo: UserInfo[] = this.userInfos.filter( + user => user.seq === seq + ); + if (!!userInfo && userInfo.length > 0) { + return userInfo[0].name; + } + return '(알수없는 사용자)'; + } + getUserProfile(seq: number): string { + const userInfo: UserInfo[] = this.userInfos.filter( + user => user.seq === seq + ); + if (!!userInfo && userInfo.length > 0) { + return this.profileImageRoot + userInfo[0].profileImageFile; + } + return ''; } }