# 이슈처리

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

View File

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

View File

@ -1,57 +1,20 @@
import { UserSelectDialogType } from '../../../types/userselect.dialog.type';
import { import {
Component, Component,
OnInit, OnInit,
Output,
EventEmitter,
ViewChildren,
QueryList,
ElementRef,
OnDestroy, OnDestroy,
ViewChild
} from '@angular/core'; } from '@angular/core';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui'; import { ucapAnimations } from '@ucap-webmessenger/ui';
import { import { Subscription, Observable, } from 'rxjs';
CreateChatDialogComponent,
CreateChatDialogData,
CreateChatDialogResult
} from '@app/layouts/messenger/dialogs/chat/create-chat.dialog.component';
import { Subscription, Observable, merge } from 'rxjs';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import * as AppStore from '@app/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 MessageStore from '@app/store/messenger/message';
import * as SyncStore from '@app/store/messenger/sync';
import * as SettingsStore from '@app/store/messenger/settings'; 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 { 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 { import {
MessageWriteDialogComponent,
MessageWriteDialogResult,
MessageWriteDialogData
} from '../dialogs/message/message-write.dialog.component';
import {
EnvironmentsInfo,
KEY_ENVIRONMENTS_INFO,
KEY_VER_INFO,
MainMenu MainMenu
} from '@app/types'; } from '@app/types';
import { MessageBoxComponent } from './left-sidenav/message.component';
import { environment } from '../../../../environments/environment';
import { TranslateService } from '@ngx-translate/core';
@Component({ @Component({
selector: 'app-layout-messenger-left-nav', selector: 'app-layout-messenger-left-nav',

View File

@ -1,7 +1,13 @@
import { Component, OnInit, Inject, ViewChild } from '@angular/core'; import { Component, OnInit, Inject, ViewChild } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; 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 { import {
DetailResponse, DetailResponse,
@ -32,13 +38,14 @@ import {
EnvironmentsInfo, EnvironmentsInfo,
KEY_VER_INFO KEY_VER_INFO
} from '@app/types'; } from '@app/types';
import { take } from 'rxjs/operators'; import { take, tap } from 'rxjs/operators';
import { UserInfoSS } from '@ucap-webmessenger/protocol-query'; import { UserInfoSS } from '@ucap-webmessenger/protocol-query';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { environment } from '../../../../../environments/environment'; import { environment } from '../../../../../environments/environment';
import { EmployeeType } from '@ucap-webmessenger/protocol-room'; import { EmployeeType } from '@ucap-webmessenger/protocol-room';
import { MessageStatusCode } from '@ucap-webmessenger/api';
export interface MessageWriteDialogData { export interface MessageWriteDialogData {
loginRes: LoginResponse; loginRes: LoginResponse;
@ -155,6 +162,7 @@ export class MessageWriteDialogComponent implements OnInit {
.pipe(take(1)) .pipe(take(1))
.subscribe( .subscribe(
res => { res => {
if (!!res && res.responseCode === MessageStatusCode.Success) {
let msg = ''; let msg = '';
if (!!message.reservationTime) { if (!!message.reservationTime) {
msg = this.translateService.instant( msg = this.translateService.instant(
@ -172,6 +180,75 @@ export class MessageWriteDialogComponent implements OnInit {
}); });
this.dialogRef.close({ sendFlag: true, sendType: message.type }); 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 => { error => {
this.snackBarService.open( this.snackBarService.open(
@ -199,6 +276,7 @@ export class MessageWriteDialogComponent implements OnInit {
.pipe(take(1)) .pipe(take(1))
.subscribe( .subscribe(
res => { res => {
if (!!res && res.responseCode === MessageStatusCode.Success) {
this.snackBarService.open( this.snackBarService.open(
this.translateService.instant( this.translateService.instant(
'message.results.successForModifying' 'message.results.successForModifying'
@ -211,6 +289,75 @@ export class MessageWriteDialogComponent implements OnInit {
); );
this.dialogRef.close({ sendFlag: true, sendType: message.type }); 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 => { error => {
this.snackBarService.open( this.snackBarService.open(

View File

@ -4,7 +4,11 @@
</div> </div>
<div class="app-layout-native-title-bar-title">DS Talk</div> <div class="app-layout-native-title-bar-title">DS Talk</div>
<div class="btn-area"> <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> </ucap-integrated-search-form>
<div <div
*ngIf="!!loginRes && !!weblink" *ngIf="!!loginRes && !!weblink"
@ -147,7 +151,10 @@
</svg> </svg>
</button> </button>
</div> </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 <ucap-profile-my-profile-widget
[profileImageRoot]="sessionVerinfo.profileRoot" [profileImageRoot]="sessionVerinfo.profileRoot"
[profileImageFile]="getMyProfileImageWidget()" [profileImageFile]="getMyProfileImageWidget()"

View File

@ -327,6 +327,13 @@
"label": "Message error", "label": "Message error",
"failToSending": "The message failed to send.", "failToSending": "The message failed to send.",
"failToModify": "The message failed to modify.", "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.", "minTimeReservation": "It can be set only 30 minutes after the current time.",
"cancelledError": "The message failed to cancel.", "cancelledError": "The message failed to cancel.",
"cancelledMessage": "This message has been cancelled." "cancelledMessage": "This message has been cancelled."

View File

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

View File

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