# 이슈처리
172 번역on 후 스티커 발신 시 발신되지 않음 175 쪽지 검색 후 스크롤 시 플로팅 버튼 고정되지 않음 178 동일한 그룹에 대화 상대 이동시 사용자 사라짐 182 퇴장/강퇴한 사용자 그룹멤버 추가되어 있음
This commit is contained in:
parent
bbebd8bedc
commit
9153a92dab
|
@ -563,7 +563,8 @@ export class GroupComponent implements OnInit, OnDestroy {
|
|||
>(SelectGroupDialogComponent, {
|
||||
width: '600px',
|
||||
data: {
|
||||
title: this.translateService.instant('group.selectTargetGroup')
|
||||
title: this.translateService.instant('group.selectTargetGroup'),
|
||||
ignoreGroup: [group]
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -88,10 +88,10 @@
|
|||
</mat-tab-group>
|
||||
</div>
|
||||
|
||||
<div [style.display]="isSearch ? 'block' : 'none'">
|
||||
<div class="message-section" [style.display]="isSearch ? 'block' : 'none'">
|
||||
<div class="search-sub">
|
||||
<form [formGroup]="fgSearchType" class="w-100-p">
|
||||
<mat-form-field>
|
||||
<mat-form-field style="width: 100px;">
|
||||
<mat-select
|
||||
formControlName="searchMessageType"
|
||||
(selectionChange)="onChangeSelection($event)"
|
||||
|
@ -127,13 +127,15 @@
|
|||
</mat-radio-group>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<ucap-message-list-item
|
||||
*ngFor="let message of messageSearchList$ | async"
|
||||
[message]="message"
|
||||
(click)="onClickDetail(message)"
|
||||
class="message-item"
|
||||
></ucap-message-list-item>
|
||||
<div style="height: calc(100% - 65.5px)">
|
||||
<perfect-scrollbar fxFlex="1 1 auto">
|
||||
<ucap-message-list-item
|
||||
*ngFor="let message of messageSearchList$ | async"
|
||||
[message]="message"
|
||||
(click)="onClickDetail(message)"
|
||||
class="message-item"
|
||||
></ucap-message-list-item>
|
||||
</perfect-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
(click)="onToggleUser(userInfo)"
|
||||
(contextmenu)="onContextMenuOrgUser($event, userInfo)"
|
||||
[matTooltip]="getTooltip(userInfo)"
|
||||
matTooltipShowDelay="500"
|
||||
matTooltipPosition="after"
|
||||
>
|
||||
</ucap-profile-user-list-item>
|
||||
|
@ -105,6 +106,7 @@
|
|||
(click)="onToggleUser(userInfo)"
|
||||
(contextmenu)="onContextMenuOrgUser($event, userInfo)"
|
||||
[matTooltip]="getTooltip(userInfo)"
|
||||
matTooltipShowDelay="500"
|
||||
matTooltipPosition="after"
|
||||
>
|
||||
</ucap-profile-user-list-item>
|
||||
|
|
|
@ -638,170 +638,190 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
|
||||
if (!!this.isShowTranslation && this.destLocale.trim().length > 0) {
|
||||
/** CASE : Translation */
|
||||
const destLocale = this.destLocale;
|
||||
const original = message;
|
||||
const roomSeq = this.roomInfoSubject.value.roomSeq;
|
||||
|
||||
if (!!this.isTranslationProcess) {
|
||||
return;
|
||||
// 번역할 대화 없이 스티커만 전송할 경우.
|
||||
if (!message || message.trim().length === 0) {
|
||||
this.sendMessageOfSticker(message);
|
||||
} else {
|
||||
this.sendMessageOfTranslate(message);
|
||||
}
|
||||
|
||||
this.isTranslationProcess = true;
|
||||
this.commonApiService
|
||||
.translationSave({
|
||||
userSeq: this.loginResSubject.value.userSeq,
|
||||
deviceType: this.environmentsInfo.deviceType,
|
||||
token: this.loginResSubject.value.tokenString,
|
||||
roomSeq,
|
||||
original,
|
||||
srcLocale: '',
|
||||
destLocale
|
||||
} as TranslationSaveRequest)
|
||||
.pipe(
|
||||
take(1),
|
||||
map(res => {
|
||||
if (res.statusCode === StatusCode.Success) {
|
||||
let sentMessage = '';
|
||||
let eventType = EventType.Translation;
|
||||
let previewObject:
|
||||
| TranslationEventJson
|
||||
| MassTranslationEventJson;
|
||||
|
||||
if (res.translationSeq > 0) {
|
||||
// Mass Text Translation
|
||||
previewObject = res;
|
||||
sentMessage = res.returnJson;
|
||||
eventType = EventType.MassTranslation;
|
||||
} else {
|
||||
// Normal Text Translation
|
||||
previewObject = {
|
||||
locale: destLocale,
|
||||
original,
|
||||
translation: res.translation,
|
||||
stickername: '',
|
||||
stickerfile: !!this.selectedSticker
|
||||
? this.selectedSticker.index
|
||||
: ''
|
||||
};
|
||||
|
||||
sentMessage = JSON.stringify(previewObject);
|
||||
eventType = EventType.Translation;
|
||||
}
|
||||
|
||||
if (!!this.translationPreview) {
|
||||
// preview
|
||||
this.translationPreviewInfo = {
|
||||
previewInfo: res,
|
||||
translationType: eventType
|
||||
};
|
||||
} else {
|
||||
// direct send
|
||||
this.store.dispatch(
|
||||
EventStore.send({
|
||||
senderSeq: this.loginResSubject.value.userSeq,
|
||||
req: {
|
||||
roomSeq,
|
||||
eventType,
|
||||
sentMessage
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
if (!!this.translationPreviewInfo) {
|
||||
this.translationPreviewInfo = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!!this.selectedSticker) {
|
||||
this.isShowStickerSelector = false;
|
||||
this.setStickerHistory(this.selectedSticker);
|
||||
this.selectedSticker = null;
|
||||
}
|
||||
} else {
|
||||
this.logger.error(res);
|
||||
}
|
||||
}),
|
||||
catchError(error => of(this.logger.error(error)))
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.isTranslationProcess = false;
|
||||
});
|
||||
} else if (!!this.selectedSticker) {
|
||||
/** CASE : Sticker */
|
||||
if (
|
||||
!!message &&
|
||||
message.trim().length >
|
||||
environment.productConfig.CommonSetting.masstextLength
|
||||
) {
|
||||
const result = await this.dialogService.open<
|
||||
AlertDialogComponent,
|
||||
AlertDialogData,
|
||||
AlertDialogResult
|
||||
>(AlertDialogComponent, {
|
||||
width: '360px',
|
||||
data: {
|
||||
title: this.translateService.instant('chat.errors.label'),
|
||||
message: this.translateService.instant(
|
||||
'chat.errors.maxLengthOfMassText',
|
||||
{
|
||||
maxLength:
|
||||
environment.productConfig.CommonSetting.masstextLength
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const stickerJson: StickerEventJson = {
|
||||
name: '스티커',
|
||||
file: this.selectedSticker.index,
|
||||
chat: !!message ? message.trim() : ''
|
||||
};
|
||||
this.store.dispatch(
|
||||
EventStore.send({
|
||||
senderSeq: this.loginResSubject.value.userSeq,
|
||||
req: {
|
||||
roomSeq: this.roomInfoSubject.value.roomSeq,
|
||||
eventType: EventType.Sticker,
|
||||
sentMessage: JSON.stringify(stickerJson)
|
||||
}
|
||||
})
|
||||
);
|
||||
this.isShowStickerSelector = false;
|
||||
this.setStickerHistory(this.selectedSticker);
|
||||
this.selectedSticker = null;
|
||||
this.sendMessageOfSticker(message);
|
||||
} else if (
|
||||
message.trim().length >
|
||||
environment.productConfig.CommonSetting.masstextLength
|
||||
) {
|
||||
/** CASE : MASS TEXT */
|
||||
this.store.dispatch(
|
||||
EventStore.sendMass({
|
||||
senderSeq: this.loginResSubject.value.userSeq,
|
||||
req: {
|
||||
roomSeq: this.roomInfoSubject.value.roomSeq,
|
||||
eventType: EventType.MassText,
|
||||
// sentMessage: message.replace(/\n/gi, '\r\n')
|
||||
sentMessage: message
|
||||
}
|
||||
})
|
||||
);
|
||||
this.sendMessageOfMassText(message);
|
||||
} else {
|
||||
/** CASE : Normal Text */
|
||||
this.store.dispatch(
|
||||
EventStore.send({
|
||||
senderSeq: this.loginResSubject.value.userSeq,
|
||||
req: {
|
||||
roomSeq: this.roomInfoSubject.value.roomSeq,
|
||||
eventType: EventType.Character,
|
||||
sentMessage: message
|
||||
}
|
||||
})
|
||||
);
|
||||
this.sendMessageOfNormal(message);
|
||||
}
|
||||
}
|
||||
|
||||
/** Send Normal message */
|
||||
sendMessageOfNormal(message: string) {
|
||||
this.store.dispatch(
|
||||
EventStore.send({
|
||||
senderSeq: this.loginResSubject.value.userSeq,
|
||||
req: {
|
||||
roomSeq: this.roomInfoSubject.value.roomSeq,
|
||||
eventType: EventType.Character,
|
||||
sentMessage: message
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
/** Send Sticker message */
|
||||
async sendMessageOfSticker(message: string, isCheck: boolean = true) {
|
||||
if (
|
||||
!!isCheck &&
|
||||
!!message &&
|
||||
message.trim().length >
|
||||
environment.productConfig.CommonSetting.masstextLength
|
||||
) {
|
||||
const result = await this.dialogService.open<
|
||||
AlertDialogComponent,
|
||||
AlertDialogData,
|
||||
AlertDialogResult
|
||||
>(AlertDialogComponent, {
|
||||
width: '360px',
|
||||
data: {
|
||||
title: this.translateService.instant('chat.errors.label'),
|
||||
message: this.translateService.instant(
|
||||
'chat.errors.maxLengthOfMassText',
|
||||
{
|
||||
maxLength: environment.productConfig.CommonSetting.masstextLength
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const stickerJson: StickerEventJson = {
|
||||
name: '스티커',
|
||||
file: this.selectedSticker.index,
|
||||
chat: !!message ? message.trim() : ''
|
||||
};
|
||||
this.store.dispatch(
|
||||
EventStore.send({
|
||||
senderSeq: this.loginResSubject.value.userSeq,
|
||||
req: {
|
||||
roomSeq: this.roomInfoSubject.value.roomSeq,
|
||||
eventType: EventType.Sticker,
|
||||
sentMessage: JSON.stringify(stickerJson)
|
||||
}
|
||||
})
|
||||
);
|
||||
this.isShowStickerSelector = false;
|
||||
this.setStickerHistory(this.selectedSticker);
|
||||
this.selectedSticker = null;
|
||||
}
|
||||
/** Send Masstext message */
|
||||
sendMessageOfMassText(message: string) {
|
||||
this.store.dispatch(
|
||||
EventStore.sendMass({
|
||||
senderSeq: this.loginResSubject.value.userSeq,
|
||||
req: {
|
||||
roomSeq: this.roomInfoSubject.value.roomSeq,
|
||||
eventType: EventType.MassText,
|
||||
// sentMessage: message.replace(/\n/gi, '\r\n')
|
||||
sentMessage: message
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
/** Send Translation message */
|
||||
sendMessageOfTranslate(message: string) {
|
||||
const destLocale = this.destLocale;
|
||||
const original = message;
|
||||
const roomSeq = this.roomInfoSubject.value.roomSeq;
|
||||
|
||||
if (!!this.isTranslationProcess) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isTranslationProcess = true;
|
||||
this.commonApiService
|
||||
.translationSave({
|
||||
userSeq: this.loginResSubject.value.userSeq,
|
||||
deviceType: this.environmentsInfo.deviceType,
|
||||
token: this.loginResSubject.value.tokenString,
|
||||
roomSeq,
|
||||
original,
|
||||
srcLocale: '',
|
||||
destLocale
|
||||
} as TranslationSaveRequest)
|
||||
.pipe(
|
||||
take(1),
|
||||
map(res => {
|
||||
if (res.statusCode === StatusCode.Success) {
|
||||
let sentMessage = '';
|
||||
let eventType = EventType.Translation;
|
||||
let previewObject: TranslationEventJson | MassTranslationEventJson;
|
||||
|
||||
if (res.translationSeq > 0) {
|
||||
// Mass Text Translation
|
||||
previewObject = res;
|
||||
sentMessage = res.returnJson;
|
||||
eventType = EventType.MassTranslation;
|
||||
} else {
|
||||
// Normal Text Translation
|
||||
previewObject = {
|
||||
locale: destLocale,
|
||||
original,
|
||||
translation: res.translation,
|
||||
stickername: '',
|
||||
stickerfile: !!this.selectedSticker
|
||||
? this.selectedSticker.index
|
||||
: ''
|
||||
};
|
||||
|
||||
sentMessage = JSON.stringify(previewObject);
|
||||
eventType = EventType.Translation;
|
||||
}
|
||||
|
||||
if (!!this.translationPreview) {
|
||||
// preview
|
||||
this.translationPreviewInfo = {
|
||||
previewInfo: res,
|
||||
translationType: eventType
|
||||
};
|
||||
} else {
|
||||
// direct send
|
||||
this.store.dispatch(
|
||||
EventStore.send({
|
||||
senderSeq: this.loginResSubject.value.userSeq,
|
||||
req: {
|
||||
roomSeq,
|
||||
eventType,
|
||||
sentMessage
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
if (!!this.translationPreviewInfo) {
|
||||
this.translationPreviewInfo = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!!this.selectedSticker) {
|
||||
this.isShowStickerSelector = false;
|
||||
this.setStickerHistory(this.selectedSticker);
|
||||
this.selectedSticker = null;
|
||||
}
|
||||
} else {
|
||||
this.logger.error(res);
|
||||
}
|
||||
}),
|
||||
catchError(error => of(this.logger.error(error)))
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.isTranslationProcess = false;
|
||||
});
|
||||
}
|
||||
|
||||
onClickReceiveAlarm() {
|
||||
this.store.dispatch(
|
||||
RoomStore.updateOnlyAlarm({ roomInfo: this.roomInfoSubject.value })
|
||||
|
@ -1592,6 +1612,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
const trgtUserSeq: number[] = [];
|
||||
result.group.userSeqs.map(seq => trgtUserSeq.push(seq));
|
||||
this.userInfoListSubject.value
|
||||
.filter(v => v.isJoinRoom)
|
||||
.filter(v => result.group.userSeqs.indexOf(v.seq) < 0)
|
||||
.forEach(user => {
|
||||
trgtUserSeq.push(user.seq);
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
<mat-list-option
|
||||
*ngFor="let groupBuddy of groupBuddyList$ | async"
|
||||
[value]="groupBuddy.group"
|
||||
[disabled]="getDisabled(groupBuddy)"
|
||||
class="group-name"
|
||||
>
|
||||
<span class="title-name ellipsis"> {{ groupBuddy.group.name }} </span>
|
||||
|
|
|
@ -24,6 +24,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|||
|
||||
export interface SelectGroupDialogData {
|
||||
title: string;
|
||||
ignoreGroup?: GroupDetailData[];
|
||||
}
|
||||
|
||||
export interface SelectGroupDialogResult {
|
||||
|
@ -71,6 +72,44 @@ export class SelectGroupDialogComponent implements OnInit {
|
|||
)
|
||||
]).pipe(
|
||||
map(([buddyList, groupList]) => {
|
||||
// sort..
|
||||
if (!!groupList && groupList.length > 0) {
|
||||
const tempOrderArr: GroupDetailData[] = [];
|
||||
let myDeptGroup: GroupDetailData;
|
||||
let defaultGroup: GroupDetailData;
|
||||
const normalGroup: GroupDetailData[] = [];
|
||||
|
||||
groupList.forEach(group => {
|
||||
if (
|
||||
!!environment.productConfig.CommonSetting.useMyDeptGroup &&
|
||||
environment.productConfig.CommonSetting.myDeptGroupSeq ===
|
||||
group.seq
|
||||
) {
|
||||
myDeptGroup = group;
|
||||
} else if (0 === group.seq) {
|
||||
defaultGroup = group;
|
||||
} else {
|
||||
normalGroup.push(group);
|
||||
}
|
||||
});
|
||||
|
||||
if (!!myDeptGroup) {
|
||||
tempOrderArr.push(myDeptGroup);
|
||||
}
|
||||
|
||||
tempOrderArr.push(
|
||||
...normalGroup.sort((a, b) =>
|
||||
a.name < b.name ? -1 : a.name > b.name ? 1 : 0
|
||||
)
|
||||
);
|
||||
|
||||
if (!!defaultGroup) {
|
||||
tempOrderArr.push(defaultGroup);
|
||||
}
|
||||
|
||||
groupList = tempOrderArr;
|
||||
}
|
||||
|
||||
/** 수정불가 그룹 */
|
||||
let fixedGroupSeqs: number[];
|
||||
if (!!environment.productConfig.CommonSetting.fixedGroupSeqs) {
|
||||
|
@ -90,6 +129,17 @@ export class SelectGroupDialogComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
/** 선택 무시 그룹 필터링. */
|
||||
if (!!this.data.ignoreGroup && this.data.ignoreGroup.length > 0) {
|
||||
if (
|
||||
this.data.ignoreGroup.filter(
|
||||
groupDetail => groupDetail.seq === group.seq
|
||||
).length > 0
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
groupBuddyList.push({
|
||||
group,
|
||||
buddyList: buddyList.filter(buddy => {
|
||||
|
@ -140,4 +190,18 @@ export class SelectGroupDialogComponent implements OnInit {
|
|||
group: this.selectedGroup
|
||||
});
|
||||
}
|
||||
|
||||
getDisabled(groupBuddyList: {
|
||||
group: GroupDetailData;
|
||||
buddyList: UserInfo[];
|
||||
}): boolean {
|
||||
if (!!this.data.ignoreGroup && this.data.ignoreGroup.length > 0) {
|
||||
return (
|
||||
this.data.ignoreGroup.filter(
|
||||
groupDetail => groupDetail.seq === groupBuddyList.group.seq
|
||||
).length > 0
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user