From db722df333406bc28b6729297286725f11e810a0 Mon Sep 17 00:00:00 2001 From: leejh Date: Tue, 15 Oct 2019 14:58:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95=20::=20KEY=5FVER=5FINFO=20?= =?UTF-8?q?=EC=9D=98=20SessionStorage=20=EC=A0=95=EB=B3=B4=EB=A5=BC=20ui?= =?UTF-8?q?=20component=20=EC=97=90=EC=84=9C=20=EC=B0=B8=EC=A1=B0=ED=95=98?= =?UTF-8?q?=EB=8D=98=EA=B2=83=EC=9D=84=20=EC=83=81=EC=9C=84=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=A3=BC?= =?UTF-8?q?=EC=9E=85=ED=95=98=EB=8A=94=20=EB=B0=A9=EC=8B=9D=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../left-sidenav/group.component.html | 54 +++++-------------- .../left-sidenav/group.component.ts | 7 +++ .../components/messages.component.html | 3 +- .../components/messages.component.ts | 6 +++ .../src/app/resolvers/messenger.resolver.ts | 12 +++-- .../src/app/types/ver-info.type.ts | 19 ------- .../src/lib/components/messages.component.ts | 8 +-- .../components/user-list-item.component.ts | 8 +-- 8 files changed, 47 insertions(+), 70 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 71c23e2c..f7933aa4 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 @@ -1,23 +1,11 @@
- - - +
- - + +
-
+
@@ -72,12 +48,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 246d625a..2bb60caa 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 @@ -35,6 +35,8 @@ import { UserInfoDN } from '@ucap-webmessenger/protocol-query'; import { MatMenuTrigger, MatMenu } from '@angular/material'; +import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; +import { KEY_VER_INFO } from '@app/types/ver-info.type'; @Component({ selector: 'app-layout-chat-left-sidenav-group', @@ -68,6 +70,8 @@ export class GroupComponent implements OnInit { loginRes: LoginResponse; loginResSubscription: Subscription; + sessionVerinfo: VersionInfo2Response; + constructor( private store: Store, private sessionStorageService: SessionStorageService, @@ -77,6 +81,9 @@ export class GroupComponent implements OnInit { ngOnInit() { const loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); + this.sessionVerinfo = this.sessionStorageService.get( + KEY_VER_INFO + ); this.companyCode = loginInfo.companyCode; this.loginResSubscription = this.store 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 71564180..4dab8b5c 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 @@ -40,7 +40,8 @@ + [sessionVerInfo]="sessionVerInfo" (massDetail)="onMassDetail($event)" (save)="onSave($event)" + (imageViewer)="onImageViewer($event)"> 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 086968c8..1bebf749 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 @@ -22,6 +22,8 @@ import { LoginInfo, KEY_LOGIN_INFO } from '@app/types'; import { RoomInfo, UserInfo } from '@ucap-webmessenger/protocol-room'; import { tap } from 'rxjs/operators'; import { FileInfo } from '@ucap-webmessenger/ui-chat'; +import { KEY_VER_INFO } from '@app/types/ver-info.type'; +import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; @Component({ selector: 'app-layout-messenger-messages', @@ -40,6 +42,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked { roomInfoSubscription: Subscription; userInfoList$: Observable; eventListProcessing$: Observable; + sessionVerInfo: VersionInfo2Response; constructor( private store: Store, @@ -49,6 +52,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked { ngOnInit() { const loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); + this.sessionVerInfo = this.sessionStorageService.get( + KEY_VER_INFO + ); this.loginResSubscription = this.store .pipe( 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 804b1cb8..2eee9a12 100644 --- a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts +++ b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts @@ -18,7 +18,10 @@ import { Store, select } from '@ngrx/store'; import { ProtocolService } from '@ucap-webmessenger/protocol'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; -import { PublicApiService } from '@ucap-webmessenger/api-public'; +import { + PublicApiService, + VersionInfo2Response +} from '@ucap-webmessenger/api-public'; import { LoginInfo, @@ -44,7 +47,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'; +import { KEY_VER_INFO } from '@app/types/ver-info.type'; import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; @Injectable() @@ -85,7 +88,10 @@ export class AppMessengerResolver implements Resolve { .pipe( take(1), tap(res => { - this.sessionStorageService.set(KEY_VER_INFO, 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 index 4268a1b8..edc7e130 100644 --- a/projects/ucap-webmessenger-app/src/app/types/ver-info.type.ts +++ b/projects/ucap-webmessenger-app/src/app/types/ver-info.type.ts @@ -1,20 +1 @@ -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-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index 4aff3239..79074d67 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 @@ -6,8 +6,8 @@ import { UserInfo } from '@ucap-webmessenger/protocol-authentication'; import { NGXLogger } from 'ngx-logger'; +import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; -import { KEY_VER_INFO, VerInfo2 } from '@app/types/ver-info.type'; import { FileInfo } from '../models/file-info.json'; import { DatePipe } from '@angular/common'; @@ -23,6 +23,8 @@ export class MessagesComponent implements OnInit { messages: Info[]; @Input() userInfos?: UserInfo[]; + @Input() + sessionVerInfo: VersionInfo2Response; @Output() massDetail = new EventEmitter(); @@ -41,8 +43,8 @@ export class MessagesComponent implements OnInit { ) {} ngOnInit() { - const verInfo = this.sessionStorageService.get(KEY_VER_INFO); - this.profileImageRoot = this.profileImageRoot || verInfo.profileRoot; + this.profileImageRoot = + this.profileImageRoot || this.sessionVerInfo.profileRoot; } getUserName(seq: number): 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 fa5b245d..bc5f89bb 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 @@ -19,10 +19,10 @@ 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'; import { StatusCode } from '@ucap-webmessenger/core'; import { PresenceType } from '../types/presence-type.type'; +import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; @Component({ selector: 'ucap-profile-user-list-item', @@ -43,6 +43,8 @@ export class UserListItemComponent implements OnInit, OnDestroy { checkable = false; @Input() compactable = false; + @Input() + sessionVerinfo: VersionInfo2Response; @Output() contextMenu = new EventEmitter<{ @@ -72,8 +74,8 @@ export class UserListItemComponent implements OnInit, OnDestroy { // ) // .subscribe(); - const verInfo = this.sessionStorageService.get(KEY_VER_INFO); - this.profileImageRoot = this.profileImageRoot || verInfo.profileRoot; + this.profileImageRoot = + this.profileImageRoot || this.sessionVerinfo.profileRoot; } ngOnDestroy(): void {