bugfix :: 이벤트 타입(P:일정) 에 'XX 전 알림' 문구 처리.

This commit is contained in:
leejinho 2020-02-05 09:32:46 +09:00
parent 953d813a95
commit 370fa44579
5 changed files with 37 additions and 4 deletions

View File

@ -253,6 +253,8 @@
"scheduleTypeUpdate": "[Event] Modified", "scheduleTypeUpdate": "[Event] Modified",
"scheduleTypeDelete": "[Event] Deleted", "scheduleTypeDelete": "[Event] Deleted",
"scheduleTypeDefault": "[Event] Processing..", "scheduleTypeDefault": "[Event] Processing..",
"scheduleTypePrefix": "[Event] ",
"scheduleTypeSurfixLeft": " left",
"showPreviousEvents": "Show previous", "showPreviousEvents": "Show previous",
"moreUnreadEventsWith": "There is unread messages<span class=\"text-warn-color\">({{countOfUnread}})</span>" "moreUnreadEventsWith": "There is unread messages<span class=\"text-warn-color\">({{countOfUnread}})</span>"
}, },

View File

@ -253,6 +253,8 @@
"scheduleTypeUpdate": "[이벤트] 수정", "scheduleTypeUpdate": "[이벤트] 수정",
"scheduleTypeDelete": "[이벤트] 삭제", "scheduleTypeDelete": "[이벤트] 삭제",
"scheduleTypeDefault": "[이벤트] 조회중..", "scheduleTypeDefault": "[이벤트] 조회중..",
"scheduleTypePrefix": "[이벤트] ",
"scheduleTypeSurfixLeft": " 전 알림",
"showPreviousEvents": "이전 대화 보기", "showPreviousEvents": "이전 대화 보기",
"moreUnreadEventsWith": "안읽은 메시지가 <span class=\"text-warn-color\">({{countOfUnread}})</span>개 더 있습니다." "moreUnreadEventsWith": "안읽은 메시지가 <span class=\"text-warn-color\">({{countOfUnread}})</span>개 더 있습니다."
}, },

View File

@ -4,7 +4,7 @@ import { JsonAnalization } from '@ucap-webmessenger/api';
export interface PlanEventJson { export interface PlanEventJson {
planSeq?: number; planSeq?: number;
title?: string; title?: string;
contents?: PlanContentType; contents?: PlanContentType | string;
date?: string; date?: string;
endDate?: string; endDate?: string;
active?: boolean; active?: boolean;
@ -23,7 +23,7 @@ export const decodePlanEventJson: EventJsonDecoder<PlanEventJson> = (
return { return {
planSeq: json.planSeq, planSeq: json.planSeq,
title: json.title, title: json.title,
contents: json.contents as PlanContentType, contents: json.contents,
date: json.date, date: json.date,
endDate: json.endDate, endDate: json.endDate,
active: !!json.activeYn && 'Y' === json.activeYn ? true : false active: !!json.activeYn && 'Y' === json.activeYn ? true : false

View File

@ -14,7 +14,8 @@
{{ 'chat.event.scheduleTypeDelete' | translate }} {{ 'chat.event.scheduleTypeDelete' | translate }}
</ng-container> </ng-container>
<ng-container *ngSwitchDefault> <ng-container *ngSwitchDefault>
{{ 'chat.event.scheduleTypeDefault' | translate }} <!-- {{ 'chat.event.scheduleTypeDefault' | translate }} -->
{{ getAlertLeftTime() }}
</ng-container> </ng-container>
</ng-container> </ng-container>
</ng-container> </ng-container>

View File

@ -5,6 +5,7 @@ import {
PlanContentType PlanContentType
} from '@ucap-webmessenger/protocol-event'; } from '@ucap-webmessenger/protocol-event';
import moment from 'moment'; import moment from 'moment';
import { TranslateService } from '@ngx-translate/core';
@Component({ @Component({
selector: 'ucap-chat-message-box-schedule', selector: 'ucap-chat-message-box-schedule',
@ -19,7 +20,7 @@ export class ScheduleComponent implements OnInit {
date: any; date: any;
endDate: any; endDate: any;
constructor() {} constructor(private translateService: TranslateService) {}
ngOnInit() { ngOnInit() {
if (!!this.message && !!this.message.sentMessageJson) { if (!!this.message && !!this.message.sentMessageJson) {
@ -68,4 +69,31 @@ export class ScheduleComponent implements OnInit {
} }
onClickSave(): void {} onClickSave(): void {}
getAlertLeftTime(): string {
let content = this.message.sentMessageJson.contents;
if (content.indexOf('PLAN_CONTENTS_MINUTE') > -1) {
content = content.replace(
'PLAN_CONTENTS_MINUTE',
this.translateService.instant('common.units.minute')
);
} else if (content.indexOf('PLAN_CONTENTS_HOUR') > -1) {
content = content.replace(
'PLAN_CONTENTS_HOUR',
this.translateService.instant('common.units.hour')
);
}
if (content.indexOf('PLAN_CONTENTS_AFTER') > -1) {
content = content.replace(
'PLAN_CONTENTS_AFTER',
this.translateService.instant('chat.event.scheduleTypeSurfixLeft')
);
}
content =
this.translateService.instant('chat.event.scheduleTypePrefix') + content;
return content;
}
} }