diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts
index 06cecc51..2628f60d 100644
--- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts
+++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { ucapAnimations } from '@ucap-webmessenger/ui';
import { Observable } from 'rxjs';
import {
@@ -6,8 +6,11 @@ import {
QueryProtocolService,
DeptSearchType,
UserInfoSS,
- DeptUserResponse
+ DeptUserResponse,
+ UserInfoF,
+ UserInfoDN
} from '@ucap-webmessenger/protocol-query';
+import { UserInfo } from '@ucap-webmessenger/protocol-sync';
import { Store, select } from '@ngrx/store';
import { NGXLogger } from 'ngx-logger';
@@ -26,6 +29,16 @@ import { KEY_VER_INFO } from '@app/types/ver-info.type';
animations: ucapAnimations
})
export class OrganizationComponent implements OnInit {
+ @Input()
+ /** 선택된 사용자의 리스트 */
+ selectedUserList?: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[] = [];
+
+ @Output()
+ checkUser = new EventEmitter<{
+ isChecked: boolean;
+ userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
+ }>();
+
departmentInfoList$: Observable
;
selectedDepartmentUserInfoList$: Observable;
selectedDepartmentStatus$: Observable;
@@ -76,6 +89,16 @@ export class OrganizationComponent implements OnInit {
.subscribe();
}
+ getCheckedUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
+ if (!!this.selectedUserList && this.selectedUserList.length > 0) {
+ return (
+ this.selectedUserList.filter(item => item.seq === userInfo.seq).length >
+ 0
+ );
+ }
+ return false;
+ }
+
onSelectedOrganization(deptInfo: DeptInfo) {
this.store
.pipe(
@@ -97,4 +120,12 @@ export class OrganizationComponent implements OnInit {
)
.subscribe();
}
+
+ onCheckUser(params: {
+ isChecked: boolean;
+ userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
+ }) {
+ console.log(this.selectedUserList);
+ this.checkUser.emit(params);
+ }
}
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 8e632e65..445a0a8a 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
@@ -15,7 +15,8 @@
+ [sessionVerinfo]="sessionVerinfo" [selectedUserList]="selectedUserList"
+ [isChecked]="getCheckedUser(userInfo)" (checkUser)="onCheckUser($event)" [checkable]="true">
@@ -23,7 +24,9 @@
device_hub
-
+
+
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 f6a36312..f1694122 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
@@ -207,7 +207,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
this.selectedUserList.filter(user => user.seq === item.seq).length ===
0
) {
- this.selectedUserList.push(item);
+ this.selectedUserList = [...this.selectedUserList, item];
}
});
} else {
@@ -226,9 +226,10 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
if (params.isChecked) {
if (
this.selectedUserList.filter(user => user.seq === params.userInfo.seq)
- .length === 0
+ .length === 0 &&
+ params.userInfo
) {
- this.selectedUserList.push(params.userInfo);
+ this.selectedUserList = [...this.selectedUserList, params.userInfo];
}
} else {
this.selectedUserList = this.selectedUserList.filter(
@@ -242,4 +243,14 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
// choice
// });
}
+
+ getCheckedUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
+ if (!!this.selectedUserList && this.selectedUserList.length > 0) {
+ return (
+ this.selectedUserList.filter(item => item.seq === userInfo.seq).length >
+ 0
+ );
+ }
+ return false;
+ }
}
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 05a5fdca..0b44d067 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
@@ -48,6 +48,9 @@ export class UserListItemComponent implements OnInit, OnDestroy {
compactable = false;
@Input()
sessionVerinfo: VersionInfo2Response;
+ @Input()
+ /** 선택된 사용자의 리스트 */
+ selectedUserList?: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[] = [];
@Output()
checkUser = new EventEmitter<{