# 이슈처리

190 쪽지 제목 장문 작성 후 발송 시 발송되지 않음
This commit is contained in:
leejinho 2020-01-30 10:32:36 +09:00
parent 32cb30834e
commit 81c8a2b790
8 changed files with 208 additions and 73 deletions

View File

@ -4,7 +4,8 @@ import {
APIJsonEncoder,
APIDecoder,
APIFormDataEncoder,
ParameterUtil
ParameterUtil,
MessageStatusCode
} from '@ucap-webmessenger/api';
import { DeviceType } from '@ucap-webmessenger/core';
import { MessageType } from '../types/message.type';
@ -82,7 +83,7 @@ export const encodeSend: APIFormDataEncoder<SendRequest> = (
export const decodeSend: APIDecoder<SendResponse> = (res: any) => {
return {
responseCode: res.responseCode,
responseCode: res.responseCode as MessageStatusCode,
responseMsg: res.responseMsg
} as SendResponse;
};

View File

@ -168,7 +168,7 @@ export class MessageApiService {
'POST',
this.urls.sendNewMessage,
encodeSend(req),
{ reportProgress: true, responseType: 'text' as 'json' }
{ reportProgress: true }
);
const progress = req.fileUploadItem.uploadStart();
@ -196,7 +196,7 @@ export class MessageApiService {
'POST',
this.urls.editReservationMessageEx,
encodeEditReservation(req),
{ reportProgress: true, responseType: 'text' as 'json' }
{ reportProgress: true }
);
const progress = req.fileUploadItem.uploadStart();

View File

@ -1,57 +1,20 @@
import { UserSelectDialogType } from '../../../types/userselect.dialog.type';
import {
Component,
OnInit,
Output,
EventEmitter,
ViewChildren,
QueryList,
ElementRef,
OnDestroy,
ViewChild
} from '@angular/core';
import { NGXLogger } from 'ngx-logger';
import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui';
import {
CreateChatDialogComponent,
CreateChatDialogData,
CreateChatDialogResult
} from '@app/layouts/messenger/dialogs/chat/create-chat.dialog.component';
import { Subscription, Observable, merge } from 'rxjs';
import { ucapAnimations } from '@ucap-webmessenger/ui';
import { Subscription, Observable, } from 'rxjs';
import { Store, select } from '@ngrx/store';
import * as AppStore from '@app/store';
import * as ChatStore from '@app/store/messenger/chat';
import * as MessageStore from '@app/store/messenger/message';
import * as SyncStore from '@app/store/messenger/sync';
import * as SettingsStore from '@app/store/messenger/settings';
import { UserInfo } from '@ucap-webmessenger/protocol-sync';
import {
UserInfoSS,
UserInfoF,
UserInfoDN
} from '@ucap-webmessenger/protocol-query';
import { MatTabChangeEvent } from '@angular/material';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { MessageType } from '@ucap-webmessenger/api-message';
import { tap } from 'rxjs/operators';
import {
MessageWriteDialogComponent,
MessageWriteDialogResult,
MessageWriteDialogData
} from '../dialogs/message/message-write.dialog.component';
import {
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO,
KEY_VER_INFO,
MainMenu
} from '@app/types';
import { MessageBoxComponent } from './left-sidenav/message.component';
import { environment } from '../../../../environments/environment';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-layout-messenger-left-nav',

View File

@ -1,7 +1,13 @@
import { Component, OnInit, Inject, ViewChild } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { DialogService, SnackBarService } from '@ucap-webmessenger/ui';
import {
DialogService,
SnackBarService,
AlertDialogComponent,
AlertDialogResult,
AlertDialogData
} from '@ucap-webmessenger/ui';
import {
DetailResponse,
@ -32,13 +38,14 @@ import {
EnvironmentsInfo,
KEY_VER_INFO
} from '@app/types';
import { take } from 'rxjs/operators';
import { take, tap } from 'rxjs/operators';
import { UserInfoSS } from '@ucap-webmessenger/protocol-query';
import { TranslateService } from '@ngx-translate/core';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { environment } from '../../../../../environments/environment';
import { EmployeeType } from '@ucap-webmessenger/protocol-room';
import { MessageStatusCode } from '@ucap-webmessenger/api';
export interface MessageWriteDialogData {
loginRes: LoginResponse;
@ -155,6 +162,7 @@ export class MessageWriteDialogComponent implements OnInit {
.pipe(take(1))
.subscribe(
res => {
if (!!res && res.responseCode === MessageStatusCode.Success) {
let msg = '';
if (!!message.reservationTime) {
msg = this.translateService.instant(
@ -172,6 +180,75 @@ export class MessageWriteDialogComponent implements OnInit {
});
this.dialogRef.close({ sendFlag: true, sendType: message.type });
} else {
let alertType = 'S';
let errorMsg =
this.translateService.instant('message.errors.failToSending') +
`(${res.responseCode})`;
switch (res.responseCode) {
case MessageStatusCode.Fail_Msg_Reservation_Time_Null:
errorMsg = this.translateService.instant(
'message.errors.failToReservationTimeEmpty'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_Msg_Title_length:
errorMsg = this.translateService.instant(
'message.errors.failToTitleLength'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_Msg_Reservation_Time_Less:
case MessageStatusCode.Fail_Msg_Edit_Reservation_Time_Less:
errorMsg = this.translateService.instant(
'message.errors.failToReservationTimeLess'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_Msg_Edit_Cancel_Reservation_Sended:
errorMsg = this.translateService.instant(
'message.errors.failToReservationSended'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_File_Size:
errorMsg = this.translateService.instant(
'message.errors.failToFileSize'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_File_Ext:
errorMsg = this.translateService.instant(
'message.errors.failToFileExt'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_Cancelled_Msg:
errorMsg = this.translateService.instant(
'message.errors.failToCancelled'
);
alertType = 'A';
break;
}
if (alertType === 'S') {
this.snackBarService.open(errorMsg, '', {
duration: 3000,
verticalPosition: 'bottom'
});
} else {
this.dialogService.open<
AlertDialogComponent,
AlertDialogData,
AlertDialogResult
>(AlertDialogComponent, {
data: {
title: this.translateService.instant('message.errors.label'),
message: errorMsg
}
});
}
}
},
error => {
this.snackBarService.open(
@ -199,6 +276,7 @@ export class MessageWriteDialogComponent implements OnInit {
.pipe(take(1))
.subscribe(
res => {
if (!!res && res.responseCode === MessageStatusCode.Success) {
this.snackBarService.open(
this.translateService.instant(
'message.results.successForModifying'
@ -211,6 +289,75 @@ export class MessageWriteDialogComponent implements OnInit {
);
this.dialogRef.close({ sendFlag: true, sendType: message.type });
} else {
let alertType = 'S';
let errorMsg =
this.translateService.instant('message.errors.failToSending') +
`(${res.responseCode})`;
switch (res.responseCode) {
case MessageStatusCode.Fail_Msg_Reservation_Time_Null:
errorMsg = this.translateService.instant(
'message.errors.failToReservationTimeEmpty'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_Msg_Title_length:
errorMsg = this.translateService.instant(
'message.errors.failToTitleLength'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_Msg_Reservation_Time_Less:
case MessageStatusCode.Fail_Msg_Edit_Reservation_Time_Less:
errorMsg = this.translateService.instant(
'message.errors.failToReservationTimeLess'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_Msg_Edit_Cancel_Reservation_Sended:
errorMsg = this.translateService.instant(
'message.errors.failToReservationSended'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_File_Size:
errorMsg = this.translateService.instant(
'message.errors.failToFileSize'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_File_Ext:
errorMsg = this.translateService.instant(
'message.errors.failToFileExt'
);
alertType = 'A';
break;
case MessageStatusCode.Fail_Cancelled_Msg:
errorMsg = this.translateService.instant(
'message.errors.failToCancelled'
);
alertType = 'A';
break;
}
if (alertType === 'S') {
this.snackBarService.open(errorMsg, '', {
duration: 3000,
verticalPosition: 'bottom'
});
} else {
this.dialogService.open<
AlertDialogComponent,
AlertDialogData,
AlertDialogResult
>(AlertDialogComponent, {
data: {
title: this.translateService.instant('message.errors.label'),
message: errorMsg
}
});
}
}
},
error => {
this.snackBarService.open(

View File

@ -4,7 +4,11 @@
</div>
<div class="app-layout-native-title-bar-title">DS Talk</div>
<div class="btn-area">
<ucap-integrated-search-form (search)="onIntegratedSearch($event)" class="input-lineless integrated-search">
<ucap-integrated-search-form
*ngIf="!!loginRes"
(search)="onIntegratedSearch($event)"
class="input-lineless integrated-search"
>
</ucap-integrated-search-form>
<div
*ngIf="!!loginRes && !!weblink"
@ -147,7 +151,10 @@
</svg>
</button>
</div>
<span *ngIf="(!!weblink && weblink.length > 0) || (updateInfo$ | async)" class="stroke-bar"></span>
<span
*ngIf="(!!weblink && weblink.length > 0) || (updateInfo$ | async)"
class="stroke-bar"
></span>
<ucap-profile-my-profile-widget
[profileImageRoot]="sessionVerinfo.profileRoot"
[profileImageFile]="getMyProfileImageWidget()"

View File

@ -327,6 +327,13 @@
"label": "Message error",
"failToSending": "The message failed to send.",
"failToModify": "The message failed to modify.",
"failToReservationTimeEmpty": "No reservation time is specified.",
"failToTitleLength": "Title is too long",
"failToReservationTimeLess": "Reservation time can not be sent within 10 minutes.",
"failToReservationSended": "You can't edit a message that has already been sent.",
"failToFileSize": "The file you are uploading is larger than the limit.",
"failToFileExt": "The file you uploaded contains restricted files.",
"failToCancelled": "This message has been canceled.",
"minTimeReservation": "It can be set only 30 minutes after the current time.",
"cancelledError": "The message failed to cancel.",
"cancelledMessage": "This message has been cancelled."

View File

@ -327,6 +327,13 @@
"label": "쪽지 에러",
"failToSending": "쪽지를 전송에 실패 하였습니다.",
"failToModify": "쪽지 수정에 실패 하였습니다.",
"failToReservationTimeEmpty": "예약시간이 지정되어 있지 않습니다.",
"failToTitleLength": "제목이 너무 길게 입력되었습니다.",
"failToReservationTimeLess": "예약시간이 현재시간 기준 10분 이내에는 보낼수 없습니다.",
"failToReservationSended": "이미 발송된 메시지는 수정할 수 없습니다.",
"failToFileSize": "업로드 하는 파일의 용량이 제한크기보다 큽니다.",
"failToFileExt": "업로드 하는 파일에 제한된 파일이 포함되었습니다.",
"failToCancelled": "발송 취소된 메시지 입니다.",
"minTimeReservation": "현재 시각으로부터 30분 이후로만 설정 가능합니다.",
"cancelledError": "발송 취소에 실패 하였습니다.",
"cancelledMessage": "발송 취소된 쪽지 입니다."

View File

@ -58,9 +58,12 @@
<mat-form-field class="message-title">
<input
matInput
#inputTitle
formControlName="title"
placeholder="{{ 'message.fieldTitle' | translate }}"
maxlength="100"
/>
<mat-hint align="end">{{ inputTitle.value?.length || 0 }}/100</mat-hint>
</mat-form-field>
<div class="message-content">