This commit is contained in:
병준 박 2019-10-18 12:49:31 +09:00
commit ca21e6a5c0
5 changed files with 35 additions and 3 deletions

View File

@ -1,3 +1,4 @@
import { UserSelectDialogType } from './../../../types/userselect.dialog.type';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui'; import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui';
@ -39,9 +40,10 @@ export class LeftSideComponent implements OnInit {
CreateChatDialogData, CreateChatDialogData,
CreateChatDialogResult CreateChatDialogResult
>(CreateChatDialogComponent, { >(CreateChatDialogComponent, {
width: '500px', width: '600px',
height: '500px', height: '500px',
data: { data: {
type: UserSelectDialogType.NewChat,
title: 'New Chat' title: 'New Chat'
} }
}); });

View File

@ -52,7 +52,7 @@
> >
</app-layout-chat-left-sidenav-organization> </app-layout-chat-left-sidenav-organization>
</mat-tab> </mat-tab>
<mat-tab> <mat-tab *ngIf="data.type === UserSelectDialogType.MessageForward">
<ng-template mat-tab-label> <ng-template mat-tab-label>
<mat-icon>chat</mat-icon> <mat-icon>chat</mat-icon>
</ng-template> </ng-template>
@ -67,10 +67,18 @@
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
</div> </div>
<div fxFlex="100px"> <div fxFlex="150px">
<ul> <ul>
<li *ngFor="let userInfo of selectedUserList"> <li *ngFor="let userInfo of selectedUserList">
{{ userInfo.name }} {{ userInfo.name }}
<button
mat-icon-button
aria-label="Delete user"
(click)="onClickDeleteUser(userInfo)"
>
<mat-icon>close</mat-icon>
</button>
<mat-icon></mat-icon>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -1,3 +1,4 @@
import { UserSelectDialogType } from './../../../../types/userselect.dialog.type';
import { Component, OnInit, OnDestroy, Inject } from '@angular/core'; import { Component, OnInit, OnDestroy, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
@ -33,6 +34,7 @@ import {
} from '@ucap-webmessenger/protocol-room'; } from '@ucap-webmessenger/protocol-room';
export interface CreateChatDialogData { export interface CreateChatDialogData {
type?: string;
title: string; title: string;
} }
@ -58,6 +60,8 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
private logger: NGXLogger private logger: NGXLogger
) {} ) {}
UserSelectDialogType = UserSelectDialogType;
loginRes: LoginResponse; loginRes: LoginResponse;
loginResSubscription: Subscription; loginResSubscription: Subscription;
sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>( sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
@ -252,6 +256,13 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
return false; return false;
} }
/** 선택된 사용자 취소 */
onClickDeleteUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
this.selectedUserList = this.selectedUserList.filter(
item => item.seq !== userInfo.seq
);
}
/** 팝업의 선택 이벤트 전달. */ /** 팝업의 선택 이벤트 전달. */
onClickChoice(choice: boolean): void { onClickChoice(choice: boolean): void {
this.dialogRef.close({ this.dialogRef.close({

View File

@ -1,2 +1,3 @@
export * from './environment.type'; export * from './environment.type';
export * from './login-info.type'; export * from './login-info.type';
export * from './userselect.dialog.type';

View File

@ -0,0 +1,10 @@
export enum UserSelectDialogType {
/** 새로운 대화 */
NewChat = 'NEW_CHAT',
/** 새로운 그룹 생성 */
NewGroup = 'NEW_GROUP',
/** 대화 전달 */
MessageForward = 'MESSAGE_FORWARD',
/** 그룹멤버 변경 */
GroupMemberUpdate = 'GROUP_MEMBER_UPDATE'
}