번역 프로그레스 및 이벤트 처리.
This commit is contained in:
parent
bcabe99d53
commit
a6dd6b1275
|
@ -189,7 +189,7 @@
|
||||||
<!-- / CHAT TOOLBAR -->
|
<!-- / CHAT TOOLBAR -->
|
||||||
<div style="position: relative;">
|
<div style="position: relative;">
|
||||||
<div
|
<div
|
||||||
*ngIf="eventListProcessing$ | async"
|
*ngIf="(eventListProcessing$ | async) || isTranslationProcess"
|
||||||
style="position: absolute; width: 100%;"
|
style="position: absolute; width: 100%;"
|
||||||
>
|
>
|
||||||
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
|
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
|
||||||
|
|
|
@ -172,6 +172,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
selectedSticker: StickerFilesInfo;
|
selectedSticker: StickerFilesInfo;
|
||||||
|
|
||||||
/** About Translation */
|
/** About Translation */
|
||||||
|
isTranslationProcess = false;
|
||||||
isShowTranslation = false;
|
isShowTranslation = false;
|
||||||
translationSimpleview = false;
|
translationSimpleview = false;
|
||||||
translationPreview = false;
|
translationPreview = false;
|
||||||
|
@ -376,6 +377,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
this.onCloseSearchArea();
|
this.onCloseSearchArea();
|
||||||
|
|
||||||
// Translate Clear..
|
// Translate Clear..
|
||||||
|
this.isTranslationProcess = false;
|
||||||
this.isShowTranslation = false;
|
this.isShowTranslation = false;
|
||||||
this.translationSimpleview = false;
|
this.translationSimpleview = false;
|
||||||
this.translationPreview = false;
|
this.translationPreview = false;
|
||||||
|
@ -628,6 +630,12 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
const destLocale = this.destLocale;
|
const destLocale = this.destLocale;
|
||||||
const original = message;
|
const original = message;
|
||||||
const roomSeq = this.roomInfo.roomSeq;
|
const roomSeq = this.roomInfo.roomSeq;
|
||||||
|
|
||||||
|
if (!!this.isTranslationProcess) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isTranslationProcess = true;
|
||||||
this.commonApiService
|
this.commonApiService
|
||||||
.translationSave({
|
.translationSave({
|
||||||
userSeq: this.loginRes.userSeq,
|
userSeq: this.loginRes.userSeq,
|
||||||
|
@ -703,7 +711,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
}),
|
}),
|
||||||
catchError(error => of(this.logger.error(error)))
|
catchError(error => of(this.logger.error(error)))
|
||||||
)
|
)
|
||||||
.subscribe();
|
.subscribe(() => {
|
||||||
|
this.isTranslationProcess = false;
|
||||||
|
});
|
||||||
} else if (!!this.selectedSticker) {
|
} else if (!!this.selectedSticker) {
|
||||||
/** CASE : Sticker */
|
/** CASE : Sticker */
|
||||||
if (
|
if (
|
||||||
|
@ -1485,6 +1495,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
this.destLocale = destLocale;
|
this.destLocale = destLocale;
|
||||||
}
|
}
|
||||||
onCancelTranslation() {
|
onCancelTranslation() {
|
||||||
|
this.isTranslationProcess = false;
|
||||||
this.translationPreviewInfo = null;
|
this.translationPreviewInfo = null;
|
||||||
}
|
}
|
||||||
onSendTranslationMessage(params: {
|
onSendTranslationMessage(params: {
|
||||||
|
@ -1517,6 +1528,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.isTranslationProcess = false;
|
||||||
this.translationPreviewInfo = null;
|
this.translationPreviewInfo = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,9 @@ import {
|
||||||
EventJson,
|
EventJson,
|
||||||
StickerEventJson,
|
StickerEventJson,
|
||||||
FileEventJson,
|
FileEventJson,
|
||||||
MassTextEventJson
|
MassTextEventJson,
|
||||||
|
TranslationEventJson,
|
||||||
|
MassTranslationEventJson
|
||||||
} from '@ucap-webmessenger/protocol-event';
|
} from '@ucap-webmessenger/protocol-event';
|
||||||
|
|
||||||
import * as ChatStore from '@app/store/messenger/chat';
|
import * as ChatStore from '@app/store/messenger/chat';
|
||||||
|
@ -320,6 +322,18 @@ export class Effects {
|
||||||
) {
|
) {
|
||||||
contents = (event.sentMessageJson as MassTextEventJson)
|
contents = (event.sentMessageJson as MassTextEventJson)
|
||||||
.content;
|
.content;
|
||||||
|
} else if (
|
||||||
|
event.type === EventType.Translation &&
|
||||||
|
!!event.sentMessageJson
|
||||||
|
) {
|
||||||
|
contents = (event.sentMessageJson as TranslationEventJson)
|
||||||
|
.original;
|
||||||
|
} else if (
|
||||||
|
event.type === EventType.MassTranslation &&
|
||||||
|
!!event.sentMessageJson
|
||||||
|
) {
|
||||||
|
contents = (event.sentMessageJson as MassTranslationEventJson)
|
||||||
|
.original;
|
||||||
}
|
}
|
||||||
|
|
||||||
return contents.indexOf(action.searchText) > -1;
|
return contents.indexOf(action.searchText) > -1;
|
||||||
|
|
|
@ -2,7 +2,9 @@ import {
|
||||||
EventType,
|
EventType,
|
||||||
EventJson,
|
EventJson,
|
||||||
FileEventJson,
|
FileEventJson,
|
||||||
MassTextEventJson
|
MassTextEventJson,
|
||||||
|
TranslationEventJson,
|
||||||
|
MassTranslationEventJson
|
||||||
} from '@ucap-webmessenger/protocol-event';
|
} from '@ucap-webmessenger/protocol-event';
|
||||||
import { FileType } from '@ucap-webmessenger/protocol-file';
|
import { FileType } from '@ucap-webmessenger/protocol-file';
|
||||||
|
|
||||||
|
@ -192,6 +194,18 @@ export class StringUtil {
|
||||||
eventMessage = m.content;
|
eventMessage = m.content;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case EventType.Translation:
|
||||||
|
{
|
||||||
|
const m = finalEventMessage as TranslationEventJson;
|
||||||
|
eventMessage = m.original;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EventType.MassTranslation:
|
||||||
|
{
|
||||||
|
const m = finalEventMessage as MassTranslationEventJson;
|
||||||
|
eventMessage = m.original;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user