diff --git a/projects/ucap-webmessenger-api-message/src/public-api.ts b/projects/ucap-webmessenger-api-message/src/public-api.ts index ac110c3d..bf19e2c9 100644 --- a/projects/ucap-webmessenger-api-message/src/public-api.ts +++ b/projects/ucap-webmessenger-api-message/src/public-api.ts @@ -5,9 +5,11 @@ export * from './lib/apis/del'; export * from './lib/apis/detail'; export * from './lib/apis/edit-reservation-ex'; export * from './lib/apis/my-message'; +export * from './lib/apis/notice'; export * from './lib/apis/retrieve'; export * from './lib/apis/send-copy'; export * from './lib/apis/send'; +export * from './lib/apis/unread-count'; export * from './lib/services/message-api.service'; diff --git a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts index e602a493..26e991a0 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts @@ -98,33 +98,33 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy { .saveFile(buffer, this.fileInfo.fileName, mimeType) .then(result => { if (!!result) { - this.translateService - .get('common.file.results.savedToPath', { - path: result - }) - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v, '', { - duration: 3000, - verticalPosition: 'bottom' - }); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.results.savedToPath', + { + path: result + } + ), + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); } else { - this.translateService - .get('common.file.errors.failToSave') - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSave' + ) + ); } }) .catch(reason => { - this.translateService - .get('common.file.errors.failToSave') - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSave' + ) + ); }); }) .catch(reason => { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts index b890aebd..baa3eecc 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts @@ -166,78 +166,68 @@ export class LeftSideComponent implements OnInit, OnDestroy { this.logger.debug('-----------------------LeftSideComponent ngOnDestroy'); } - onClickNewChat(type: string = 'NORMAL') { - this.translateService - .get(['chat.newTimerChat', 'chat.newChat']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - CreateChatDialogComponent, - CreateChatDialogData, - CreateChatDialogResult - >(CreateChatDialogComponent, { - width: '600px', - data: { - type: UserSelectDialogType.NewChat, - title: - type === 'TIMER' ? vs['chat.newTimerChat'] : vs['chat.newChat'] - } - }); + async onClickNewChat(type: string = 'NORMAL') { + const result = await this.dialogService.open< + CreateChatDialogComponent, + CreateChatDialogData, + CreateChatDialogResult + >(CreateChatDialogComponent, { + width: '600px', + data: { + type: UserSelectDialogType.NewChat, + title: + type === 'TIMER' + ? this.translateService.instant('chat.newTimerChat') + : this.translateService.instant('chat.newChat') + } + }); - if (!!result && !!result.choice && result.choice) { - if (!!result.selectedUserList && result.selectedUserList.length > 0) { - const userSeqs: number[] = []; - result.selectedUserList.map(user => userSeqs.push(user.seq)); + if (!!result && !!result.choice && result.choice) { + if (!!result.selectedUserList && result.selectedUserList.length > 0) { + const userSeqs: number[] = []; + result.selectedUserList.map(user => userSeqs.push(user.seq)); - if (type === 'NORMAL') { - this.store.dispatch( - ChatStore.openRoom({ userSeqList: userSeqs }) - ); - } else if (type === 'TIMER') { - this.store.dispatch( - ChatStore.openRoom({ userSeqList: userSeqs, isTimeRoom: true }) - ); - } - } + if (type === 'NORMAL') { + this.store.dispatch(ChatStore.openRoom({ userSeqList: userSeqs })); + } else if (type === 'TIMER') { + this.store.dispatch( + ChatStore.openRoom({ userSeqList: userSeqs, isTimeRoom: true }) + ); } - }); + } + } } - onClickNewGroupAndMember() { - this.translateService - .get(['group.addNew']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - CreateChatDialogComponent, - CreateChatDialogData, - CreateChatDialogResult - >(CreateChatDialogComponent, { - width: '600px', - data: { - type: UserSelectDialogType.NewGroup, - title: vs['group.addNew'] - } - }); + async onClickNewGroupAndMember() { + const result = await this.dialogService.open< + CreateChatDialogComponent, + CreateChatDialogData, + CreateChatDialogResult + >(CreateChatDialogComponent, { + width: '600px', + data: { + type: UserSelectDialogType.NewGroup, + title: this.translateService.instant('group.addNew') + } + }); - if (!!result && !!result.choice && result.choice) { - if ( - !!result.selectedUserList && - // result.selectedUserList.length > 0 && - result.groupName.trim().length > 0 - ) { - const userSeqs: number[] = []; - result.selectedUserList.map(user => userSeqs.push(user.seq)); + if (!!result && !!result.choice && result.choice) { + if ( + !!result.selectedUserList && + // result.selectedUserList.length > 0 && + result.groupName.trim().length > 0 + ) { + const userSeqs: number[] = []; + result.selectedUserList.map(user => userSeqs.push(user.seq)); - this.store.dispatch( - SyncStore.createGroupAndBuddy({ - groupName: result.groupName, - trgtUserSeq: userSeqs - }) - ); - } - } - }); + this.store.dispatch( + SyncStore.createGroupAndBuddy({ + groupName: result.groupName, + trgtUserSeq: userSeqs + }) + ); + } + } } async onClickNewMessage() { @@ -306,76 +296,66 @@ export class LeftSideComponent implements OnInit, OnDestroy { } setFabInitial(type: string) { - this.translateService - .get([ - 'group.addNew', - 'chat.newChat', - 'chat.newTimerChat', - 'message.newMessage' - ]) - .pipe(take(1)) - .subscribe(async vs => { - switch (type) { - case MainMenu.Group: + switch (type) { + case MainMenu.Group: + { + this.fabButtonShow = true; + this.fabButtons = [ { - this.fabButtonShow = true; - this.fabButtons = [ - { - icon: 'add', - tooltip: vs['group.addNew'], - divisionType: 'GROUP_NEW_ADD' - } - ]; + icon: 'add', + tooltip: this.translateService.instant('group.addNew'), + divisionType: 'GROUP_NEW_ADD' } - break; - case MainMenu.Chat: + ]; + } + break; + case MainMenu.Chat: + { + this.fabButtonShow = true; + this.fabButtons = [ { - this.fabButtonShow = true; - this.fabButtons = [ - { - icon: 'chat', - tooltip: vs['chat.newChat'], - divisionType: 'CAHT_NEW_ADD' - } - ]; + icon: 'chat', + tooltip: this.translateService.instant('chat.newChat'), + divisionType: 'CAHT_NEW_ADD' + } + ]; - if (environment.productConfig.CommonSetting.useTimerRoom) { - this.fabButtons.push({ - icon: 'timer', - tooltip: vs['chat.newTimerChat'], - divisionType: 'CHAT_NEW_TIMER_ADD' - }); - } - } - break; - case MainMenu.Organization: - { - this.fabButtonShow = false; - } - break; - case MainMenu.Message: - { - this.fabButtonShow = true; - this.fabButtons = [ - { - icon: 'add', - tooltip: vs['message.newMessage'], - divisionType: 'MESSAGE_NEW' - } - ]; - } - break; - case MainMenu.Call: - { - this.fabButtonShow = false; - } - break; - - default: { - this.fabButtonShow = false; + if (environment.productConfig.CommonSetting.useTimerRoom) { + this.fabButtons.push({ + icon: 'timer', + tooltip: this.translateService.instant('chat.newTimerChat'), + divisionType: 'CHAT_NEW_TIMER_ADD' + }); } } - }); + break; + case MainMenu.Organization: + { + this.fabButtonShow = false; + } + break; + case MainMenu.Message: + { + this.fabButtonShow = true; + this.fabButtons = [ + { + icon: 'add', + tooltip: this.translateService.instant('message.new'), + divisionType: 'MESSAGE_NEW' + } + ]; + } + break; + case MainMenu.Call: + { + this.fabButtonShow = false; + } + break; + + default: { + this.fabButtonShow = false; + } + } } onCheckAllUser(params: { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts index 4df5e291..5a42c843 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts @@ -245,7 +245,7 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked { this.chatContextMenuTrigger.openMenu(); } - onClickContextMenu(type: string, roomInfo: RoomInfo) { + async onClickContextMenu(type: string, roomInfo: RoomInfo) { switch (type) { case 'SELECT_ROOM': this.store.dispatch( @@ -257,27 +257,20 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked { break; case 'EXIT_ROOM': { - this.translateService - .get(['chat.exitFromRoom', 'chat.confirmExitFromRoom']) - .pipe(take(1)) - .subscribe(async values => { - const result = await this.dialogService.open< - ConfirmDialogComponent, - ConfirmDialogData, - ConfirmDialogResult - >(ConfirmDialogComponent, { - data: { - title: values['chat.exitFromRoom'], - html: values['chat.confirmExitFromRoom'] - } - }); + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + data: { + title: this.translateService.instant('chat.exitFromRoom'), + html: this.translateService.instant('chat.confirmExitFromRoom') + } + }); - if (!!result && !!result.choice && result.choice) { - this.store.dispatch( - RoomStore.exit({ roomSeq: roomInfo.roomSeq }) - ); - } - }); + if (!!result && !!result.choice && result.choice) { + this.store.dispatch(RoomStore.exit({ roomSeq: roomInfo.roomSeq })); + } } break; } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html index 762944e2..5bb622e9 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html @@ -56,7 +56,7 @@ {{ 'common.searchResult' | translate }}({{ searchUserInfos.length - }}{{ 'common.howManyPersons' | translate }}) ({{ searchUserInfos.length }} - {{ 'common.howManyPersons' | translate }}) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index 216835ff..02a00594 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -615,28 +615,24 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { } /** Send Event */ - onSendMessage(message: string) { + async onSendMessage(message: string) { this.setEventMoreInit(); if (!this.selectedSticker) { if (!message || message.trim().length === 0) { - this.translateService - .get(['chat.errors.label', 'chat.errors.inputChatMessage']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - AlertDialogComponent, - AlertDialogData, - AlertDialogResult - >(AlertDialogComponent, { - width: '360px', - data: { - title: vs['chat.errors.label'], - message: vs['chat.errors.inputChatMessage'] - } - }); - }); - + const result = await this.dialogService.open< + AlertDialogComponent, + AlertDialogData, + AlertDialogResult + >(AlertDialogComponent, { + width: '360px', + data: { + title: this.translateService.instant('chat.errors.label'), + message: this.translateService.instant( + 'chat.errors.inputChatMessage' + ) + } + }); return; } } @@ -738,24 +734,23 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { message.trim().length > environment.productConfig.CommonSetting.masstextLength ) { - this.translateService - .get(['chat.errors.label', 'chat.errors.maxLengthOfMassText'], { - maxLength: environment.productConfig.CommonSetting.masstextLength - }) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - AlertDialogComponent, - AlertDialogData, - AlertDialogResult - >(AlertDialogComponent, { - width: '360px', - data: { - title: vs['chat.errors.label'], - message: vs['chat.errors.maxLengthOfMassText'] + const result = await this.dialogService.open< + AlertDialogComponent, + AlertDialogData, + AlertDialogResult + >(AlertDialogComponent, { + width: '360px', + data: { + title: this.translateService.instant('chat.errors.label'), + message: this.translateService.instant( + 'chat.errors.maxLengthOfMassText', + { + maxLength: + environment.productConfig.CommonSetting.masstextLength } - }); - }); + ) + } + }); return; } @@ -871,31 +866,27 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { }) { this.logger.debug('fileSave', value); if (value.type === 'saveAs') { - this.translateService - .get([ - 'common.file.errors.label', - 'common.file.errors.failToSpecifyPath' - ]) - .pipe(take(1)) - .subscribe(vs => { - this.nativeService - .selectSaveFilePath(value.fileInfo.fileName) - .then(result => { - if (!!result && result.length > 0) { - this.saveFile(value, result); - } else { - this.snackBarService.open( - vs['common.file.errors.failToSpecifyPath'], - vs['common.file.errors.label'] - ); - } - }) - .catch(reason => { - this.snackBarService.open( - vs['common.file.errors.failToSpecifyPath'], - vs['common.file.errors.label'] - ); - }); + this.nativeService + .selectSaveFilePath(value.fileInfo.fileName) + .then(result => { + if (!!result && result.length > 0) { + this.saveFile(value, result); + } else { + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSpecifyPath' + ), + this.translateService.instant('common.file.errors.label') + ); + } + }) + .catch(reason => { + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSpecifyPath' + ), + this.translateService.instant('common.file.errors.label') + ); }); } else { this.saveFile(value); @@ -945,33 +936,33 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { .saveFile(buffer, value.fileInfo.fileName, mimeType, savePath) .then(result => { if (!!result) { - this.translateService - .get('common.file.results.savedToPath', { - path: result - }) - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v, '', { - duration: 3000, - verticalPosition: 'bottom' - }); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.results.savedToPath', + { + path: result + } + ), + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); } else { - this.translateService - .get('common.file.errors.failToSave') - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSave' + ) + ); } }) .catch(reason => { - this.translateService - .get('common.file.errors.failToSave') - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSave' + ) + ); }); }) .catch(reason => { @@ -1069,19 +1060,10 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { }, error => { this.logger.debug('onFileSelected error', error); - - this.translateService - .get([ - 'common.file.errors.label', - 'common.file.errors.failToUpload' - ]) - .pipe(take(1)) - .subscribe(vs => { - this.snackBarService.open( - vs['common.file.errors.failToUpload'], - vs['common.file.errors.label'] - ); - }); + this.snackBarService.open( + this.translateService.instant('common.file.errors.failToUpload'), + this.translateService.instant('common.file.errors.label') + ); }, () => { this.fileUploadQueue.onUploadComplete(); @@ -1106,7 +1088,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { this.messageContextMenuTrigger.openMenu(); } - onClickMessageContextMenu(menuType: string, message: Info) { + async onClickMessageContextMenu(menuType: string, message: Info) { switch (menuType) { case 'COPY': { @@ -1118,20 +1100,17 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { (message as Info).sentMessage ) ) { - this.translateService - .get(['common.clipboard.results.copied']) - .pipe(take(1)) - .subscribe(async vs => { - this.snackBarService.open( - vs['common.clipboard.results.copied'], - '', - { - duration: 3000, - verticalPosition: 'top', - horizontalPosition: 'center' - } - ); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.clipboard.results.copied' + ), + '', + { + duration: 3000, + verticalPosition: 'top', + horizontalPosition: 'center' + } + ); } } break; @@ -1147,20 +1126,17 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { .pipe(take(1)) .subscribe(res => { if (this.clipboardService.copyFromContent(res.content)) { - this.translateService - .get(['common.clipboard.results.copied']) - .pipe(take(1)) - .subscribe(async vs => { - this.snackBarService.open( - vs['common.clipboard.results.copied'], - '', - { - duration: 3000, - verticalPosition: 'top', - horizontalPosition: 'center' - } - ); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.clipboard.results.copied' + ), + '', + { + duration: 3000, + verticalPosition: 'top', + horizontalPosition: 'center' + } + ); } }); } @@ -1173,53 +1149,48 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { break; case 'REPLAY': { - this.translateService - .get(['chat.forwardEventTo']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - CreateChatDialogComponent, - CreateChatDialogData, - CreateChatDialogResult - >(CreateChatDialogComponent, { - width: '600px', - data: { - type: UserSelectDialogType.MessageForward, - title: vs['chat.forwardEventTo'], - ignoreRoom: [this.roomInfo] - } - }); + const result = await this.dialogService.open< + CreateChatDialogComponent, + CreateChatDialogData, + CreateChatDialogResult + >(CreateChatDialogComponent, { + width: '600px', + data: { + type: UserSelectDialogType.MessageForward, + title: this.translateService.instant('chat.forwardEventTo'), + ignoreRoom: [this.roomInfo] + } + }); - 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 && !!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 (!!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 - }) - ); - } - } - }); + 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 'REPLAY_TO_ME': @@ -1241,61 +1212,51 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { break; case 'DELETE': { - this.translateService - .get(['chat.removeEvent', 'chat.confirmRemoveEvent']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - ConfirmDialogComponent, - ConfirmDialogData, - ConfirmDialogResult - >(ConfirmDialogComponent, { - width: '400px', - data: { - title: vs['chat.removeEvent'], - html: vs['chat.confirmRemoveEvent'] - } - }); + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + width: '400px', + data: { + title: this.translateService.instant('chat.removeEvent'), + html: this.translateService.instant('chat.confirmRemoveEvent') + } + }); - if (!!result && !!result.choice && result.choice) { - this.store.dispatch( - EventStore.del({ - roomSeq: this.roomInfo.roomSeq, - eventSeq: message.seq - }) - ); - } - }); + if (!!result && !!result.choice && result.choice) { + this.store.dispatch( + EventStore.del({ + roomSeq: this.roomInfo.roomSeq, + eventSeq: message.seq + }) + ); + } } break; case 'RECALL': { - this.translateService - .get(['chat.recallEvent', 'chat.confirmRecallEvent']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - ConfirmDialogComponent, - ConfirmDialogData, - ConfirmDialogResult - >(ConfirmDialogComponent, { - width: '400px', - data: { - title: vs['chat.recallEvent'], - html: vs['chat.confirmRecallEvent'] - } - }); + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + width: '400px', + data: { + title: this.translateService.instant('chat.recallEvent'), + html: this.translateService.instant('chat.confirmRecallEvent') + } + }); - if (!!result && !!result.choice && result.choice) { - this.store.dispatch( - EventStore.cancel({ - roomSeq: this.roomInfo.roomSeq, - eventSeq: message.seq, - deviceType: this.environmentsInfo.deviceType - }) - ); - } - }); + if (!!result && !!result.choice && result.choice) { + this.store.dispatch( + EventStore.cancel({ + roomSeq: this.roomInfo.roomSeq, + eventSeq: message.seq, + deviceType: this.environmentsInfo.deviceType + }) + ); + } } break; default: @@ -1303,7 +1264,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { } } - onClickContextMenu(menuType: string) { + async onClickContextMenu(menuType: string) { switch (menuType) { case 'OPEN_ALBUM_LIST': { @@ -1339,153 +1300,134 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { break; case 'ADD_MEMBER': { - this.translateService - .get(['chat.modifyRoomMember']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - CreateChatDialogComponent, - CreateChatDialogData, - CreateChatDialogResult - >(CreateChatDialogComponent, { - width: '600px', - data: { - type: UserSelectDialogType.EditChatMember, - title: vs['chat.modifyRoomMember'], - curRoomUser: this.userInfoList.filter( - user => - user.seq !== this.loginRes.userSeq && user.isJoinRoom - ) - } - }); + const result = await this.dialogService.open< + CreateChatDialogComponent, + CreateChatDialogData, + CreateChatDialogResult + >(CreateChatDialogComponent, { + width: '600px', + data: { + type: UserSelectDialogType.EditChatMember, + title: this.translateService.instant('chat.modifyRoomMember'), + curRoomUser: this.userInfoList.filter( + user => user.seq !== this.loginRes.userSeq && user.isJoinRoom + ) + } + }); - if (!!result && !!result.choice && result.choice) { - const userSeqs: number[] = this.userInfoList.map(userInfo => { - if (userInfo.isJoinRoom) { - return userInfo.seq; - } - }); - if ( - !!result.selectedUserList && - result.selectedUserList.length > 0 - ) { - result.selectedUserList.forEach(user => { - if (userSeqs.indexOf(user.seq) < 0) { - userSeqs.push(user.seq); - } - }); - } - - if (userSeqs.length > 0) { - // include me - userSeqs.push(this.loginRes.userSeq); - - this.store.dispatch( - RoomStore.inviteOrOpen({ - req: { - divCd: 'Invite', - userSeqs - } - }) - ); - } + if (!!result && !!result.choice && result.choice) { + const userSeqs: number[] = this.userInfoList.map(userInfo => { + if (userInfo.isJoinRoom) { + return userInfo.seq; } }); + if ( + !!result.selectedUserList && + result.selectedUserList.length > 0 + ) { + result.selectedUserList.forEach(user => { + if (userSeqs.indexOf(user.seq) < 0) { + userSeqs.push(user.seq); + } + }); + } + + if (userSeqs.length > 0) { + // include me + userSeqs.push(this.loginRes.userSeq); + + this.store.dispatch( + RoomStore.inviteOrOpen({ + req: { + divCd: 'Invite', + userSeqs + } + }) + ); + } + } } break; case 'ADD_GROUP': { - this.translateService - .get(['chat.addMemberToGroup']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - SelectGroupDialogComponent, - SelectGroupDialogData, - SelectGroupDialogResult - >(SelectGroupDialogComponent, { - width: '600px', - data: { - title: vs['chat.addMemberToGroup'] - } - }); + const result = await this.dialogService.open< + SelectGroupDialogComponent, + SelectGroupDialogData, + SelectGroupDialogResult + >(SelectGroupDialogComponent, { + width: '600px', + data: { + title: this.translateService.instant('chat.addMemberToGroup') + } + }); - 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); - }); + 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 - }) - ); - } - } - }); + this.store.dispatch( + SyncStore.updateGroupMember({ + oldGroup, + trgtUserSeq + }) + ); + } + } } break; case 'EDIT_ROOM': { - this.translateService - .get(['chat.settingsOfRoom']) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - EditChatRoomDialogComponent, - EditChatRoomDialogData, - EditChatRoomDialogResult - >(EditChatRoomDialogComponent, { - width: '600px', - data: { - title: vs['chat.settingsOfRoom'], - roomInfo: this.roomInfo + const result = await this.dialogService.open< + EditChatRoomDialogComponent, + EditChatRoomDialogData, + EditChatRoomDialogResult + >(EditChatRoomDialogComponent, { + width: '600px', + data: { + title: this.translateService.instant('chat.settingsOfRoom'), + roomInfo: this.roomInfo + } + }); + + if (!!result && !!result.choice && result.choice) { + const roomName: string = result.roomName; + const roomNameChangeTarget: string = result.roomNameChangeTarget; + const timeRoomInterval: number = result.timeRoomInterval; + const roomInfo: RoomInfo = result.roomInfo; + + // 방제목 업데이트. + this.store.dispatch( + RoomStore.update({ + req: { + roomSeq: roomInfo.roomSeq, + roomName, + receiveAlarm: roomInfo.receiveAlarm, + syncAll: + roomNameChangeTarget.toUpperCase() === 'ALL' ? true : false } - }); + }) + ); - if (!!result && !!result.choice && result.choice) { - const roomName: string = result.roomName; - const roomNameChangeTarget: string = - result.roomNameChangeTarget; - const timeRoomInterval: number = result.timeRoomInterval; - const roomInfo: RoomInfo = result.roomInfo; - - // 방제목 업데이트. - this.store.dispatch( - RoomStore.update({ - req: { - roomSeq: roomInfo.roomSeq, - roomName, - receiveAlarm: roomInfo.receiveAlarm, - syncAll: - roomNameChangeTarget.toUpperCase() === 'ALL' - ? true - : false - } - }) - ); - - if ( - roomInfo.isTimeRoom && - timeRoomInterval > 0 && - roomInfo.timeRoomInterval !== timeRoomInterval - ) { - this.store.dispatch( - RoomStore.updateTimeRoomInterval({ - roomSeq: roomInfo.roomSeq, - timerInterval: timeRoomInterval - }) - ); - } - } - }); + if ( + roomInfo.isTimeRoom && + timeRoomInterval > 0 && + roomInfo.timeRoomInterval !== timeRoomInterval + ) { + this.store.dispatch( + RoomStore.updateTimeRoomInterval({ + roomSeq: roomInfo.roomSeq, + timerInterval: timeRoomInterval + }) + ); + } + } } break; case 'CLOSE_ROOM': diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts index 4cb8cd26..d0d907b7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts @@ -232,33 +232,33 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { .saveFile(buffer, fileInfo.info.name, mimeType) .then(result => { if (!!result) { - this.translateService - .get('common.file.results.savedToPath', { - path: result - }) - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v, '', { - duration: 3000, - verticalPosition: 'bottom' - }); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.results.savedToPath', + { + path: result + } + ), + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); } else { - this.translateService - .get('common.file.errors.failToSave') - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSave' + ) + ); } }) .catch(reason => { - this.translateService - .get('common.file.errors.failToSave') - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSave' + ) + ); }); }) .catch(reason => { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts index 7dfb1cb9..6c2ec65a 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts @@ -276,33 +276,33 @@ export class FileBoxComponent implements OnInit, OnDestroy { .saveFile(buffer, fileInfo.info.name, mimeType) .then(result => { if (!!result) { - this.translateService - .get('common.file.results.savedToPath', { - path: result - }) - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v, '', { - duration: 3000, - verticalPosition: 'bottom' - }); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.results.savedToPath', + { + path: result + } + ), + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); } else { - this.translateService - .get('common.file.errors.failToSave') - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSave' + ) + ); } }) .catch(reason => { - this.translateService - .get('common.file.errors.failToSave') - .pipe(take(1)) - .subscribe(v => { - this.snackBarService.open(v); - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.failToSave' + ) + ); }); }) .catch(reason => { @@ -352,84 +352,74 @@ export class FileBoxComponent implements OnInit, OnDestroy { ); } - onClickForward(fileInfo: FileInfoTotal) { - this.translateService - .get('chat.forwardFileTo') - .pipe(take(1)) - .subscribe(async v => { - const result = await this.dialogService.open< - CreateChatDialogComponent, - CreateChatDialogData, - CreateChatDialogResult - >(CreateChatDialogComponent, { - width: '600px', - data: { - type: UserSelectDialogType.MessageForward, - title: v, - ignoreRoom: [this.roomInfo] - } - }); + async onClickForward(fileInfo: FileInfoTotal) { + const result = await this.dialogService.open< + CreateChatDialogComponent, + CreateChatDialogData, + CreateChatDialogResult + >(CreateChatDialogComponent, { + width: '600px', + data: { + type: UserSelectDialogType.MessageForward, + title: this.translateService.instant('chat.forwardFileTo'), + ignoreRoom: [this.roomInfo] + } + }); - 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 && !!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 (!!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: EventType.File, - sentMessage: fileInfo.info.sentMessage - }, - trgtUserSeqs: userSeqs, - trgtRoomSeq: roomSeq - }) - ); - } - } - }); + if (userSeqs.length > 0 || roomSeq.trim().length > 0) { + this.store.dispatch( + EventStore.forward({ + senderSeq: this.loginRes.userSeq, + req: { + roomSeq: '-999', + eventType: EventType.File, + sentMessage: fileInfo.info.sentMessage + }, + trgtUserSeqs: userSeqs, + trgtRoomSeq: roomSeq + }) + ); + } + } } - onClickDelete(fileInfo: FileInfoTotal) { - this.translateService - .get('chat.confirmDeleteFile') - .pipe(take(1)) - .subscribe(async v => { - const result = await this.dialogService.open< - ConfirmDialogComponent, - ConfirmDialogData, - ConfirmDialogResult - >(ConfirmDialogComponent, { - width: '400px', - data: { - title: 'Delete', - html: v - } - }); + async onClickDelete(fileInfo: FileInfoTotal) { + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + width: '400px', + data: { + title: 'Delete', + html: this.translateService.instant('chat.confirmDeleteFile') + } + }); - if (!!result && !!result.choice && result.choice) { - this.store.dispatch( - EventStore.del({ - roomSeq: this.roomInfo.roomSeq, - eventSeq: fileInfo.info.eventSeq - }) - ); + if (!!result && !!result.choice && result.choice) { + this.store.dispatch( + EventStore.del({ + roomSeq: this.roomInfo.roomSeq, + eventSeq: fileInfo.info.eventSeq + }) + ); - this.fileInfoTotal = this.fileInfoTotal.filter( - fInfo => fInfo.info.seq !== fileInfo.info.seq - ); - this.onSelectedIndexChange(this.currentTabIndex); - } - }); + this.fileInfoTotal = this.fileInfoTotal.filter( + fInfo => fInfo.info.seq !== fileInfo.info.seq + ); + this.onSelectedIndexChange(this.currentTabIndex); + } } get fileRetentionPeriodOptions(): DateOptions { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/notice.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/notice.component.ts index 80dacf0a..ff717726 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/notice.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/notice.component.ts @@ -13,8 +13,11 @@ import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { DialogService } from '@ucap-webmessenger/ui'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; -import { MessageApiService, NoticeList } from '@ucap-webmessenger/api-message'; -import { RetrieveNoticeRequest } from 'projects/ucap-webmessenger-api-message/src/lib/apis/notice'; +import { + MessageApiService, + NoticeList, + RetrieveNoticeRequest +} from '@ucap-webmessenger/api-message'; import { NGXLogger } from 'ngx-logger'; import { MatPaginator } from '@angular/material'; import { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts index aa686556..cb1c6c38 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts @@ -137,93 +137,83 @@ export class RoomUserListComponent implements OnInit, OnDestroy { this.openProfile.emit(userSeq); } - onClickAddMember() { - this.translateService - .get('chat.modifyRoomMember') - .pipe(take(1)) - .subscribe(async v => { - const result = await this.dialogService.open< - CreateChatDialogComponent, - CreateChatDialogData, - CreateChatDialogResult - >(CreateChatDialogComponent, { - width: '600px', - data: { - type: UserSelectDialogType.EditChatMember, - title: v, - curRoomUser: this.userInfoList.filter( - user => user.seq !== this.loginRes.userSeq && user.isJoinRoom - ) - } - }); + async onClickAddMember() { + const result = await this.dialogService.open< + CreateChatDialogComponent, + CreateChatDialogData, + CreateChatDialogResult + >(CreateChatDialogComponent, { + width: '600px', + data: { + type: UserSelectDialogType.EditChatMember, + title: this.translateService.instant('chat.modifyRoomMember'), + curRoomUser: this.userInfoList.filter( + user => user.seq !== this.loginRes.userSeq && user.isJoinRoom + ) + } + }); - if (!!result && !!result.choice && result.choice) { - const userSeqs: number[] = this.userInfoList.map(userInfo => { - if (userInfo.isJoinRoom) { - return userInfo.seq; - } - }); - if (!!result.selectedUserList && result.selectedUserList.length > 0) { - result.selectedUserList.forEach(user => { - if (userSeqs.indexOf(user.seq) < 0) { - userSeqs.push(user.seq); - } - }); - } - - if (userSeqs.length > 0) { - // include me - userSeqs.push(this.loginRes.userSeq); - - this.store.dispatch( - RoomStore.inviteOrOpen({ - req: { - divCd: 'Invite', - userSeqs - } - }) - ); - } + if (!!result && !!result.choice && result.choice) { + const userSeqs: number[] = this.userInfoList.map(userInfo => { + if (userInfo.isJoinRoom) { + return userInfo.seq; } }); + if (!!result.selectedUserList && result.selectedUserList.length > 0) { + result.selectedUserList.forEach(user => { + if (userSeqs.indexOf(user.seq) < 0) { + userSeqs.push(user.seq); + } + }); + } + + if (userSeqs.length > 0) { + // include me + userSeqs.push(this.loginRes.userSeq); + + this.store.dispatch( + RoomStore.inviteOrOpen({ + req: { + divCd: 'Invite', + userSeqs + } + }) + ); + } + } } - onClickAddGroup() { - this.translateService - .get('group.selectTargetGroup') - .pipe(take(1)) - .subscribe(async v => { - const result = await this.dialogService.open< - SelectGroupDialogComponent, - SelectGroupDialogData, - SelectGroupDialogResult - >(SelectGroupDialogComponent, { - width: '600px', - data: { - title: v - } - }); + async onClickAddGroup() { + const result = await this.dialogService.open< + SelectGroupDialogComponent, + SelectGroupDialogData, + SelectGroupDialogResult + >(SelectGroupDialogComponent, { + width: '600px', + data: { + title: this.translateService.instant('group.selectTargetGroup') + } + }); - 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); - }); + 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 - }) - ); - } - } - }); + this.store.dispatch( + SyncStore.updateGroupMember({ + oldGroup, + trgtUserSeq + }) + ); + } + } } onContextMenuRoomUser(event: MouseEvent, buddy: UserInfo) { @@ -241,40 +231,35 @@ export class RoomUserListComponent implements OnInit, OnDestroy { this.roomUserContextMenuTrigger.openMenu(); } - onClickContextMenu(type: string, buddy: UserInfo) { + async onClickContextMenu(type: string, buddy: UserInfo) { switch (type) { case 'FORCING_EXIT': { - this.translateService - .get(['chat.ejectFromRoom', 'chat.confirmEjectFromRoom'], { - targetMember: buddy.name - }) - .pipe(take(1)) - .subscribe(async vs => { - const result = await this.dialogService.open< - ConfirmDialogComponent, - ConfirmDialogData, - ConfirmDialogResult - >(ConfirmDialogComponent, { - data: { - title: vs['chat.ejectFromRoom'], - html: vs['chat.confirmEjectFromRoom'] - } - }); + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + data: { + title: this.translateService.instant('chat.ejectFromRoom'), + html: this.translateService.instant('chat.confirmEjectFromRoom', { + targetMember: buddy.name + }) + } + }); - if (!!result && !!result.choice && result.choice) { - this.store.dispatch( - RoomStore.exitForcing({ - req: { - roomSeq: this.roomInfo.roomSeq, - senderSeq: this.loginRes.userSeq, - type: 'A', - userSeqs: [buddy.seq] - } - }) - ); - } - }); + if (!!result && !!result.choice && result.choice) { + this.store.dispatch( + RoomStore.exitForcing({ + req: { + roomSeq: this.roomInfo.roomSeq, + senderSeq: this.loginRes.userSeq, + type: 'A', + userSeqs: [buddy.seq] + } + }) + ); + } } break; } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/account/change-password.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/account/change-password.dialog.component.html index dc33fc29..0d9e110d 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/account/change-password.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/account/change-password.dialog.component.html @@ -1,6 +1,6 @@ - 패스워드 변경 + {{ 'accounts.changePassword' | translate }}
@@ -18,7 +18,7 @@ (click)="onClickChoice(false)" class="mat-primary" > - 취소 + {{ 'common.messages.cancel' | translate }} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/account/notice.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/account/notice.dialog.component.html index 37e8206f..12ca1ccb 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/account/notice.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/account/notice.dialog.component.html @@ -10,7 +10,7 @@ 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 cc94110f..b74f01d0 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 @@ -113,7 +113,7 @@ {{ 'common.searchResult' | translate }} ({{ searchUserInfos.length - }}{{ 'common.howManyPersons' | translate }}) + }}{{ 'common.units.persons' | translate }})
{{ selectedUserList.length }} - {{ 'common.howManyPersons' | translate }}
@@ -206,7 +206,7 @@ (click)="onClickChoice(false)" class="mat-primary" > - No + {{ 'common.messages.no' | translate }}
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 bda43023..ba7c20df 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 @@ -15,7 +15,7 @@ import { } from '@angular/material'; import { NGXLogger } from 'ngx-logger'; import { Observable, combineLatest, Subscription, of } from 'rxjs'; -import { map, tap, catchError } from 'rxjs/operators'; +import { map, tap, catchError, take } from 'rxjs/operators'; import { Store, select } from '@ngrx/store'; import * as AppStore from '@app/store'; @@ -54,6 +54,7 @@ import { ConfirmDialogData, DialogService } from '@ucap-webmessenger/ui'; +import { TranslateService } from '@ngx-translate/core'; export interface CreateChatDialogData { type?: string; @@ -104,6 +105,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { private formBuilder: FormBuilder, private logger: NGXLogger, private dialogService: DialogService, + private translateService: TranslateService, private changeDetectorRef: ChangeDetectorRef ) { this.sessionVerinfo = this.sessionStorageService.get( @@ -619,9 +621,11 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { return; } - let cfmMsg = `새로운 그룹을 추가하시겠습니까?`; + let cfmMsg: string; if (this.selectedUserList.length === 0) { - cfmMsg += `
빈 그룹으로 생성됩니다.`; + cfmMsg = this.translateService.instant('group.confirmAddNewWithout'); + } else { + cfmMsg = this.translateService.instant('group.confirmAddNew'); } const result = await this.dialogService.open< ConfirmDialogComponent, @@ -630,7 +634,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { >(ConfirmDialogComponent, { width: '400px', data: { - title: 'Confirm', + title: this.translateService.instant('group.addNew'), html: cfmMsg } }); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/edit-chat-room.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/edit-chat-room.dialog.component.html index 5b3325d3..445185df 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/edit-chat-room.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/edit-chat-room.dialog.component.html @@ -10,26 +10,30 @@ matInput #input maxlength="20" - placeholder="대화방이름" + placeholder="{{ 'chat.nameOfRoom' | translate }}" formControlName="roomName" /> {{ input.value?.length || 0 }}/20
- 변경 대상자 + {{ 'chat.scopeOfChangeNameOfRoom' | translate }} - - 전체 + {{ + 'common.pronoun.me' | translate + }} + {{ + 'common.pronoun.all' | translate + }}
- Setting Timer + {{ 'chat.setTimer' | translate }} {{ timer.text }} @@ -45,10 +49,10 @@ (click)="onClickChoice(false)" class="mat-primary" > - No + {{ 'common.messages.no' | translate }} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/edit-chat-room.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/edit-chat-room.dialog.component.ts index dd29bec1..b6249180 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/edit-chat-room.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/edit-chat-room.dialog.component.ts @@ -1,7 +1,10 @@ import { RoomInfo } from '@ucap-webmessenger/protocol-room'; -import { Component, OnInit, Inject } from '@angular/core'; +import { Component, OnInit, Inject, OnDestroy } from '@angular/core'; import { FormGroup, FormBuilder } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { TranslateService } from '@ngx-translate/core'; +import { Subscription } from 'rxjs'; +import { take } from 'rxjs/operators'; export interface EditChatRoomDialogData { title: string; @@ -21,23 +24,11 @@ export interface EditChatRoomDialogResult { templateUrl: './edit-chat-room.dialog.component.html', styleUrls: ['./edit-chat-room.dialog.component.scss'] }) -export class EditChatRoomDialogComponent implements OnInit { +export class EditChatRoomDialogComponent implements OnInit, OnDestroy { roomName: string; inputForm: FormGroup; - timerArray: { value: number; text: string }[] = [ - { value: 5, text: '5 초' }, - { value: 10, text: '10 초' }, - { value: 30, text: '30 초' }, - { value: 60, text: '1 분' }, - { value: 300, text: '5 분' }, - { value: 600, text: '10 분' }, - { value: 1800, text: '30 분' }, - { value: 3600, text: '1 시간' }, - { value: 21600, text: '6 시간' }, - { value: 43200, text: '12 시간' }, - { value: 86400, text: '24 시간' } - ]; + timerArray: { value: number; text: string }[]; constructor( public dialogRef: MatDialogRef< @@ -45,7 +36,8 @@ export class EditChatRoomDialogComponent implements OnInit { EditChatRoomDialogResult >, @Inject(MAT_DIALOG_DATA) public data: EditChatRoomDialogData, - private formBuilder: FormBuilder + private formBuilder: FormBuilder, + private translateService: TranslateService ) {} ngOnInit(): void { @@ -54,8 +46,33 @@ export class EditChatRoomDialogComponent implements OnInit { changeTarget: ['me'], timerInterval: [this.data.roomInfo.timeRoomInterval] }); + + this.translateService + .get([ + 'common.units.hourFrom', + 'common.units.minute', + 'common.units.second' + ]) + .pipe(take(1)) + .subscribe(vs => { + this.timerArray = [ + { value: 5, text: `5 ${vs['common.units.second']}` }, + { value: 10, text: `10 ${vs['common.units.second']}` }, + { value: 30, text: `30 ${vs['common.units.second']}` }, + { value: 60, text: `1 ${vs['common.units.minute']}` }, + { value: 300, text: `5 ${vs['common.units.minute']}` }, + { value: 600, text: `10 ${vs['common.units.minute']}` }, + { value: 1800, text: `30 ${vs['common.units.minute']}` }, + { value: 3600, text: `1 ${vs['common.units.hourFrom']}` }, + { value: 21600, text: `6 ${vs['common.units.hourFrom']}` }, + { value: 43200, text: `12 ${vs['common.units.hourFrom']}` }, + { value: 86400, text: `24 ${vs['common.units.hourFrom']}` } + ]; + }); } + ngOnDestroy(): void {} + onClickChoice(choice: boolean): void { this.dialogRef.close({ choice, diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/mass-detail.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/mass-detail.component.html index 27078fba..c4935e66 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/mass-detail.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/mass-detail.component.html @@ -9,7 +9,7 @@ diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/edit-group.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/edit-group.dialog.component.html index 4231703b..313fd44c 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/edit-group.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/edit-group.dialog.component.html @@ -4,12 +4,17 @@
- + {{ input.value?.length || 0 }}/20 @@ -22,10 +27,10 @@ (click)="onClickChoice(false)" class="mat-primary" > - No + {{ 'common.messages.no' | translate }} - \ No newline at end of file + diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.html index 2452d9d9..d6b7df4d 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.html @@ -11,16 +11,21 @@ class="mat-mini-fab mat-button-base mat-accent mat-elevation-z" > add - 새 그룹 추가 + {{ 'group.addNew' | translate }}
- + @@ -41,7 +46,7 @@
@@ -61,7 +66,8 @@ > {{ groupBuddy.group.name }} ({{ groupBuddy.buddyList.length }}명)({{ groupBuddy.buddyList.length + }}{{ 'common.units.persons' | translate }}) @@ -80,10 +86,10 @@ (click)="onClickChoice(false)" class="mat-primary" > - No + {{ 'common.messages.no' | translate }} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.ts index 9946a445..20918071 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/select-group.dialog.component.ts @@ -7,7 +7,7 @@ import { } from '@angular/material'; import { Observable, combineLatest } from 'rxjs'; import { Store, select } from '@ngrx/store'; -import { map } from 'rxjs/operators'; +import { map, take } from 'rxjs/operators'; import * as AppStore from '@app/store'; import * as SyncStore from '@app/store/messenger/sync'; @@ -20,6 +20,7 @@ import { } from '@ucap-webmessenger/ui'; import { GroupDetailData, UserInfo } from '@ucap-webmessenger/protocol-sync'; import { environment } from '../../../../../environments/environment'; +import { TranslateService } from '@ngx-translate/core'; export interface SelectGroupDialogData { title: string; @@ -43,7 +44,8 @@ export class SelectGroupDialogComponent implements OnInit { >, @Inject(MAT_DIALOG_DATA) public data: SelectGroupDialogData, private store: Store, - private dialogService: DialogService + private dialogService: DialogService, + private translateService: TranslateService ) {} @ViewChild('groups', { static: true }) groups: MatSelectionList; @@ -109,8 +111,10 @@ export class SelectGroupDialogComponent implements OnInit { >(ConfirmDialogComponent, { width: '300px', data: { - title: 'Add group', - html: `그룹(${groupName})을 추가하시겠습니까?` + title: this.translateService.instant('group.addNew'), + html: this.translateService.instant('group.confirmAddNewWith', { + nameOfGroup: groupName + }) } }); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.html index 48c2ebb5..1fe42c63 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.html @@ -2,9 +2,15 @@ - 받은 쪽지 - 보낸 쪽지 - 예약 쪽지 + {{ + 'message.messageTypeReceiving' | translate + }} + {{ + 'message.messageTypeOutgoing' | translate + }} + {{ + 'message.messageTypeReservation' | translate + }} @@ -27,7 +33,6 @@ 받은시간{{ 'message.receivedTime' | translate }} 보낸시간{{ 'message.sendingTime' | translate }} 발송예정시간{{ 'message.reservationTime' | translate }} {{ messageInfo.regDate | ucapDate: 'YYYY.MM.DD (ddd) a hh:mm' @@ -123,13 +127,15 @@
- 기간이 만료된 파일입니다 + {{ + 'common.file.errors.expired' | translate + }}
@@ -161,7 +167,8 @@ > - 읽은 사람 {{ getReadUserCount(true) }} + {{ 'message.countOfReadUser' | translate }} + {{ getReadUserCount(true) }} @@ -176,11 +183,12 @@ - 읽지 않은 사람 {{ getReadUserCount(true) }} + {{ 'message.countOfUnreadUser' | translate }} + {{ getReadUserCount(true) }}
    - 전체선택 + {{ 'common.messages.selectAll' | translate }} - 발송취소 + {{ 'message.cancelReservation' | translate }}
@@ -237,21 +245,21 @@ *ngIf="messageInfo.type === MessageType.Send" (click)="onClickMessageMenu('MESSAGE_READ')" > - 읽음확인 + {{ 'message.detailOfViewers' | translate }} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts index c5639525..08175e43 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts @@ -40,6 +40,7 @@ import { MessageWriteDialogData } from './message-write.dialog.component'; import { EnvironmentsInfo } from '@app/types'; +import { TranslateService } from '@ngx-translate/core'; export interface MessageDetailDialogData { detail: DetailResponse; @@ -91,7 +92,8 @@ export class MessageDetailDialogComponent implements OnInit { private messageApiService: MessageApiService, private snackBarService: SnackBarService, private logger: NGXLogger, - private dialogService: DialogService + private dialogService: DialogService, + private translateService: TranslateService ) {} ngOnInit(): void { @@ -300,7 +302,9 @@ export class MessageDetailDialogComponent implements OnInit { >(AlertDialogComponent, { data: { title: '', - html: `다운로드가 진행중입니다.` + html: this.translateService.instant( + 'common.file.results.downloadInProgress' + ) } }); } @@ -378,12 +382,16 @@ export class MessageDetailDialogComponent implements OnInit { attachFile.downloadType === 'SINGLE' ) { // single :: fail - errMsg = '파일 저장에 실패하였습니다.'; + errMsg = this.translateService.instant( + 'common.file.errors.failToSave' + ); } else { // all - errMsg = '일부 저장중 오류가 발생하였습니다.'; + errMsg = this.translateService.instant( + 'common.file.errors.failToSaveSomeOfAll' + ); } - this.snackBarService.open(errMsg, '확인', { + this.snackBarService.open(errMsg, '', { duration: 8000, verticalPosition: 'bottom' }); @@ -395,7 +403,10 @@ export class MessageDetailDialogComponent implements OnInit { ) { // single :: success this.snackBarService.open( - `파일이 경로[${attachFile.downloadType}]에 저장되었습니다.`, + this.translateService.instant( + 'common.file.errors.savedToPath', + { path: attachFile.downloadType } + ), '', { duration: 3000, @@ -404,10 +415,16 @@ export class MessageDetailDialogComponent implements OnInit { ); } else { // all - this.snackBarService.open('모두 저장하였습니다.', '', { - duration: 3000, - verticalPosition: 'bottom' - }); + this.snackBarService.open( + this.translateService.instant( + 'common.file.errors.savedAll' + ), + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); } } this.downloadProgress = false; @@ -433,8 +450,10 @@ export class MessageDetailDialogComponent implements OnInit { ConfirmDialogResult >(ConfirmDialogComponent, { data: { - title: '발송취소', - html: `예약발송을 취소 하시겠습니까?
취소하면 목록에서도 영구 삭제됩니다.` + title: this.translateService.instant('message.cancelReservation'), + html: this.translateService.instant( + 'message.confirmCancelReservation' + ) } }); @@ -454,8 +473,8 @@ export class MessageDetailDialogComponent implements OnInit { ConfirmDialogResult >(ConfirmDialogComponent, { data: { - title: '삭제', - message: '선택한 쪽지를 삭제하시겠습니까?' + title: this.translateService.instant('message.remove'), + message: this.translateService.instant('message.confirmRemove') } }); @@ -524,9 +543,8 @@ export class MessageDetailDialogComponent implements OnInit { ConfirmDialogResult >(ConfirmDialogComponent, { data: { - title: '발송 취소', - message: - '발송 취소를 하시면 받는 사람의 쪽지함에서 쪽지가 삭제됩니다.' + title: this.translateService.instant('message.cancelSending'), + message: this.translateService.instant('message.confirmCancelSending') } }); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-write.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-write.dialog.component.html index 2456ffbc..67ae7415 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-write.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-write.dialog.component.html @@ -1,6 +1,8 @@ - 쪽지 {{ isModify ? '수정' : '보내기' }} + + {{ (isModify ? 'message.modify' : 'message.sendTo') | translate }} + { let msg = ''; if (!!message.reservationTime) { - msg = `쪽지 전송을 예약 하였습니다.`; + msg = this.translateService.instant( + 'message.results.successForReservation' + ); } else { - msg = `쪽지를 전송하였습니다.`; + msg = this.translateService.instant( + 'message.results.successForSending' + ); } this.snackBarService.open(msg, '', { @@ -135,10 +141,15 @@ export class MessageWriteDialogComponent implements OnInit { this.dialogRef.close({ sendFlag: true, sendType: message.type }); }, error => { - this.snackBarService.open(`쪽지를 전송에 실패 하였습니다.`, '', { - duration: 3000, - verticalPosition: 'bottom' - }); + this.snackBarService.open( + this.translateService.instant('message.errors.failToSending'), + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); + // this.dialogRef.close({}); } ); @@ -155,18 +166,29 @@ export class MessageWriteDialogComponent implements OnInit { .pipe(take(1)) .subscribe( res => { - this.snackBarService.open('쪽지를 수정하였습니다.', '', { - duration: 3000, - verticalPosition: 'bottom' - }); + this.snackBarService.open( + this.translateService.instant( + 'message.results.successForModifying' + ), + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); this.dialogRef.close({ sendFlag: true, sendType: message.type }); }, error => { - this.snackBarService.open(`쪽지 수정에 실패 하였습니다.`, '', { - duration: 3000, - verticalPosition: 'bottom' - }); + this.snackBarService.open( + this.translateService.instant('message.errors.failToModify'), + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); + // this.dialogRef.close({}); } ); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/notice/notice-detail.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/notice/notice-detail.dialog.component.html index ba5eaf4f..380ae93d 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/notice/notice-detail.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/notice/notice-detail.dialog.component.html @@ -1,7 +1,9 @@ - [중요] + + [{{ 'notice.important' | translate }}] + {{ data.notice.title }} @@ -15,7 +17,7 @@ diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/organization/selected-user-list.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/organization/selected-user-list.dialog.component.html index c533b4f5..82fba88d 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/organization/selected-user-list.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/organization/selected-user-list.dialog.component.html @@ -15,7 +15,7 @@ (change)="onCheckAllUser(checkbox.checked)" (click)="$event.stopPropagation()" > - 전체선택 + {{ 'common.messages.selectAll' | translate }} @@ -57,10 +57,10 @@ (click)="onClickChoice(false)" class="mat-primary" > - 취소 + {{ 'common.messages.cancel' | translate }} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts index a3d4740b..4dfd04a6 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts @@ -52,6 +52,7 @@ import { NGXLogger } from 'ngx-logger'; import { SmsUtils } from '@ucap-webmessenger/daesang'; import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; import { environment } from '../../../../../environments/environment'; +import { TranslateService } from '@ngx-translate/core'; export interface ProfileDialogData { userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN; @@ -87,6 +88,7 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { private commonApiService: CommonApiService, private callService: CallService, private snackBarService: SnackBarService, + private translateService: TranslateService, private store: Store, private logger: NGXLogger ) { @@ -174,10 +176,11 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { AlertDialogResult >(AlertDialogComponent, { data: { - title: '', - html: `전화를 걸 수 없는 사용자 입니다.` + title: this.translateService.instant('call.errors.label'), + html: this.translateService.instant('call.errors.cannotCallToUser') } }); + return false; } @@ -191,8 +194,10 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { >(ConfirmDialogComponent, { width: '360px', data: { - title: '전화 걸기', - html: `${calleeNumber}로 전화를 거시겠습니까?` + title: this.translateService.instant('call.callTo'), + html: this.translateService.instant('call.callWithNumber', { + phoneNumber: calleeNumber + }) } }); @@ -225,8 +230,10 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { AlertDialogResult >(AlertDialogComponent, { data: { - title: '', - html: `상대방 번호가 없어 전화를 걸 수 없습니다.` + title: this.translateService.instant('call.errors.label'), + html: this.translateService.instant( + 'call.errors.cannotCallToUserWithoutPhomeNumber' + ) } }); } @@ -244,8 +251,8 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { AlertDialogResult >(AlertDialogComponent, { data: { - title: '', - html: `SMS 사용 권한이 없습니다.` + title: this.translateService.instant('sms.errors.label'), + html: this.translateService.instant('sms.errors.haveNoPermission') } }); return false; @@ -287,7 +294,7 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { >(SelectGroupDialogComponent, { width: '600px', data: { - title: 'Group Select' + title: this.translateService.instant('group.selectTargetGroup') } }); @@ -315,8 +322,11 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { >(ConfirmDialogComponent, { width: '360px', data: { - title: 'Delete Buddy', - html: `[${param.userInfo.name} ${param.userInfo.grade}]를 그룹에서 삭제하시겠습니까?
프로필에서 삭제하면 모든 그룹에서 삭제됩니다.` + title: this.translateService.instant('group.removeBuddyFromGroup'), + html: this.translateService.instant( + 'group.confirmRemoveBuddyFromGroup', + { target: `${param.userInfo.name} ${param.userInfo.grade}` } + ) } }); @@ -378,7 +388,9 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { }, error => { this.snackBarService.open( - `프로필 이미지 변경중에 문제가 발생하였습니다.`, + this.translateService.instant( + 'profile.errors.failToChangeProfileImage' + ), '', { duration: 3000, diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html index 62bb73d3..cd3ee80c 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html @@ -1,6 +1,6 @@ - 설정 + {{ 'settings.label' | translate }}
@@ -8,7 +8,7 @@ - 일반 + {{ 'settings.typeGenernal' | translate }} - 알림 + {{ 'settings.typeNotification' | translate }} - 대화 + {{ 'settings.typeChat' | translate }} - No + {{ 'common.messages.no' | translate }} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html index 9edc0d6a..d83e91a6 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html @@ -242,7 +242,6 @@ stroke-width="2" stroke-linecap="butt" stroke-linejoin="round" - alt="창 최소화" > @@ -265,7 +264,6 @@ stroke-linecap="butt" stroke-linejoin="round" *ngSwitchCase="WindowState.Maximized" - alt="창 이전크기" > @@ -311,7 +308,6 @@ stroke-width="2" stroke-linecap="butt" stroke-linejoin="round" - alt="창닫기" > @@ -332,7 +328,7 @@
- +
- +
- +
- +
- + {{ 'presence.offline' | translate }}
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/native.layout.module.ts b/projects/ucap-webmessenger-app/src/app/layouts/native/native.layout.module.ts index 4c417697..4134e647 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/native.layout.module.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/native.layout.module.ts @@ -8,6 +8,8 @@ import { MatIconModule } from '@angular/material/icon'; import { MatMenuModule } from '@angular/material/menu'; import { MatToolbarModule } from '@angular/material/toolbar'; +import { TranslateModule } from '@ngx-translate/core'; + import { UCapUiModule } from '@ucap-webmessenger/ui'; import { UCapUiProfileModule } from '@ucap-webmessenger/ui-profile'; @@ -25,6 +27,8 @@ import { MatTooltipModule, MatBadgeModule } from '@angular/material'; MatMenuModule, MatBadgeModule, + TranslateModule, + UCapUiModule, UCapUiProfileModule ], diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts index 5f4f9d1b..dc19cc9a 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts @@ -46,6 +46,7 @@ import { import { MessageType } from '@ucap-webmessenger/api-message'; import { AppUserInfo, KEY_APP_USER_INFO } from '@app/types/app-user-info.type'; import { environment } from '../../../../environments/environment'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-page-messenger-main', @@ -77,6 +78,7 @@ export class MainPageComponent implements OnInit, OnDestroy { private callService: CallService, private localStorageService: LocalStorageService, private sessionStorageService: SessionStorageService, + private translateService: TranslateService, private dialogService: DialogService, private logger: NGXLogger ) { @@ -274,10 +276,11 @@ export class MainPageComponent implements OnInit, OnDestroy { AlertDialogResult >(AlertDialogComponent, { data: { - title: '', - html: `전화를 걸 수 없는 사용자 입니다.` + title: this.translateService.instant('call.errors.label'), + html: this.translateService.instant('call.errors.cannotCallToUser') } }); + return false; } @@ -291,8 +294,10 @@ export class MainPageComponent implements OnInit, OnDestroy { >(ConfirmDialogComponent, { width: '360px', data: { - title: '전화 걸기', - html: `${calleeNumber}로 전화를 거시겠습니까?` + title: this.translateService.instant('call.callTo'), + html: this.translateService.instant('call.callWithNumber', { + phoneNumber: calleeNumber + }) } }); @@ -320,8 +325,10 @@ export class MainPageComponent implements OnInit, OnDestroy { AlertDialogResult >(AlertDialogComponent, { data: { - title: '', - html: `상대방 번호가 없어 전화를 걸 수 없습니다.` + title: this.translateService.instant('call.errors.label'), + html: this.translateService.instant( + 'call.errors.cannotCallToUserWithoutPhomeNumber' + ) } }); } @@ -339,10 +346,11 @@ export class MainPageComponent implements OnInit, OnDestroy { AlertDialogResult >(AlertDialogComponent, { data: { - title: '', - html: `SMS 사용 권한이 없습니다.` + title: this.translateService.instant('sms.errors.label'), + html: this.translateService.instant('sms.errors.haveNoPermission') } }); + return false; } diff --git a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts index 4d0a4963..2a48dbe0 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -1,7 +1,7 @@ import { delGroupSuccess, buddy2 } from './../store/messenger/sync/actions'; import { Injectable, Inject } from '@angular/core'; -import { tap, withLatestFrom } from 'rxjs/operators'; +import { tap, withLatestFrom, take } from 'rxjs/operators'; import { Store, select } from '@ngrx/store'; @@ -109,6 +109,7 @@ import { NotificationMethod } from '@ucap-webmessenger/core'; import { Dictionary } from '@ngrx/entity'; import { MessageType } from '@ucap-webmessenger/api-message'; import { LogoutInfo, KEY_LOGOUT_INFO } from '@app/types'; +import { TranslateService } from '@ngx-translate/core'; @Injectable() export class AppNotificationService { @@ -120,6 +121,7 @@ export class AppNotificationService { private groupProtocolService: GroupProtocolService, private buddyProtocolService: BuddyProtocolService, private statusProtocolService: StatusProtocolService, + private translateService: TranslateService, private umgProtocolService: UmgProtocolService, private localStorageService: LocalStorageService, private sessionStorageService: SessionStorageService, @@ -235,7 +237,9 @@ export class AppNotificationService { const notiReq: NotificationRequest = { type: NotificationType.Event, seq: noti.roomSeq, - title: '메세지가 도착했습니다.', + title: this.translateService.instant( + 'notification.titleChatEventArrived' + ), contents: StringUtil.convertFinalEventMessage( noti.eventType, noti.info.sentMessageJson @@ -611,7 +615,9 @@ export class AppNotificationService { const notiReq: NotificationRequest = { type: NotificationType.Message, seq: noti.keyId, - title: '쪽지가 도착했습니다.', + title: this.translateService.instant( + 'notification.titleMessageArrived' + ), contents: noti.text, image: noti.senderInfo.profileImageFile, useSound: [ diff --git a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts index 6f4e3641..2f3d1186 100644 --- a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts @@ -68,11 +68,7 @@ import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; import { ProtocolService } from '@ucap-webmessenger/protocol'; import { environment } from '../../../../environments/environment'; -import { - ChangePasswordDialogComponent, - ChangePasswordDialogData, - ChangePasswordDialogResult -} from '@app/layouts/messenger/dialogs/account/change-password.dialog.component'; + import { ServiceProtocolService, UserPasswordSetResponse @@ -80,6 +76,7 @@ import { import { DaesangUrlInfoResponse } from '@ucap-webmessenger/api-external'; import { AppUserInfo, KEY_APP_USER_INFO } from '@app/types/app-user-info.type'; import { DaesangCipherService, WebLinkType } from '@ucap-webmessenger/daesang'; +import { TranslateService } from '@ngx-translate/core'; @Injectable() export class Effects { @@ -205,8 +202,8 @@ export class Effects { ConfirmDialogResult >(ConfirmDialogComponent, { data: { - title: 'Logout', - message: '로그아웃 하시겠습니까?' + title: this.translateService.instant('accounts.logout'), + message: this.translateService.instant('accounts.confirmLogout') } }); @@ -259,7 +256,9 @@ export class Effects { height: '500px', disableClose: true, data: { - title: '개인정보 동의', + title: this.translateService.instant( + 'accounts.consentOfPrivacy' + ), html: `