# 이슈사항
134 인사 정보 언어 영어로 설정 후 부서 선택 시 하단 부서 변경되지 않음 :: 설정의 항목에 대해 연동되도록 프로그램 수정. 135 번역한 대화 우클릭 시 메뉴 제공되지 않음 :: 번역, 대용량번역에 대한 우클릭 지원.
This commit is contained in:
parent
21405df9bb
commit
1e9a42f4db
|
@ -32,7 +32,7 @@
|
|||
{{ 'common.messages.searching' | translate }} ...
|
||||
</ng-container>
|
||||
<ng-template #useSelectedDepartmentName>
|
||||
{{ selectedDepartmentName }}
|
||||
{{ selectedDepartmentName | ucapTranslate: 'name' }}
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="isShowSearch">
|
||||
|
|
|
@ -8,7 +8,11 @@ import {
|
|||
ViewChild,
|
||||
AfterViewChecked
|
||||
} 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 {
|
||||
DeptInfo,
|
||||
|
@ -46,7 +50,6 @@ import { Company } from '@ucap-webmessenger/api-external';
|
|||
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
|
||||
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
||||
import { MatMenuTrigger } from '@angular/material';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
MessageWriteDialogComponent,
|
||||
MessageWriteDialogResult,
|
||||
|
@ -131,7 +134,11 @@ export class OrganizationComponent
|
|||
selectedDepartmentStatus$: Observable<DeptUserResponse>;
|
||||
selectedDepartmentProcessing = false;
|
||||
selectedDepartmentProcessingSubscription: Subscription;
|
||||
selectedDepartmentName: string;
|
||||
selectedDepartmentName: {
|
||||
name: string;
|
||||
nameEn: string;
|
||||
nameCn: string;
|
||||
};
|
||||
|
||||
loginInfo: LoginInfo;
|
||||
loginRes: LoginResponse;
|
||||
|
@ -227,7 +234,11 @@ export class OrganizationComponent
|
|||
}),
|
||||
map(loginRes => {
|
||||
this.loginRes = loginRes;
|
||||
this.selectedDepartmentName = loginRes.userInfo.deptName;
|
||||
this.selectedDepartmentName = {
|
||||
name: loginRes.userInfo.deptName,
|
||||
nameEn: loginRes.userInfo.deptNameEn,
|
||||
nameCn: loginRes.userInfo.deptNameCn
|
||||
};
|
||||
})
|
||||
)
|
||||
.subscribe();
|
||||
|
@ -346,7 +357,7 @@ export class OrganizationComponent
|
|||
);
|
||||
}),
|
||||
map(() => {
|
||||
this.selectedDepartmentName = deptInfo.name;
|
||||
this.selectedDepartmentName = deptInfo;
|
||||
})
|
||||
)
|
||||
.subscribe();
|
||||
|
|
|
@ -325,12 +325,12 @@
|
|||
[hasBackdrop]="false"
|
||||
(ucapClickOutside)="messageContextMenuTrigger.closeMenu()"
|
||||
>
|
||||
<ng-template matMenuContent let-message="message">
|
||||
<ng-template matMenuContent let-message="message" let-clicktype="clicktype">
|
||||
<ng-container *ngIf="!isRecalledMessage(message.type)">
|
||||
<button
|
||||
mat-menu-item
|
||||
*ngIf="isCopyableMessage(message.type)"
|
||||
(click)="onClickMessageContextMenu('COPY', message)"
|
||||
(click)="onClickMessageContextMenu('COPY', message, clicktype)"
|
||||
>
|
||||
{{ 'chat.copyChatText' | translate }}
|
||||
</button>
|
||||
|
|
|
@ -1110,6 +1110,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
onContextMenuMessage(params: {
|
||||
event: MouseEvent;
|
||||
message: Info<EventJson>;
|
||||
type?: string;
|
||||
}) {
|
||||
params.event.preventDefault();
|
||||
params.event.stopPropagation();
|
||||
|
@ -1119,12 +1120,25 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
this.messageContextMenuTrigger.menu.focusFirstItem('mouse');
|
||||
this.messageContextMenuTrigger.menuData = {
|
||||
message: params.message,
|
||||
loginRes: this.loginRes
|
||||
loginRes: this.loginRes,
|
||||
clicktype: params.type
|
||||
};
|
||||
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) {
|
||||
case 'COPY':
|
||||
{
|
||||
|
@ -1177,7 +1191,35 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
});
|
||||
}
|
||||
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:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,9 @@ export interface Info<T = {}> {
|
|||
|
||||
export function isCopyable(eventType: EventType): boolean {
|
||||
return (
|
||||
EventType.Character === eventType || EventType.Translation === eventType
|
||||
EventType.Character === eventType ||
|
||||
EventType.Translation === eventType ||
|
||||
EventType.MassTranslation === eventType
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
*ngIf="!translationSimpleview || (!!translationSimpleview && !!isMe)"
|
||||
class="original"
|
||||
[innerHTML]="message.sentMessageJson.original | linky"
|
||||
(contextmenu)="onContextMenuMessage($event, 'original')"
|
||||
></div>
|
||||
<div
|
||||
*ngIf="!translationSimpleview || (!!translationSimpleview && !isMe)"
|
||||
class="translation"
|
||||
(contextmenu)="onContextMenuMessage($event, 'translation')"
|
||||
>
|
||||
<span class="language">{{ message.sentMessageJson.destLocale }}</span>
|
||||
<span [innerHTML]="message.sentMessageJson.translation | linky"> </span>
|
||||
|
|
|
@ -26,6 +26,12 @@ export class MassTranslationComponent implements OnInit {
|
|||
contentsType: string;
|
||||
}>();
|
||||
|
||||
@Output()
|
||||
contextMenu = new EventEmitter<{
|
||||
event: MouseEvent;
|
||||
type: string;
|
||||
}>();
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
@ -43,4 +49,8 @@ export class MassTranslationComponent implements OnInit {
|
|||
contentsType
|
||||
});
|
||||
}
|
||||
|
||||
onContextMenuMessage(event: MouseEvent, type: string) {
|
||||
this.contextMenu.emit({ event, type });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
this.message.sentMessageJson.stickerfile.trim().length > 0
|
||||
"
|
||||
class="sticker"
|
||||
(contextmenu)="onContextMenuMessage($event, 'original')"
|
||||
>
|
||||
<img
|
||||
[src]="stickerUrl"
|
||||
|
@ -16,10 +17,12 @@
|
|||
*ngIf="!translationSimpleview || (!!translationSimpleview && !!isMe)"
|
||||
class="original"
|
||||
[innerHTML]="message.sentMessageJson.original | linky"
|
||||
(contextmenu)="onContextMenuMessage($event, 'original')"
|
||||
></div>
|
||||
<div
|
||||
*ngIf="!translationSimpleview || (!!translationSimpleview && !isMe)"
|
||||
class="translation"
|
||||
(contextmenu)="onContextMenuMessage($event, 'translation')"
|
||||
>
|
||||
<span class="language">{{ message.sentMessageJson.locale }}</span>
|
||||
<span [innerHTML]="message.sentMessageJson.translation | linky"> </span>
|
||||
|
|
|
@ -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';
|
||||
|
||||
@Component({
|
||||
|
@ -16,6 +16,12 @@ export class TranslationComponent implements OnInit {
|
|||
@Input()
|
||||
isMe: boolean;
|
||||
|
||||
@Output()
|
||||
contextMenu = new EventEmitter<{
|
||||
event: MouseEvent;
|
||||
type: string;
|
||||
}>();
|
||||
|
||||
stickerUrl?: string;
|
||||
|
||||
constructor() {}
|
||||
|
@ -29,4 +35,8 @@ export class TranslationComponent implements OnInit {
|
|||
this.stickerUrl = `assets/sticker/sticker_s_${this.message.sentMessageJson.stickerfile}.png`;
|
||||
}
|
||||
}
|
||||
|
||||
onContextMenuMessage(event: MouseEvent, type: string) {
|
||||
this.contextMenu.emit({ event, type });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,6 +187,7 @@
|
|||
[message]="message"
|
||||
[translationSimpleview]="translationSimpleview"
|
||||
[isMe]="message.senderSeq === loginRes.userSeq"
|
||||
(contextMenu)="onContextMenuMessage($event, message)"
|
||||
class="information-msg"
|
||||
></ucap-chat-message-box-translation>
|
||||
<ucap-chat-message-box-mass-translation
|
||||
|
@ -195,6 +196,7 @@
|
|||
[message]="message"
|
||||
[translationSimpleview]="translationSimpleview"
|
||||
[isMe]="message.senderSeq === loginRes.userSeq"
|
||||
(contextMenu)="onContextMenuMessage($event, message)"
|
||||
(massTranslationDetail)="onClickMassTranslationDetail($event)"
|
||||
>
|
||||
</ucap-chat-message-box-mass-translation>
|
||||
|
|
|
@ -78,6 +78,7 @@ export class MessagesComponent implements OnInit {
|
|||
contextMenu = new EventEmitter<{
|
||||
event: MouseEvent;
|
||||
message: Info<EventJson>;
|
||||
type?: string;
|
||||
}>();
|
||||
|
||||
messages: Info<EventJson>[];
|
||||
|
@ -248,7 +249,14 @@ export class MessagesComponent implements OnInit {
|
|||
}
|
||||
|
||||
/** [Event] Context Menu */
|
||||
onContextMenuMessage(event: MouseEvent, message: Info<EventJson>) {
|
||||
this.contextMenu.emit({ event, message });
|
||||
onContextMenuMessage(event: any, message: Info<EventJson>) {
|
||||
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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user