음성파일 처리 및 expired 처리.

This commit is contained in:
leejh 2019-10-29 18:11:31 +09:00
parent 0bd29af831
commit 61fd8c00d7
11 changed files with 81 additions and 16 deletions

View File

@ -73,6 +73,7 @@
<perfect-scrollbar fxFlex="1 1 auto" #psChatContent> <perfect-scrollbar fxFlex="1 1 auto" #psChatContent>
<ucap-chat-messages <ucap-chat-messages
[messages]="eventList$ | async" [messages]="eventList$ | async"
[eventInfoStatus]="eventInfoStatus$ | async"
[userInfos]="userInfoList" [userInfos]="userInfoList"
[loginRes]="loginRes" [loginRes]="loginRes"
[sessionVerInfo]="sessionVerInfo" [sessionVerInfo]="sessionVerInfo"

View File

@ -23,7 +23,8 @@ import {
EventType, EventType,
isRecalled, isRecalled,
isCopyable, isCopyable,
isRecallable isRecallable,
InfoResponse
} from '@ucap-webmessenger/protocol-event'; } from '@ucap-webmessenger/protocol-event';
import * as AppStore from '@app/store'; import * as AppStore from '@app/store';
@ -84,6 +85,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
userInfoList: UserInfo[]; userInfoList: UserInfo[];
userInfoListSubscription: Subscription; userInfoListSubscription: Subscription;
eventListProcessing$: Observable<boolean>; eventListProcessing$: Observable<boolean>;
eventInfoStatus$: Observable<InfoResponse>;
sessionVerInfo: VersionInfo2Response; sessionVerInfo: VersionInfo2Response;
isRecalledMessage = isRecalled; isRecalledMessage = isRecalled;
@ -147,6 +149,10 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
select(AppStore.MessengerSelector.EventSelector.selectAllInfoList) select(AppStore.MessengerSelector.EventSelector.selectAllInfoList)
); );
this.eventInfoStatus$ = this.store.pipe(
select(AppStore.MessengerSelector.EventSelector.infoStatus)
);
this.psChatContent.directiveRef.scrollToBottom(0, 0); this.psChatContent.directiveRef.scrollToBottom(0, 0);
} }

View File

@ -1,20 +1,23 @@
<div class="bubble-main"> <div class="bubble-main">
<!--파일명에 따라 doc exe hwp ppt xls zip 으로 추가되고 나머지 파일 명은 file로 기간이 만료된 파일은 그뒤에 disable도 추가--> <!--파일명에 따라 doc exe hwp ppt xls zip 으로 추가되고 나머지 파일 명은 file로 기간이 만료된 파일은 그뒤에 disable도 추가-->
<div class="file-img ppt"></div> <div class="file-img" [ngClass]="fileInfo.FileExt"></div>
<ul class="file-info"> <ul class="file-info">
<li class="file-name"> <li class="file-name">
{{ fileInfo.FileName }} {{ fileInfo.FileName }}
</li> </li>
<li class="file-size"> <li class="file-size">
{{ fileInfo.AttSize }} {{ fileInfo.AttSize | ucapBytes }}
</li> </li>
<li class="file-ext"> <li class="file-ext">
{{ fileInfo.FileExt }} {{ fileInfo.FileExt }}
</li> </li>
</ul> </ul>
</div> </div>
<div *ngIf="fileInfo && fileInfo.AttSEQ" class="btn-box"> <div class="btn-box">
<ul> <ul *ngIf="expired">
<li>기간이 만료된 파일입니다.</li>
</ul>
<ul *ngIf="!expired && fileInfo && fileInfo.AttSEQ">
<li> <li>
<button mat-button (click)="onClickSave()">Save</button> <button mat-button (click)="onClickSave()">Save</button>
</li> </li>

View File

@ -33,13 +33,15 @@
background-image: url(/assets/images/file/icon_talk_hwp_d.png); background-image: url(/assets/images/file/icon_talk_hwp_d.png);
} }
} }
&.ppt { &.ppt,
&.pptx {
background-image: url(/assets/images/file/icon_talk_ppt.png); background-image: url(/assets/images/file/icon_talk_ppt.png);
&.disable { &.disable {
background-image: url(/assets/images/file/icon_talk_ppt_d.png); background-image: url(/assets/images/file/icon_talk_ppt_d.png);
} }
} }
&.xls { &.xls,
&.xlsx {
background-image: url(/assets/images/file/icon_talk_xls.png); background-image: url(/assets/images/file/icon_talk_xls.png);
&.disable { &.disable {
background-image: url(/assets/images/file/icon_talk_xls_d.png); background-image: url(/assets/images/file/icon_talk_xls_d.png);

View File

@ -10,6 +10,9 @@ import { NGXLogger } from 'ngx-logger';
export class AttachFileComponent implements OnInit { export class AttachFileComponent implements OnInit {
@Input() @Input()
fileInfo: FileInfo; fileInfo: FileInfo;
@Input()
expired = false;
@Output() @Output()
save = new EventEmitter<string>(); save = new EventEmitter<string>();

View File

@ -1,9 +1,35 @@
<ng-container *ngIf="fileInfo && fileInfo.FileType" [ngSwitch]="fileInfo.FileType"> <ng-container
<ucap-chat-message-box-attach-file *ngSwitchCase="FileType.File" [fileInfo]="fileInfo" (save)="onSave($event)"> *ngIf="fileInfo && fileInfo.FileType"
[ngSwitch]="fileInfo.FileType"
>
<ucap-chat-message-box-attach-file
*ngSwitchCase="FileType.File"
[fileInfo]="fileInfo"
[expired]="getExpiredFile()"
(save)="onSave($event)"
>
</ucap-chat-message-box-attach-file> </ucap-chat-message-box-attach-file>
<ucap-chat-message-box-image *ngSwitchCase="FileType.Image" [fileInfo]="fileInfo" <ucap-chat-message-box-attach-file
(click)="onClickImageViewer(fileInfo)"></ucap-chat-message-box-image> *ngSwitchCase="FileType.Sound"
<ucap-chat-message-box-video *ngSwitchCase="FileType.Video" [fileInfo]="fileInfo" [fileInfo]="fileInfo"
(click)="onClickImageViewer(fileInfo)"></ucap-chat-message-box-video> [expired]="getExpiredFile()"
<ucap-chat-message-box-text *ngSwitchDefault [message]="message"></ucap-chat-message-box-text> (save)="onSave($event)"
>
</ucap-chat-message-box-attach-file>
<ucap-chat-message-box-image
*ngSwitchCase="FileType.Image"
[fileInfo]="fileInfo"
[expired]="getExpiredFile()"
(click)="onClickImageViewer(fileInfo)"
></ucap-chat-message-box-image>
<ucap-chat-message-box-video
*ngSwitchCase="FileType.Video"
[fileInfo]="fileInfo"
[expired]="getExpiredFile()"
(click)="onClickImageViewer(fileInfo)"
></ucap-chat-message-box-video>
<ucap-chat-message-box-text
*ngSwitchDefault
[message]="message"
></ucap-chat-message-box-text>
</ng-container> </ng-container>

View File

@ -1,5 +1,5 @@
import { Component, OnInit, Output, Input, EventEmitter } from '@angular/core'; import { Component, OnInit, Output, Input, EventEmitter } from '@angular/core';
import { Info } from '@ucap-webmessenger/protocol-event'; import { Info, InfoResponse } from '@ucap-webmessenger/protocol-event';
import { StatusCode } from '@ucap-webmessenger/api'; import { StatusCode } from '@ucap-webmessenger/api';
import { FileType } from '@ucap-webmessenger/protocol-file'; import { FileType } from '@ucap-webmessenger/protocol-file';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
@ -13,6 +13,8 @@ import { FileInfo } from '../../models/file-info.json';
export class FileComponent implements OnInit { export class FileComponent implements OnInit {
@Input() @Input()
message: Info; message: Info;
@Input()
eventInfoStatus: InfoResponse;
@Output() @Output()
save = new EventEmitter<{ fileInfo: FileInfo; type: string }>(); save = new EventEmitter<{ fileInfo: FileInfo; type: string }>();
@ -34,6 +36,17 @@ export class FileComponent implements OnInit {
} }
} }
getExpiredFile() {
if (
!!this.eventInfoStatus &&
this.eventInfoStatus.validFileBaseSeq < this.message.seq
) {
return false;
} else {
return true;
}
}
onClickImageViewer(fileInfo: FileInfo) { onClickImageViewer(fileInfo: FileInfo) {
this.imageViewer.emit(this.fileInfo); this.imageViewer.emit(this.fileInfo);
} }

View File

@ -10,6 +10,8 @@ import { FileInfo } from '../../models/file-info.json';
export class ImageComponent implements OnInit { export class ImageComponent implements OnInit {
@Input() @Input()
fileInfo: FileInfo; fileInfo: FileInfo;
@Input()
expired = false;
constructor(private logger: NGXLogger) {} constructor(private logger: NGXLogger) {}

View File

@ -10,6 +10,8 @@ import { FileInfo } from '../../models/file-info.json';
export class VideoComponent implements OnInit { export class VideoComponent implements OnInit {
@Input() @Input()
fileInfo: FileInfo; fileInfo: FileInfo;
@Input()
expired = false;
constructor(private logger: NGXLogger) {} constructor(private logger: NGXLogger) {}

View File

@ -103,6 +103,7 @@
</ucap-chat-message-box-mass> </ucap-chat-message-box-mass>
<ucap-chat-message-box-file <ucap-chat-message-box-file
*ngSwitchCase="EventType.File" *ngSwitchCase="EventType.File"
[eventInfoStatus]="eventInfoStatus"
[message]="message" [message]="message"
(save)="onSave($event)" (save)="onSave($event)"
(imageViewer)="onImageViewer($event)" (imageViewer)="onImageViewer($event)"

View File

@ -7,7 +7,11 @@ import {
ViewEncapsulation ViewEncapsulation
} from '@angular/core'; } from '@angular/core';
import { Info, EventType } from '@ucap-webmessenger/protocol-event'; import {
Info,
EventType,
InfoResponse
} from '@ucap-webmessenger/protocol-event';
import { import {
LoginResponse, LoginResponse,
UserInfo UserInfo
@ -28,6 +32,8 @@ export class MessagesComponent implements OnInit {
@Input() @Input()
messages: Info[]; messages: Info[];
@Input() @Input()
eventInfoStatus?: InfoResponse;
@Input()
userInfos?: UserInfo[]; userInfos?: UserInfo[];
@Input() @Input()
sessionVerInfo: VersionInfo2Response; sessionVerInfo: VersionInfo2Response;