새그룹 추가시 빈그룹으로 생성할 수 있도록 수정,

그룹 생성시 confirm 하도록 수정.
This commit is contained in:
leejinho 2019-11-21 16:14:51 +09:00
parent 5fa57c7130
commit 81397401b9
3 changed files with 35 additions and 11 deletions

View File

@ -28,14 +28,6 @@
</mat-tab>
<mat-tab [aria-label]="MainMenu.Chat">
<ng-template mat-tab-label>
<!--<mat-icon
[matBadgeHidden]="(badgeChatUnReadCount$ | async) <= 0"
[matBadge]="badgeChatUnReadCount$ | async"
matBadgeDescription="확인하지 않은 메시지가 있습니다."
matBadgeColor="accent"
matBadgePosition="above after"
>chat</mat-icon
>-->
<div
class="icon-item"
[matBadgeHidden]="badgeChatUnReadCount <= 0"

View File

@ -136,7 +136,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
if (!!result && !!result.choice && result.choice) {
if (
!!result.selectedUserList &&
result.selectedUserList.length > 0 &&
// result.selectedUserList.length > 0 &&
result.groupName.trim().length > 0
) {
const userSeqs: number[] = [];

View File

@ -48,6 +48,12 @@ import {
UserInfoShort,
UserInfo as RoomUserInfo
} from '@ucap-webmessenger/protocol-room';
import {
ConfirmDialogComponent,
ConfirmDialogResult,
ConfirmDialogData,
DialogService
} from '@ucap-webmessenger/ui';
export interface CreateChatDialogData {
type?: string;
@ -96,7 +102,8 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
private sessionStorageService: SessionStorageService,
private queryProtocolService: QueryProtocolService,
private formBuilder: FormBuilder,
private logger: NGXLogger
private logger: NGXLogger,
private dialogService: DialogService
) {
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
KEY_VER_INFO
@ -474,7 +481,32 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
}
/** 팝업의 선택 이벤트 전달. */
onClickChoice(choice: boolean): void {
async onClickChoice(choice: boolean): Promise<void> {
if (this.data.type === UserSelectDialogType.NewGroup) {
let cfmMsg = `새로운 그룹을 추가하시겠습니까?`;
if (this.selectedUserList.length === 0) {
cfmMsg += `<br/>빈 그룹으로 생성됩니다.`;
}
const result = await this.dialogService.open<
ConfirmDialogComponent,
ConfirmDialogData,
ConfirmDialogResult
>(ConfirmDialogComponent, {
width: '400px',
data: {
title: 'Delete',
html: cfmMsg
}
});
if (!!result && !!result.choice && result.choice) {
this.doAction(choice);
}
} else {
this.doAction(choice);
}
}
doAction(choice: boolean) {
this.dialogRef.close({
choice,
selectedUserList: this.selectedUserList,