# 이슈사항

134 인사 정보 언어 영어로 설정 후 부서 선택 시 하단 부서 변경되지 않음 :: 설정의 항목에 대해 연동되도록 프로그램 수정.
135 번역한 대화 우클릭 시 메뉴 제공되지 않음 :: 번역, 대용량번역에 대한 우클릭 지원.
This commit is contained in:
leejinho 2020-01-08 18:27:35 +09:00
parent 21405df9bb
commit 1e9a42f4db
11 changed files with 104 additions and 14 deletions

View File

@ -32,7 +32,7 @@
{{ 'common.messages.searching' | translate }} ... {{ 'common.messages.searching' | translate }} ...
</ng-container> </ng-container>
<ng-template #useSelectedDepartmentName> <ng-template #useSelectedDepartmentName>
{{ selectedDepartmentName }} {{ selectedDepartmentName | ucapTranslate: 'name' }}
</ng-template> </ng-template>
</ng-container> </ng-container>
<ng-container *ngIf="isShowSearch"> <ng-container *ngIf="isShowSearch">

View File

@ -8,7 +8,11 @@ import {
ViewChild, ViewChild,
AfterViewChecked AfterViewChecked
} from '@angular/core'; } from '@angular/core';
import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui'; import {
ucapAnimations,
DialogService,
TranslateService
} from '@ucap-webmessenger/ui';
import { Observable, Subscription, of } from 'rxjs'; import { Observable, Subscription, of } from 'rxjs';
import { import {
DeptInfo, DeptInfo,
@ -46,7 +50,6 @@ import { Company } from '@ucap-webmessenger/api-external';
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar'; import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
import { MatMenuTrigger } from '@angular/material'; import { MatMenuTrigger } from '@angular/material';
import { TranslateService } from '@ngx-translate/core';
import { import {
MessageWriteDialogComponent, MessageWriteDialogComponent,
MessageWriteDialogResult, MessageWriteDialogResult,
@ -131,7 +134,11 @@ export class OrganizationComponent
selectedDepartmentStatus$: Observable<DeptUserResponse>; selectedDepartmentStatus$: Observable<DeptUserResponse>;
selectedDepartmentProcessing = false; selectedDepartmentProcessing = false;
selectedDepartmentProcessingSubscription: Subscription; selectedDepartmentProcessingSubscription: Subscription;
selectedDepartmentName: string; selectedDepartmentName: {
name: string;
nameEn: string;
nameCn: string;
};
loginInfo: LoginInfo; loginInfo: LoginInfo;
loginRes: LoginResponse; loginRes: LoginResponse;
@ -227,7 +234,11 @@ export class OrganizationComponent
}), }),
map(loginRes => { map(loginRes => {
this.loginRes = loginRes; this.loginRes = loginRes;
this.selectedDepartmentName = loginRes.userInfo.deptName; this.selectedDepartmentName = {
name: loginRes.userInfo.deptName,
nameEn: loginRes.userInfo.deptNameEn,
nameCn: loginRes.userInfo.deptNameCn
};
}) })
) )
.subscribe(); .subscribe();
@ -346,7 +357,7 @@ export class OrganizationComponent
); );
}), }),
map(() => { map(() => {
this.selectedDepartmentName = deptInfo.name; this.selectedDepartmentName = deptInfo;
}) })
) )
.subscribe(); .subscribe();

View File

@ -325,12 +325,12 @@
[hasBackdrop]="false" [hasBackdrop]="false"
(ucapClickOutside)="messageContextMenuTrigger.closeMenu()" (ucapClickOutside)="messageContextMenuTrigger.closeMenu()"
> >
<ng-template matMenuContent let-message="message"> <ng-template matMenuContent let-message="message" let-clicktype="clicktype">
<ng-container *ngIf="!isRecalledMessage(message.type)"> <ng-container *ngIf="!isRecalledMessage(message.type)">
<button <button
mat-menu-item mat-menu-item
*ngIf="isCopyableMessage(message.type)" *ngIf="isCopyableMessage(message.type)"
(click)="onClickMessageContextMenu('COPY', message)" (click)="onClickMessageContextMenu('COPY', message, clicktype)"
> >
{{ 'chat.copyChatText' | translate }} {{ 'chat.copyChatText' | translate }}
</button> </button>

View File

@ -1110,6 +1110,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
onContextMenuMessage(params: { onContextMenuMessage(params: {
event: MouseEvent; event: MouseEvent;
message: Info<EventJson>; message: Info<EventJson>;
type?: string;
}) { }) {
params.event.preventDefault(); params.event.preventDefault();
params.event.stopPropagation(); params.event.stopPropagation();
@ -1119,12 +1120,25 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
this.messageContextMenuTrigger.menu.focusFirstItem('mouse'); this.messageContextMenuTrigger.menu.focusFirstItem('mouse');
this.messageContextMenuTrigger.menuData = { this.messageContextMenuTrigger.menuData = {
message: params.message, message: params.message,
loginRes: this.loginRes loginRes: this.loginRes,
clicktype: params.type
}; };
this.messageContextMenuTrigger.openMenu(); this.messageContextMenuTrigger.openMenu();
} }
async onClickMessageContextMenu(menuType: string, message: Info<EventJson>) { async onClickMessageContextMenu(
menuType: string,
message: Info<EventJson>,
clicktype?: string
) {
this.logger.debug(
'menuType',
menuType,
'message',
message,
'clicktype?',
clicktype
);
switch (menuType) { switch (menuType) {
case 'COPY': case 'COPY':
{ {
@ -1177,7 +1191,35 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}); });
} }
break; break;
case EventType.Translation:
case EventType.MassTranslation:
{
let trgtStr = '';
if (clicktype === 'translation') {
// translation
trgtStr = (message.sentMessageJson as TranslationEventJson)
.translation;
} else {
// original
trgtStr = (message.sentMessageJson as TranslationEventJson)
.original;
}
if (this.clipboardService.copyFromContent(trgtStr)) {
this.snackBarService.open(
this.translateService.instant(
'common.clipboard.results.copied'
),
'',
{
duration: 3000,
verticalPosition: 'top',
horizontalPosition: 'center'
}
);
}
}
break;
default: default:
break; break;
} }

View File

@ -21,7 +21,9 @@ export interface Info<T = {}> {
export function isCopyable(eventType: EventType): boolean { export function isCopyable(eventType: EventType): boolean {
return ( return (
EventType.Character === eventType || EventType.Translation === eventType EventType.Character === eventType ||
EventType.Translation === eventType ||
EventType.MassTranslation === eventType
); );
} }

View File

@ -3,10 +3,12 @@
*ngIf="!translationSimpleview || (!!translationSimpleview && !!isMe)" *ngIf="!translationSimpleview || (!!translationSimpleview && !!isMe)"
class="original" class="original"
[innerHTML]="message.sentMessageJson.original | linky" [innerHTML]="message.sentMessageJson.original | linky"
(contextmenu)="onContextMenuMessage($event, 'original')"
></div> ></div>
<div <div
*ngIf="!translationSimpleview || (!!translationSimpleview && !isMe)" *ngIf="!translationSimpleview || (!!translationSimpleview && !isMe)"
class="translation" class="translation"
(contextmenu)="onContextMenuMessage($event, 'translation')"
> >
<span class="language">{{ message.sentMessageJson.destLocale }}</span> <span class="language">{{ message.sentMessageJson.destLocale }}</span>
<span [innerHTML]="message.sentMessageJson.translation | linky"> </span> <span [innerHTML]="message.sentMessageJson.translation | linky"> </span>

View File

@ -26,6 +26,12 @@ export class MassTranslationComponent implements OnInit {
contentsType: string; contentsType: string;
}>(); }>();
@Output()
contextMenu = new EventEmitter<{
event: MouseEvent;
type: string;
}>();
constructor() {} constructor() {}
ngOnInit() {} ngOnInit() {}
@ -43,4 +49,8 @@ export class MassTranslationComponent implements OnInit {
contentsType contentsType
}); });
} }
onContextMenuMessage(event: MouseEvent, type: string) {
this.contextMenu.emit({ event, type });
}
} }

View File

@ -6,6 +6,7 @@
this.message.sentMessageJson.stickerfile.trim().length > 0 this.message.sentMessageJson.stickerfile.trim().length > 0
" "
class="sticker" class="sticker"
(contextmenu)="onContextMenuMessage($event, 'original')"
> >
<img <img
[src]="stickerUrl" [src]="stickerUrl"
@ -16,10 +17,12 @@
*ngIf="!translationSimpleview || (!!translationSimpleview && !!isMe)" *ngIf="!translationSimpleview || (!!translationSimpleview && !!isMe)"
class="original" class="original"
[innerHTML]="message.sentMessageJson.original | linky" [innerHTML]="message.sentMessageJson.original | linky"
(contextmenu)="onContextMenuMessage($event, 'original')"
></div> ></div>
<div <div
*ngIf="!translationSimpleview || (!!translationSimpleview && !isMe)" *ngIf="!translationSimpleview || (!!translationSimpleview && !isMe)"
class="translation" class="translation"
(contextmenu)="onContextMenuMessage($event, 'translation')"
> >
<span class="language">{{ message.sentMessageJson.locale }}</span> <span class="language">{{ message.sentMessageJson.locale }}</span>
<span [innerHTML]="message.sentMessageJson.translation | linky"> </span> <span [innerHTML]="message.sentMessageJson.translation | linky"> </span>

View File

@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { Info, TranslationEventJson } from '@ucap-webmessenger/protocol-event'; import { Info, TranslationEventJson } from '@ucap-webmessenger/protocol-event';
@Component({ @Component({
@ -16,6 +16,12 @@ export class TranslationComponent implements OnInit {
@Input() @Input()
isMe: boolean; isMe: boolean;
@Output()
contextMenu = new EventEmitter<{
event: MouseEvent;
type: string;
}>();
stickerUrl?: string; stickerUrl?: string;
constructor() {} constructor() {}
@ -29,4 +35,8 @@ export class TranslationComponent implements OnInit {
this.stickerUrl = `assets/sticker/sticker_s_${this.message.sentMessageJson.stickerfile}.png`; this.stickerUrl = `assets/sticker/sticker_s_${this.message.sentMessageJson.stickerfile}.png`;
} }
} }
onContextMenuMessage(event: MouseEvent, type: string) {
this.contextMenu.emit({ event, type });
}
} }

View File

@ -187,6 +187,7 @@
[message]="message" [message]="message"
[translationSimpleview]="translationSimpleview" [translationSimpleview]="translationSimpleview"
[isMe]="message.senderSeq === loginRes.userSeq" [isMe]="message.senderSeq === loginRes.userSeq"
(contextMenu)="onContextMenuMessage($event, message)"
class="information-msg" class="information-msg"
></ucap-chat-message-box-translation> ></ucap-chat-message-box-translation>
<ucap-chat-message-box-mass-translation <ucap-chat-message-box-mass-translation
@ -195,6 +196,7 @@
[message]="message" [message]="message"
[translationSimpleview]="translationSimpleview" [translationSimpleview]="translationSimpleview"
[isMe]="message.senderSeq === loginRes.userSeq" [isMe]="message.senderSeq === loginRes.userSeq"
(contextMenu)="onContextMenuMessage($event, message)"
(massTranslationDetail)="onClickMassTranslationDetail($event)" (massTranslationDetail)="onClickMassTranslationDetail($event)"
> >
</ucap-chat-message-box-mass-translation> </ucap-chat-message-box-mass-translation>

View File

@ -78,6 +78,7 @@ export class MessagesComponent implements OnInit {
contextMenu = new EventEmitter<{ contextMenu = new EventEmitter<{
event: MouseEvent; event: MouseEvent;
message: Info<EventJson>; message: Info<EventJson>;
type?: string;
}>(); }>();
messages: Info<EventJson>[]; messages: Info<EventJson>[];
@ -248,7 +249,14 @@ export class MessagesComponent implements OnInit {
} }
/** [Event] Context Menu */ /** [Event] Context Menu */
onContextMenuMessage(event: MouseEvent, message: Info<EventJson>) { onContextMenuMessage(event: any, message: Info<EventJson>) {
this.contextMenu.emit({ event, message }); if (
message.type === EventType.Translation ||
message.type === EventType.MassTranslation
) {
this.contextMenu.emit({ event: event.event, message, type: event.type });
} else {
this.contextMenu.emit({ event, message });
}
} }
} }