diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html index cb93dc2e..97e3c1ac 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html @@ -82,7 +82,7 @@ [selectedUserList]="selectedUserList" [isChecked]="getCheckedUser(userInfo)" [checkable]="true" - [inTree]="true" + (checkUser)="onCheckUser($event)" (click)="onToggleUser(userInfo)" class="list-item-frame" > @@ -155,6 +155,7 @@ [isChecked]="getCheckedRoom(room)" [multiCheckable]="false" (checkRoom)="onCheckRoom($event)" + (click)="onToggleRoom(room)" > diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts index ac6813b1..51b0db01 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts @@ -4,7 +4,8 @@ import { OnInit, OnDestroy, Inject, - EventEmitter + EventEmitter, + ChangeDetectorRef } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { @@ -103,7 +104,8 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { private queryProtocolService: QueryProtocolService, private formBuilder: FormBuilder, private logger: NGXLogger, - private dialogService: DialogService + private dialogService: DialogService, + private changeDetectorRef: ChangeDetectorRef ) { this.sessionVerinfo = this.sessionStorageService.get( KEY_VER_INFO @@ -380,6 +382,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { .length === 0 ); } + this.changeDetectorRef.detectChanges(); } /** 조직도 > 부서원 전체 선택 */ @@ -421,7 +424,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { item => item.seq !== params.userInfo.seq ); } - console.log(this.selectedUserList); + this.changeDetectorRef.detectChanges(); } onToggleUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { if ( @@ -436,7 +439,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { } } - /** 대화방 > 대화방 선택 :: 해당 팝업에서는 대화방을 중복 선택하지 않는다 */ + /** 대화방 > 대화방 선택 */ onCheckRoom(params: { isChecked: boolean; roomInfo: RoomInfo }) { if (params.isChecked) { this.selectedRoom = params.roomInfo; @@ -444,6 +447,17 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { this.selectedRoom = null; } } + onToggleRoom(roomInfo: RoomInfo) { + if (!!this.selectedRoom) { + if (this.selectedRoom.roomSeq === roomInfo.roomSeq) { + this.selectedRoom = null; + } else { + this.selectedRoom = roomInfo; + } + } else { + this.selectedRoom = roomInfo; + } + } /** 그룹>부서원 리스트의 ischecked 를 판단. */ getCheckedUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html index 82926569..d68dcd83 100644 --- a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html +++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html @@ -37,7 +37,7 @@ #checkbox [checked]="isChecked" (change)="onChangeCheck(checkbox.checked, userInfo)" - (click)="onClickCheck($event)" + (click)="$event.stopPropagation()" > 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 5fbfde29..1b56f947 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 @@ -43,9 +43,6 @@ export class UserListItemComponent implements OnInit { @Input() /** 선택된 사용자의 리스트 */ selectedUserList?: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[] = []; - @Input() - /** event bubbling fixed in custom tree */ - inTree = false; @Output() checkUser = new EventEmitter<{ @@ -105,11 +102,6 @@ export class UserListItemComponent implements OnInit { userInfo }); } - onClickCheck(event: MouseEvent) { - if (!this.inTree) { - event.stopPropagation(); - } - } onClickOpenProfile( event: MouseEvent,