수정 :: 유저 선택 팝업 :: 팝업 타입 정의 및 기 선택 유저리스트에서 선택 취소기능 추가.

This commit is contained in:
leejh 2019-10-18 09:48:38 +09:00
parent a16940b3f2
commit 36ea177786
5 changed files with 81 additions and 17 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

@ -2,7 +2,13 @@
<mat-card-header cdkDrag cdkDragRootElement=".cdk-overlay-pane" cdkDragHandle> <mat-card-header cdkDrag cdkDragRootElement=".cdk-overlay-pane" cdkDragHandle>
<mat-card-title>{{ data.title }}</mat-card-title> <mat-card-title>{{ data.title }}</mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content fxLayout fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="10px" fxLayoutGap.xs="0"> <mat-card-content
fxLayout
fxLayout.xs="column"
fxLayoutAlign="center"
fxLayoutGap="10px"
fxLayoutGap.xs="0"
>
<div fxFlex class="container"> <div fxFlex class="container">
<mat-tab-group mat-stretch-tabs> <mat-tab-group mat-stretch-tabs>
<mat-tab> <mat-tab>
@ -10,14 +16,28 @@
<mat-icon>group</mat-icon> <mat-icon>group</mat-icon>
</ng-template> </ng-template>
<ucap-organization-tenant-search [companyList]="companyList$ | async" [companyCode]="companyCode" <ucap-organization-tenant-search
(keyDownEnter)="onKeyDownEnterOrganizationTenantSearch($event)"></ucap-organization-tenant-search> [companyList]="companyList$ | async"
<ucap-group-expansion-panel #groupExpansionPanel [groupBuddyList]="groupBuddyList$ | async" [companyCode]="companyCode"
[favoritBuddyList]="favoritBuddyList$ | async" [selectedUserList]="selectedUserList" [checkable]="true" (keyDownEnter)="onKeyDownEnterOrganizationTenantSearch($event)"
(checkGroup)="onCheckGroup($event)"> ></ucap-organization-tenant-search>
<ucap-profile-user-list-item *ucapGroupExpansionPanelItem="let userInfo" [userInfo]="userInfo" <ucap-group-expansion-panel
[sessionVerinfo]="sessionVerinfo" [selectedUserList]="selectedUserList" #groupExpansionPanel
[isChecked]="getCheckedUser(userInfo)" [checkable]="true" (checkUser)="onCheckUser($event)"> [groupBuddyList]="groupBuddyList$ | async"
[favoritBuddyList]="favoritBuddyList$ | async"
[selectedUserList]="selectedUserList"
[checkable]="true"
(checkGroup)="onCheckGroup($event)"
>
<ucap-profile-user-list-item
*ucapGroupExpansionPanelItem="let userInfo"
[userInfo]="userInfo"
[sessionVerinfo]="sessionVerinfo"
[selectedUserList]="selectedUserList"
[isChecked]="getCheckedUser(userInfo)"
[checkable]="true"
(checkUser)="onCheckUser($event)"
>
</ucap-profile-user-list-item> </ucap-profile-user-list-item>
</ucap-group-expansion-panel> </ucap-group-expansion-panel>
</mat-tab> </mat-tab>
@ -25,30 +45,50 @@
<ng-template mat-tab-label> <ng-template mat-tab-label>
<mat-icon>device_hub</mat-icon> <mat-icon>device_hub</mat-icon>
</ng-template> </ng-template>
<app-layout-chat-left-sidenav-organization [selectedUserList]="selectedUserList" [isUserSelect]="true" <app-layout-chat-left-sidenav-organization
(checkUser)="onCheckUser($event)"> [selectedUserList]="selectedUserList"
[isUserSelect]="true"
(checkUser)="onCheckUser($event)"
>
</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>
<ucap-room-list-item *ngFor="let room of roomList" [loginRes]="loginRes" [roomInfo]="room" <ucap-room-list-item
[roomUserInfo]="getRoomUserList(room)" [sessionVerinfo]="sessionVerinfo"> *ngFor="let room of roomList"
[loginRes]="loginRes"
[roomInfo]="room"
[roomUserInfo]="getRoomUserList(room)"
[sessionVerinfo]="sessionVerinfo"
>
</ucap-room-list-item> </ucap-room-list-item>
</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>
</mat-card-content> </mat-card-content>
<mat-card-actions class="button-farm flex-row"> <mat-card-actions class="button-farm flex-row">
<button mat-stroked-button (click)="onClickChoice(false)" class="mat-primary"> <button
mat-stroked-button
(click)="onClickChoice(false)"
class="mat-primary"
>
No No
</button> </button>
<button mat-flat-button (click)="onClickChoice(true)" class="mat-primary"> <button mat-flat-button (click)="onClickChoice(true)" class="mat-primary">

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'
}