1. 대화방 > 대화상대추가 :: 기존인원이 지워져도 데이터는 문제 없도록 수정. >>> 추후 기존인원을 뺄 수 없도록 수정해야 함.

2. 유저선택 팝업 > 그룹 선택시 그룹원 선택 되도록 수정 >>> 이벤트 꼬이는 문제가 있어 추후 해결해야함.
This commit is contained in:
leejinho 2019-11-21 17:43:20 +09:00
parent 534e026742
commit b3ac86e4d6
7 changed files with 75 additions and 56 deletions

View File

@ -886,13 +886,17 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}); });
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
const userSeqs: number[] = []; const userSeqs: number[] = this.userInfoList.map(
userInfo => userInfo.seq
);
if ( if (
!!result.selectedUserList && !!result.selectedUserList &&
result.selectedUserList.length > 0 result.selectedUserList.length > 0
) { ) {
result.selectedUserList.map(user => { result.selectedUserList.forEach(user => {
userSeqs.push(user.seq); if (userSeqs.indexOf(user.seq) < 0) {
userSeqs.push(user.seq);
}
}); });
} }

View File

@ -3,7 +3,7 @@ import {
OnInit, OnInit,
OnDestroy, OnDestroy,
Output, Output,
EventEmitter, EventEmitter
} from '@angular/core'; } from '@angular/core';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
@ -21,13 +21,13 @@ import { DialogService } from '@ucap-webmessenger/ui';
import { import {
SelectGroupDialogComponent, SelectGroupDialogComponent,
SelectGroupDialogResult, SelectGroupDialogResult,
SelectGroupDialogData, SelectGroupDialogData
} from '../../dialogs/group/select-group.dialog.component'; } from '../../dialogs/group/select-group.dialog.component';
import { GroupDetailData } from '@ucap-webmessenger/protocol-sync'; import { GroupDetailData } from '@ucap-webmessenger/protocol-sync';
import { import {
CreateChatDialogComponent, CreateChatDialogComponent,
CreateChatDialogResult, CreateChatDialogResult,
CreateChatDialogData, CreateChatDialogData
} from '../../dialogs/chat/create-chat.dialog.component'; } from '../../dialogs/chat/create-chat.dialog.component';
import { UserSelectDialogType } from '@app/types'; import { UserSelectDialogType } from '@app/types';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
@ -36,7 +36,7 @@ import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
@Component({ @Component({
selector: 'app-layout-chat-right-drawer-room-user-list', selector: 'app-layout-chat-right-drawer-room-user-list',
templateUrl: './room-user-list.component.html', templateUrl: './room-user-list.component.html',
styleUrls: ['./room-user-list.component.scss'], styleUrls: ['./room-user-list.component.scss']
}) })
export class RoomUserListComponent implements OnInit, OnDestroy { export class RoomUserListComponent implements OnInit, OnDestroy {
@Output() @Output()
@ -105,15 +105,19 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
title: 'Edit Chat Member', title: 'Edit Chat Member',
curRoomUser: this.userInfoList.filter( curRoomUser: this.userInfoList.filter(
user => user.seq !== this.loginRes.userSeq user => user.seq !== this.loginRes.userSeq
), )
}, }
}); });
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
const userSeqs: number[] = []; const userSeqs: number[] = this.userInfoList.map(
userInfo => userInfo.seq
);
if (!!result.selectedUserList && result.selectedUserList.length > 0) { if (!!result.selectedUserList && result.selectedUserList.length > 0) {
result.selectedUserList.map(user => { result.selectedUserList.forEach(user => {
userSeqs.push(user.seq); if (userSeqs.indexOf(user.seq) < 0) {
userSeqs.push(user.seq);
}
}); });
} }
@ -125,8 +129,8 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
RoomStore.inviteOrOpen({ RoomStore.inviteOrOpen({
req: { req: {
divCd: 'Invite', divCd: 'Invite',
userSeqs, userSeqs
}, }
}) })
); );
} }
@ -141,8 +145,8 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
>(SelectGroupDialogComponent, { >(SelectGroupDialogComponent, {
width: '600px', width: '600px',
data: { data: {
title: 'Group Select', title: 'Group Select'
}, }
}); });
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
@ -159,7 +163,7 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
this.store.dispatch( this.store.dispatch(
SyncStore.updateGroupMember({ SyncStore.updateGroupMember({
oldGroup, oldGroup,
trgtUserSeq, trgtUserSeq
}) })
); );
} }

View File

@ -70,9 +70,9 @@
<ucap-group-expansion-panel <ucap-group-expansion-panel
#groupExpansionPanel #groupExpansionPanel
[groupBuddyList]="groupBuddyList$ | async" [groupBuddyList]="groupBuddyList$ | async"
[favoritBuddyList]="favoritBuddyList$ | async"
[selectedUserList]="selectedUserList" [selectedUserList]="selectedUserList"
[checkable]="true" [checkable]="true"
(checkGroup)="onCheckGroup($event)"
class="group-expansion" class="group-expansion"
> >
<ucap-profile-user-list-item <ucap-profile-user-list-item
@ -138,20 +138,6 @@
<mat-icon>chat</mat-icon> <mat-icon>chat</mat-icon>
</ng-template> </ng-template>
<div> <div>
<!-- <cdk-virtual-scroll-viewport itemSize="20" style="height: 100%">
<ucap-room-list-item
*cdkVirtualFor="let room of roomList"
[loginRes]="loginRes"
[roomInfo]="room"
[roomUserInfo]="getRoomUserList(room)"
[sessionVerinfo]="sessionVerinfo"
[checkable]="getCheckableRoom(room)"
[isChecked]="getCheckedRoom(room)"
[multiCheckable]="false"
(checkRoom)="onCheckRoom($event)"
>
</ucap-room-list-item>
</cdk-virtual-scroll-viewport> -->
<ucap-room-list-item <ucap-room-list-item
*ngFor="let room of roomList" *ngFor="let room of roomList"
[loginRes]="loginRes" [loginRes]="loginRes"

View File

@ -376,6 +376,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
} }
} }
/** 조직도 > 부서원 전체 선택 */
onCheckAllUser(params: { onCheckAllUser(params: {
isChecked: boolean; isChecked: boolean;
userInfos: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[]; userInfos: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[];

View File

@ -47,27 +47,38 @@
</mat-icon> </mat-icon>
</button> </button>
<ng-container [ngSwitch]="node.nodeType"> <ng-container [ngSwitch]="node.nodeType">
<span *ngSwitchCase="NodeType.Profile">내 프로필</span> <span *ngSwitchCase="NodeType.Profile">
<span *ngSwitchCase="NodeType.Favorit" <span class="title-name ellipsis">내 프로필</span>
>즐겨찾기 </span>
<span class="text-accent-color number" <span *ngSwitchCase="NodeType.Favorit">
>({{ node.countOfChildren }}명)</span <span class="title-name ellipsis">즐겨찾기</span>
<span class="text-accent-color number">
({{ node.countOfChildren }}명)</span
></span ></span
> >
<span *ngSwitchCase="NodeType.Buddy"> <span *ngSwitchCase="NodeType.Buddy">
<span class="title-name ellipsis">{{ <span class="title-name ellipsis">{{
node.groupDetail.name node.groupDetail.name
}}</span> }}</span>
<span class="text-accent-color number" <span class="text-accent-color number">
>({{ node.countOfChildren }}명)</span ({{ node.countOfChildren }}명)</span
> >
</span> </span>
</ng-container> </ng-container>
<mat-checkbox
*ngIf="checkable"
#checkbox
[checked]="getCheckedGroup(node.groupDetail)"
(change)="onChangeCheck(checkbox.checked, node.groupDetail)"
(click)="$event.stopPropagation()"
class="group-check"
>
</mat-checkbox>
<button <button
mat-icon-button mat-icon-button
aria-label="group menu" aria-label="group menu"
*ngIf="node.nodeType !== NodeType.Profile" *ngIf="node.nodeType !== NodeType.Profile && !checkable"
(click)="onClickMore($event, node.groupDetail)" (click)="onClickMore($event, node.groupDetail)"
class="group-menu" class="group-menu"
> >

View File

@ -64,6 +64,11 @@
line-height: 20px; line-height: 20px;
margin-right: 10px; margin-right: 10px;
} }
.group-check {
margin-left: auto;
margin-right: 16px;
}
.group-menu { .group-menu {
margin-left: auto; margin-left: auto;
opacity: 0.6; opacity: 0.6;

View File

@ -108,6 +108,8 @@ export class ExpansionPanelComponent
return; return;
} }
this.groupList = list;
this.buddyNodes = []; this.buddyNodes = [];
for (const item of list) { for (const item of list) {
@ -179,6 +181,8 @@ export class ExpansionPanelComponent
treeFlattener: MatTreeFlattener<GroupNode, FlatNode>; treeFlattener: MatTreeFlattener<GroupNode, FlatNode>;
dataSource: VirtualScrollTreeFlatDataSource<GroupNode, FlatNode>; dataSource: VirtualScrollTreeFlatDataSource<GroupNode, FlatNode>;
groupList: { group: GroupDetailData; buddyList: UserInfo[] }[];
constructor( constructor(
private changeDetectorRef: ChangeDetectorRef, private changeDetectorRef: ChangeDetectorRef,
private logger: NGXLogger private logger: NGXLogger
@ -237,30 +241,34 @@ export class ExpansionPanelComponent
} }
/** 그룹리스트가 checkable 할 경우 checkbox 의 change 이벤트를 상위 컴포넌트로 전달한다. */ /** 그룹리스트가 checkable 할 경우 checkbox 의 change 이벤트를 상위 컴포넌트로 전달한다. */
onChangeCheck( onChangeCheck(value: boolean, group: GroupDetailData, nodeType: NodeType) {
value: boolean, const groupInfos = this.groupList.filter(
groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[] } groupInfo => groupInfo.group.seq === group.seq
) { );
this.checkGroup.emit({
isChecked: value, if (groupInfos.length > 0) {
groupBuddyList this.checkGroup.emit({
}); isChecked: value,
groupBuddyList: groupInfos[0]
});
}
} }
/** 그룹리스트가 checkable 할 경우 checkbox 의 isChecked 를 관장하며, 하위 부서원들의 전체선택여부를 판단한다. */ /** 그룹리스트가 checkable 할 경우 checkbox 의 isChecked 를 관장하며, 하위 부서원들의 전체선택여부를 판단한다. */
getCheckedGroup(groupBuddy: { getCheckedGroup(group: GroupDetailData) {
group: GroupDetailData; if (!group || group === undefined) {
buddyList: UserInfo[];
}) {
if (groupBuddy.buddyList.length === 0) {
return false; return false;
} }
if (group.userSeqs.length === 0) {
return false;
}
if (!!this.selectedUserList && this.selectedUserList.length > 0) { if (!!this.selectedUserList && this.selectedUserList.length > 0) {
let allExist = true; let allExist = true;
groupBuddy.buddyList.some(groupUser => { group.userSeqs.some(seq => {
if ( if (
this.selectedUserList.filter(item => item.seq === groupUser.seq) this.selectedUserList.filter(item => item.seq === seq).length === 0
.length === 0
) { ) {
allExist = false; allExist = false;
return true; return true;