대화상대추가 팝업연결

This commit is contained in:
leejh 2019-11-01 15:53:54 +09:00
parent bf9bcd967b
commit 89a1f90065
7 changed files with 76 additions and 21 deletions

View File

@ -46,15 +46,15 @@ export class LeftSideComponent implements OnInit {
select(AppStore.MessengerSelector.SyncSelector.selectChatUnreadCount)
);
this.fabButtons = [
{
icon: 'timer',
tooltip: 'New Timer Chat',
divisionType: 'NEW_TIMER_CHAT'
},
{
icon: 'chat',
tooltip: 'New Chat',
divisionType: 'NEW_CHAT'
},
{
icon: 'textsms',
tooltip: 'New Timer Chat',
divisionType: 'NEW_TIMER_CHAT'
}
];
}
@ -66,7 +66,6 @@ export class LeftSideComponent implements OnInit {
CreateChatDialogResult
>(CreateChatDialogComponent, {
width: '600px',
height: '500px',
data: {
type: UserSelectDialogType.NewChat,
title: type === 'TIMER' ? 'New Timer Chat' : 'New Chat'

View File

@ -389,7 +389,6 @@ export class GroupComponent implements OnInit, OnDestroy {
CreateChatDialogResult
>(CreateChatDialogComponent, {
width: '600px',
data: {
type: UserSelectDialogType.EditMember,
title: 'Group Member Edit',

View File

@ -17,7 +17,8 @@
mat-icon-button
aria-label="chats button"
class="responsive-chats-button"
*ngIf="!!roomInfo && roomInfo.isTimeRoom">
*ngIf="!!roomInfo && roomInfo.isTimeRoom"
>
<mat-icon>timer</mat-icon>
</button>
</div>
@ -26,15 +27,16 @@
{{ getRoomName() }}
</h3>
<!-- Timer Room Info -->
<div *ngIf="roomInfo && roomInfo.isTimeRoom" class="room-type text-accent-color ">
<span class="bg-accent-light">{{ getConvertTimer(roomInfo.timeRoomInterval) }} </span>비밀 대화방입니다.
<div
*ngIf="roomInfo && roomInfo.isTimeRoom"
class="room-type text-accent-color "
>
<span class="bg-accent-light"
>{{ getConvertTimer(roomInfo.timeRoomInterval) }} </span
>비밀 대화방입니다.
</div>
<!-- Timer Room Info -->
</div>
<!--<div *ngIf="!!roomInfo && roomInfo.isTimeRoom">
<mat-icon>timer</mat-icon>
{{ getConvertTimer(roomInfo.timeRoomInterval) }}
</div>-->
<div class="room-option">
<button
*ngIf="!!roomInfo"
@ -59,6 +61,9 @@
</button>
<mat-menu #contactMenu="matMenu" [hasBackdrop]="false">
<button mat-menu-item (click)="onClickContextMenu('ADD_MEMBER')">
대화상대추가
</button>
<button mat-menu-item (click)="onClickContextMenu('CLOSE_ROOM')">
방닫기
</button>
@ -82,8 +87,6 @@
(fileDragOver)="onFileDragOver()"
(fileDragLeave)="onFileDragLeave()"
>
<!-- CHAT MESSAGES -->
<perfect-scrollbar
fxFlex="1 1 auto"

View File

@ -432,7 +432,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
CreateChatDialogResult
>(CreateChatDialogComponent, {
width: '600px',
height: '500px',
data: {
type: UserSelectDialogType.MessageForward,
title: 'MessageForward',
@ -542,8 +541,58 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
}
}
onClickContextMenu(menuType: string) {
async onClickContextMenu(menuType: string) {
switch (menuType) {
case 'ADD_MEMBER':
{
console.log(this.roomInfo);
console.log(this.userInfoList);
const result = await this.dialogService.open<
CreateChatDialogComponent,
CreateChatDialogData,
CreateChatDialogResult
>(CreateChatDialogComponent, {
width: '600px',
data: {
type: UserSelectDialogType.EditChatMember,
title: 'Edit Chat Member'
// ,
// curRoomUser: this.userInfoList
}
});
if (!!result && !!result.choice && result.choice) {
const userSeqs: number[] = [];
let roomSeq = '';
if (
!!result.selectedUserList &&
result.selectedUserList.length > 0
) {
result.selectedUserList.map(user => userSeqs.push(user.seq));
}
if (!!result.selectedRoom) {
roomSeq = result.selectedRoom.roomSeq;
}
if (userSeqs.length > 0 || roomSeq.trim().length > 0) {
// this.store.dispatch(
// EventStore.forward({
// senderSeq: this.loginRes.userSeq,
// req: {
// roomSeq: '-999',
// eventType: message.type,
// sentMessage: message.sentMessage
// },
// trgtUserSeqs: userSeqs,
// trgtRoomSeq: roomSeq
// })
// );
}
}
}
break;
case 'CLOSE_ROOM':
{
this.store.dispatch(ChatStore.clearSelectedRoom());

View File

@ -56,6 +56,8 @@ export interface CreateChatDialogData {
group?: GroupDetailData;
/** CASE :: EventForward */
ignoreRoom?: RoomInfo[];
/** CASE :: EditCharMember */
curRoomUser?: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[];
}
export interface CreateChatDialogResult {

View File

@ -18,7 +18,8 @@ import {
map,
catchError,
exhaustMap,
withLatestFrom
withLatestFrom,
concatMap
} from 'rxjs/operators';
import {
InfoData,
@ -256,7 +257,7 @@ export class Effects {
send$ = createEffect(() =>
this.actions$.pipe(
ofType(send),
exhaustMap(action =>
concatMap(action =>
this.eventProtocolService.send(action.req).pipe(
map((res: SendResponse) => {
return sendSuccess({

View File

@ -6,5 +6,7 @@ export enum UserSelectDialogType {
/** 대화 전달 */
MessageForward = 'MESSAGE_FORWARD',
/** 그룹멤버 변경 */
EditMember = 'EDIT_MEMBER'
EditMember = 'EDIT_MEMBER',
/** 대화상대 추가 */
EditChatMember = 'EDIT_CHAT_MEMBER'
}