발송 취소된 쪽지에 대한 상세보기 에러 처리.

This commit is contained in:
leejinho 2020-01-13 09:04:18 +09:00
parent e263bf1bd9
commit cf2bb3987d
6 changed files with 37 additions and 11 deletions

View File

@ -23,6 +23,8 @@ export enum MessageStatusCode {
Fail_File_Size = '41',
/** 파일 업로드 시, 업로드할 수 없는 파일 형식일 경우 발생 */
Fail_File_Ext = '42',
/** 발송 취소된 메시지 */
Fail_Cancelled_Msg = '51',
/** Exception 에러 발생 */
Fail = '99'
}

View File

@ -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'
)
}
});
}
});

View File

@ -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
})
);
}
}),
catchError(error => of(detailMessageFailure({ error })))
);

View File

@ -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": {

View File

@ -281,7 +281,8 @@
"label": "쪽지 에러",
"failToSending": "쪽지를 전송에 실패 하였습니다.",
"failToModify": "쪽지 수정에 실패 하였습니다.",
"minTimeReservation": "현재 시각으로부터 30분 이후로만 설정 가능합니다."
"minTimeReservation": "현재 시각으로부터 30분 이후로만 설정 가능합니다.",
"cancelledMessage": "발송 취소된 쪽지 입니다."
}
},
"notice": {

View File

@ -16,7 +16,7 @@
<span class="name">
<b>
{{ message.userName
}}<span *ngIf="message.userCount > 0">
}}<span *ngIf="message.userCount > 1">
{{
'message.andOthers'
| translate: { count: message.userCount - 1 }