타이머 대화방 사용유무, MASSTEXT 길이, 대화방 참여인원제한 > 환경설정으로 구성.

This commit is contained in:
leejinho 2019-12-19 15:29:18 +09:00
parent 79336bffb4
commit 568c0be6a5
9 changed files with 157 additions and 97 deletions

View File

@ -50,6 +50,7 @@ import {
KEY_LOGIN_RES_INFO KEY_LOGIN_RES_INFO
} from '@app/types'; } from '@app/types';
import { MessageBoxComponent } from './left-sidenav/message.component'; import { MessageBoxComponent } from './left-sidenav/message.component';
import { environment } from '../../../../environments/environment';
export enum MainMenu { export enum MainMenu {
Group = 'GROUP', Group = 'GROUP',
@ -301,17 +302,20 @@ export class LeftSideComponent implements OnInit, OnDestroy {
{ {
this.fabButtonShow = true; this.fabButtonShow = true;
this.fabButtons = [ this.fabButtons = [
{
icon: 'timer',
tooltip: 'New Timer Chat',
divisionType: 'CHAT_NEW_TIMER_ADD'
},
{ {
icon: 'chat', icon: 'chat',
tooltip: 'New Chat', tooltip: 'New Chat',
divisionType: 'CAHT_NEW_ADD' divisionType: 'CAHT_NEW_ADD'
} }
]; ];
if (environment.productConfig.CommonSetting.useTimerRoom) {
this.fabButtons.push({
icon: 'timer',
tooltip: 'New Timer Chat',
divisionType: 'CHAT_NEW_TIMER_ADD'
});
}
} }
break; break;
case MainMenu.Organization: case MainMenu.Organization:
@ -417,8 +421,10 @@ export class LeftSideComponent implements OnInit, OnDestroy {
break; break;
case 'CHAT_NEW_TIMER_ADD': case 'CHAT_NEW_TIMER_ADD':
{ {
if (environment.productConfig.CommonSetting.useTimerRoom) {
this.onClickNewChat('TIMER'); this.onClickNewChat('TIMER');
} }
}
break; break;
case 'MESSAGE_NEW': case 'MESSAGE_NEW':

View File

@ -97,6 +97,7 @@ import {
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 { environment } from '../../../../environments/environment';
@Component({ @Component({
selector: 'app-layout-messenger-messages', selector: 'app-layout-messenger-messages',
@ -567,7 +568,11 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
if (!!this.selectedSticker) { if (!!this.selectedSticker) {
// Send Sticker // Send Sticker
if (!!message && message.trim().length > CONST.MASSTEXT_LEN) { if (
!!message &&
message.trim().length >
environment.productConfig.CommonSetting.masstextLength
) {
const result = await this.dialogService.open< const result = await this.dialogService.open<
AlertDialogComponent, AlertDialogComponent,
AlertDialogData, AlertDialogData,
@ -576,7 +581,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
width: '360px', width: '360px',
data: { data: {
title: 'Alert', title: 'Alert',
message: `스티커를 포함할 경우 ${CONST.MASSTEXT_LEN}자 이상 보낼 수 없습니다.` message: `스티커를 포함할 경우 ${environment.productConfig.CommonSetting.masstextLength}자 이상 보낼 수 없습니다.`
} }
}); });
return; return;
@ -599,7 +604,10 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
); );
this.isShowStickerSelector = false; this.isShowStickerSelector = false;
this.setStickerHistory(this.selectedSticker); this.setStickerHistory(this.selectedSticker);
} else if (message.trim().length > CONST.MASSTEXT_LEN) { } else if (
message.trim().length >
environment.productConfig.CommonSetting.masstextLength
) {
// MASS TEXT // MASS TEXT
this.store.dispatch( this.store.dispatch(
EventStore.sendMass({ EventStore.sendMass({

View File

@ -15,6 +15,7 @@ import {
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { Dictionary } from '@ngrx/entity'; import { Dictionary } from '@ngrx/entity';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
import { environment } from '../../../../environments/environment';
import { import {
buddy2, buddy2,
@ -105,6 +106,12 @@ import {
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 { CONST } from '@ucap-webmessenger/core'; import { CONST } from '@ucap-webmessenger/core';
import {
AlertDialogComponent,
AlertDialogResult,
DialogService,
AlertDialogData
} from '@ucap-webmessenger/ui';
@Injectable() @Injectable()
export class Effects { export class Effects {
@ -327,8 +334,9 @@ export class Effects {
) )
) )
), ),
tap(([action, loginRes, roomInfos, roomUsers, roomUserShorts]) => { tap(
const userSeqList = [...action.userSeqList, loginRes.userSeq]; async ([action, loginRes, roomInfos, roomUsers, roomUserShorts]) => {
const userSeqList = [...action.userSeqList];
let roomSeq = null; let roomSeq = null;
for (const key in roomUsers) { for (const key in roomUsers) {
@ -389,6 +397,9 @@ export class Effects {
} }
} }
// 내 정보를 추가하여 방생성.
userSeqList.push(loginRes.userSeq);
this.logger.debug( this.logger.debug(
'openRoom', 'openRoom',
'userSeqList', 'userSeqList',
@ -401,6 +412,23 @@ export class Effects {
return; return;
} }
if (
environment.productConfig.CommonSetting.maxChatRoomUser <
userSeqList.length
) {
await this.dialogService.open<
AlertDialogComponent,
AlertDialogData,
AlertDialogResult
>(AlertDialogComponent, {
data: {
title: '',
html: `${environment.productConfig.CommonSetting.maxChatRoomUser}명 이상 대화할 수 없습니다.`
}
});
return;
}
if (!!action.isTimeRoom && action.isTimeRoom) { if (!!action.isTimeRoom && action.isTimeRoom) {
// 타이머 방 // 타이머 방
this.store.dispatch( this.store.dispatch(
@ -422,7 +450,8 @@ export class Effects {
}) })
); );
} }
}) }
)
), ),
{ dispatch: false } { dispatch: false }
); );
@ -1010,6 +1039,7 @@ export class Effects {
private groupProtocolService: GroupProtocolService, private groupProtocolService: GroupProtocolService,
private buddyProtocolService: BuddyProtocolService, private buddyProtocolService: BuddyProtocolService,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private dialogService: DialogService,
private logger: NGXLogger private logger: NGXLogger
) {} ) {}
} }

View File

@ -52,7 +52,11 @@ export const environment: Environment = {
} }
}, },
CommonSetting: { CommonSetting: {
editableProfileImage: false editableProfileImage: false,
useTimerRoom: false,
maxChatRoomUser: 300,
masstextLength: 800
} }
}, },

View File

@ -52,7 +52,11 @@ export const environment: Environment = {
} }
}, },
CommonSetting: { CommonSetting: {
editableProfileImage: false editableProfileImage: false,
useTimerRoom: false,
maxChatRoomUser: 300,
masstextLength: 800
} }
}, },

View File

@ -52,7 +52,11 @@ export const environment: Environment = {
} }
}, },
CommonSetting: { CommonSetting: {
editableProfileImage: true editableProfileImage: true,
useTimerRoom: true,
maxChatRoomUser: 300,
masstextLength: 800
} }
}, },

View File

@ -52,7 +52,11 @@ export const environment: Environment = {
} }
}, },
CommonSetting: { CommonSetting: {
editableProfileImage: true editableProfileImage: true,
useTimerRoom: true,
maxChatRoomUser: 300,
masstextLength: 800
} }
}, },

View File

@ -65,6 +65,10 @@ export interface Environment {
CommonSetting: { CommonSetting: {
editableProfileImage: boolean; editableProfileImage: boolean;
useTimerRoom: boolean;
maxChatRoomUser: number;
masstextLength: number;
}; };
}; };

View File

@ -1,12 +1,8 @@
export enum CONST { export enum CONST {
/** 대용량 텍스트로 보내는 문자열의 길이 기준 */
MASSTEXT_LEN = 800,
/** 대화방의 이벤트를 조회하는 갯수 */ /** 대화방의 이벤트를 조회하는 갯수 */
EVENT_INFO_READ_COUNT = 50, EVENT_INFO_READ_COUNT = 50,
/** Timer Room 최초 오픈시 timer interval */ /** Timer Room 최초 오픈시 timer interval */
DEFAULT_TIMER_ROOM_INTERVAL = 24 * 60 * 60, DEFAULT_TIMER_ROOM_INTERVAL = 24 * 60 * 60,
/** 한번에 채팅을 할 수 있는 인원수 제한 */
CHATROOM_USER = 300,
/** 여기까지 읽음을 표시할때 조회할 최소 이벤트 갯수 */ /** 여기까지 읽음을 표시할때 조회할 최소 이벤트 갯수 */
READ_HERE_MIN_EVENT_INFO_READ_COUNT = 10, READ_HERE_MIN_EVENT_INFO_READ_COUNT = 10,