수정 :: KEY_VER_INFO 에 대한 미진한 부분 처리.

This commit is contained in:
leejh 2019-10-15 16:59:05 +09:00
parent fc770168c7
commit 21c9bd0ae2
5 changed files with 36 additions and 14 deletions

View File

@ -1,7 +1,3 @@
<ucap-room-list-item
*ngFor="let room of roomList"
[roomInfo]="room"
[roomUserInfo]="getRoomUserList(room)"
(click)="onSelectedRoom(room)"
>
<ucap-room-list-item *ngFor="let room of roomList" [roomInfo]="room" [roomUserInfo]="getRoomUserList(room)"
[sessionVerinfo]="sessionVerinfo" (click)="onSelectedRoom(room)">
</ucap-room-list-item>

View File

@ -15,6 +15,9 @@ import {
RoomUserDetailData,
RoomUserData
} 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';
@Component({
selector: 'app-layout-chat-left-sidenav-chat',
@ -26,10 +29,15 @@ export class ChatComponent implements OnInit, OnDestroy {
roomList: RoomInfo[];
roomUserList: RoomUserDetailData[];
roomUserShortList: RoomUserData[];
sessionVerinfo: VersionInfo2Response;
roomSubscription: Subscription;
constructor(private store: Store<any>, private logger: NGXLogger) {}
constructor(
private store: Store<any>,
private logger: NGXLogger,
private sessionStorageService: SessionStorageService
) {}
ngOnInit() {
this.roomSubscription = combineLatest([
@ -51,6 +59,10 @@ export class ChatComponent implements OnInit, OnDestroy {
})
)
.subscribe();
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
KEY_VER_INFO
);
}
ngOnDestroy(): void {

View File

@ -5,11 +5,13 @@
<h3>User-list-item</h3>
<div>
<ucap-profile-user-list-item [userInfo]="userInfo" [profileImageRoot]="profileImageRoot" [presence]="presence">
<ucap-profile-user-list-item [userInfo]="userInfo" [profileImageRoot]="profileImageRoot" [presence]="presence"
[sessionVerinfo]="sessionVerinfo">
</ucap-profile-user-list-item>
<ucap-profile-user-list-item [userInfo]="userInfo">
<ucap-profile-user-list-item [userInfo]="userInfo" [sessionVerinfo]="sessionVerinfo">
</ucap-profile-user-list-item>
<ucap-profile-user-list-item [userInfo]="userInfo" [profileImageRoot]="profileImageRoot" [checkable]="true">
<ucap-profile-user-list-item [userInfo]="userInfo" [profileImageRoot]="profileImageRoot" [checkable]="true"
[sessionVerinfo]="sessionVerinfo">
</ucap-profile-user-list-item>
</div>
<h3>Organization</h3>
@ -26,7 +28,7 @@
</div>
<h3>Chat</h3>
<div>
<ucap-room-list-item [roomInfo]="roomInfo">
<ucap-room-list-item [roomInfo]="roomInfo" [sessionVerinfo]="sessionVerinfo">
</ucap-room-list-item>
</div>
<h3>Chat::MessageBox</h3>

View File

@ -11,10 +11,12 @@ import {
TerminalStatusInfo,
TerminalStatusNumber
} from '@ucap-webmessenger/protocol-status';
import { StatusCode } from '@ucap-webmessenger/core';
import { Router } from '@angular/router';
import { Company } from '@ucap-webmessenger/api-external';
import { EventType } 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';
@Component({
selector: 'app-template.page',
@ -34,9 +36,17 @@ export class TemplatePageComponent implements OnInit {
roomInfo: RoomInfo = roomInfo;
sessionVerinfo: VersionInfo2Response;
constructor(private router: Router) {}
ngOnInit() {}
ngOnInit() {
this.sessionVerinfo = {
statusCode: ApiStatusCode.Success,
errorMessage: '',
profileRoot: this.profileImageRoot
};
}
onClickLogin() {
this.router.navigate(['/account/login']);

View File

@ -5,6 +5,7 @@ import {
UserInfo as RoomUserInfo
} from '@ucap-webmessenger/protocol-room';
import { NGXLogger } from 'ngx-logger';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
@Component({
selector: 'ucap-room-list-item',
@ -14,9 +15,10 @@ import { NGXLogger } from 'ngx-logger';
export class ListItemComponent implements OnInit {
@Input()
roomInfo: RoomInfo;
@Input()
roomUserInfo: RoomUserInfo[] | UserInfoShort[];
@Input()
sessionVerinfo: VersionInfo2Response;
constructor(private logger: NGXLogger) {}