대화방 > 그룹멤버로추가 :: 기능구현
This commit is contained in:
parent
3fc5fa254a
commit
b43d7dd5ff
@ -81,6 +81,9 @@
|
|||||||
<button mat-menu-item (click)="onClickContextMenu('ADD_MEMBER')">
|
<button mat-menu-item (click)="onClickContextMenu('ADD_MEMBER')">
|
||||||
대화상대추가
|
대화상대추가
|
||||||
</button>
|
</button>
|
||||||
|
<button mat-menu-item (click)="onClickContextMenu('ADD_GROUP')">
|
||||||
|
그룹멤버로추가
|
||||||
|
</button>
|
||||||
<button mat-menu-item (click)="onClickContextMenu('EDIT_ROOM')">
|
<button mat-menu-item (click)="onClickContextMenu('EDIT_ROOM')">
|
||||||
대화방설정
|
대화방설정
|
||||||
</button>
|
</button>
|
||||||
|
@ -40,6 +40,7 @@ import * as AppStore from '@app/store';
|
|||||||
import * as EventStore from '@app/store/messenger/event';
|
import * as EventStore from '@app/store/messenger/event';
|
||||||
import * as ChatStore from '@app/store/messenger/chat';
|
import * as ChatStore from '@app/store/messenger/chat';
|
||||||
import * as RoomStore from '@app/store/messenger/room';
|
import * as RoomStore from '@app/store/messenger/room';
|
||||||
|
import * as SyncStore from '@app/store/messenger/sync';
|
||||||
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
||||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||||
import {
|
import {
|
||||||
@ -84,6 +85,8 @@ import {
|
|||||||
EditChatRoomDialogResult,
|
EditChatRoomDialogResult,
|
||||||
EditChatRoomDialogData
|
EditChatRoomDialogData
|
||||||
} from '../dialogs/chat/edit-chat-room.dialog.component';
|
} from '../dialogs/chat/edit-chat-room.dialog.component';
|
||||||
|
import { SelectGroupDialogComponent, SelectGroupDialogResult, SelectGroupDialogData } from '../dialogs/group/select-group.dialog.component';
|
||||||
|
import { GroupDetailData } from '@ucap-webmessenger/protocol-sync';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-layout-messenger-messages',
|
selector: 'app-layout-messenger-messages',
|
||||||
@ -838,6 +841,40 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'ADD_GROUP':
|
||||||
|
{
|
||||||
|
const result = await this.dialogService.open<
|
||||||
|
SelectGroupDialogComponent,
|
||||||
|
SelectGroupDialogData,
|
||||||
|
SelectGroupDialogResult
|
||||||
|
>(SelectGroupDialogComponent, {
|
||||||
|
width: '600px',
|
||||||
|
data: {
|
||||||
|
title: 'Group Select'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!!result && !!result.choice && result.choice) {
|
||||||
|
if (!!result.group) {
|
||||||
|
const oldGroup: GroupDetailData = result.group;
|
||||||
|
const trgtUserSeq: number[] = [];
|
||||||
|
result.group.userSeqs.map(seq => trgtUserSeq.push(seq));
|
||||||
|
this.userInfoList
|
||||||
|
.filter(v => result.group.userSeqs.indexOf(v.seq) < 0)
|
||||||
|
.forEach(user => {
|
||||||
|
trgtUserSeq.push(user.seq);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.store.dispatch(
|
||||||
|
SyncStore.updateGroupMember({
|
||||||
|
oldGroup,
|
||||||
|
trgtUserSeq
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'EDIT_ROOM':
|
case 'EDIT_ROOM':
|
||||||
{
|
{
|
||||||
const result = await this.dialogService.open<
|
const result = await this.dialogService.open<
|
||||||
|
Loading…
x
Reference in New Issue
Block a user