From cf2bb3987d96f2589685b65b2afe17fbfea36947 Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 13 Jan 2020 09:04:18 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=9C=EC=86=A1=20=EC=B7=A8=EC=86=8C?= =?UTF-8?q?=EB=90=9C=20=EC=AA=BD=EC=A7=80=EC=97=90=20=EB=8C=80=ED=95=9C=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=EB=B3=B4=EA=B8=B0=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lib/types/message-status-code.type.ts | 2 ++ .../left-sidenav/message.component.ts | 26 ++++++++++++++++++- .../app/store/messenger/message/effects.ts | 12 ++++----- .../src/assets/i18n/en.json | 3 ++- .../src/assets/i18n/ko.json | 3 ++- .../lib/components/list-item.component.html | 2 +- 6 files changed, 37 insertions(+), 11 deletions(-) diff --git a/projects/ucap-webmessenger-api/src/lib/types/message-status-code.type.ts b/projects/ucap-webmessenger-api/src/lib/types/message-status-code.type.ts index 72a13998..5262641b 100644 --- a/projects/ucap-webmessenger-api/src/lib/types/message-status-code.type.ts +++ b/projects/ucap-webmessenger-api/src/lib/types/message-status-code.type.ts @@ -23,6 +23,8 @@ export enum MessageStatusCode { Fail_File_Size = '41', /** 파일 업로드 시, 업로드할 수 없는 파일 형식일 경우 발생 */ Fail_File_Ext = '42', + /** 발송 취소된 메시지 */ + Fail_Cancelled_Msg = '51', /** Exception 에러 발생 */ Fail = '99' } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts index a783ce1a..02b98bff 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts @@ -15,7 +15,12 @@ import { NGXLogger } from 'ngx-logger'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; -import { DialogService } from '@ucap-webmessenger/ui'; +import { + DialogService, + AlertDialogComponent, + AlertDialogResult, + AlertDialogData +} from '@ucap-webmessenger/ui'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; import { @@ -46,6 +51,7 @@ import { import * as AppStore from '@app/store'; import * as MessageStore from '@app/store/messenger/message'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-layout-chat-left-sidenav-message', @@ -94,6 +100,7 @@ export class MessageBoxComponent private formBuilder: FormBuilder, private sessionStorageService: SessionStorageService, private dialogService: DialogService, + private translateService: TranslateService, private messageApiService: MessageApiService, private logger: NGXLogger ) { @@ -177,6 +184,23 @@ export class MessageBoxComponent break; } } + } else if ( + !!info && + info.responseCode === MessageStatusCode.Fail_Cancelled_Msg + ) { + this.dialogService.open< + AlertDialogComponent, + AlertDialogData, + AlertDialogResult + >(AlertDialogComponent, { + width: '360px', + data: { + title: this.translateService.instant('message.errors.label'), + message: this.translateService.instant( + 'message.errors.cancelledMessage' + ) + } + }); } }); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/message/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/message/effects.ts index 55ccb2c2..4e01b03d 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/message/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/message/effects.ts @@ -75,13 +75,11 @@ export class Effects { }; return this.messageApiService.detailMessage(request).pipe( map(res => { - if (res.responseCode === MessageStatusCode.Success) { - this.store.dispatch( - detailMessageSuccess({ - res - }) - ); - } + this.store.dispatch( + detailMessageSuccess({ + res + }) + ); }), catchError(error => of(detailMessageFailure({ error }))) ); diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/en.json b/projects/ucap-webmessenger-app/src/assets/i18n/en.json index 9a60ad72..79f1ef52 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/en.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/en.json @@ -281,7 +281,8 @@ "label": "Message error", "failToSending": "The message failed to send.", "failToModify": "The message failed to modify.", - "minTimeReservation": "It can be set only 30 minutes after the current time." + "minTimeReservation": "It can be set only 30 minutes after the current time.", + "cancelledMessage": "This message has been cancelled." } }, "notice": { diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json index bb5df1b5..6b437934 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json @@ -281,7 +281,8 @@ "label": "쪽지 에러", "failToSending": "쪽지를 전송에 실패 하였습니다.", "failToModify": "쪽지 수정에 실패 하였습니다.", - "minTimeReservation": "현재 시각으로부터 30분 이후로만 설정 가능합니다." + "minTimeReservation": "현재 시각으로부터 30분 이후로만 설정 가능합니다.", + "cancelledMessage": "발송 취소된 쪽지 입니다." } }, "notice": { diff --git a/projects/ucap-webmessenger-ui-message/src/lib/components/list-item.component.html b/projects/ucap-webmessenger-ui-message/src/lib/components/list-item.component.html index 4ae77c8d..a2795aac 100644 --- a/projects/ucap-webmessenger-ui-message/src/lib/components/list-item.component.html +++ b/projects/ucap-webmessenger-ui-message/src/lib/components/list-item.component.html @@ -16,7 +16,7 @@ {{ message.userName - }} + }} {{ 'message.andOthers' | translate: { count: message.userCount - 1 }