# Conflicts:
#	projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.html
This commit is contained in:
leejinho 2020-01-06 17:34:50 +09:00
commit 085f625ef6
14 changed files with 428 additions and 180 deletions

View File

@ -11,6 +11,9 @@ import { AppService } from './services/app.service';
import { environment } from '../environments/environment'; import { environment } from '../environments/environment';
import { BrowserNativeService } from '@ucap-webmessenger/native-browser'; import { BrowserNativeService } from '@ucap-webmessenger/native-browser';
import { ElectronNativeService } from '@ucap-webmessenger/native-electron'; import { ElectronNativeService } from '@ucap-webmessenger/native-electron';
import { MatPaginatorIntl, MatPaginatorModule } from '@angular/material';
import { PaginatorIntlService } from '@ucap-webmessenger/ui';
import { TranslateService } from '@ngx-translate/core';
export function initializeApp( export function initializeApp(
appService: AppService, appService: AppService,
@ -22,7 +25,7 @@ export function initializeApp(
} }
@NgModule({ @NgModule({
imports: [], imports: [MatPaginatorModule],
exports: [], exports: [],
providers: [ providers: [
{ {
@ -34,6 +37,10 @@ export function initializeApp(
: ElectronNativeService, : ElectronNativeService,
deps: [HttpClient] deps: [HttpClient]
}, },
{
provide: MatPaginatorIntl,
useClass: PaginatorIntlService
},
...SERVICES, ...SERVICES,
...RESOLVERS, ...RESOLVERS,
{ {

View File

@ -177,10 +177,12 @@
" "
(click)="onClickProfileContextMenu('REGISTER_FAVORITE', userInfo)" (click)="onClickProfileContextMenu('REGISTER_FAVORITE', userInfo)"
> >
즐겨찾기 {{ userInfo.isFavorit ? '해제' : '등록' }} {{
(userInfo.isFavorit ? 'group.unfavorite' : 'group.favorite') | translate
}}
</button> </button>
<button mat-menu-item (click)="onClickProfileContextMenu('CHAT', userInfo)"> <button mat-menu-item (click)="onClickProfileContextMenu('CHAT', userInfo)">
대화하기 {{ 'chat.startChat' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
@ -194,7 +196,7 @@
" "
(click)="onClickProfileContextMenu('REMOVE_FROM_GROUP', userInfo, group)" (click)="onClickProfileContextMenu('REMOVE_FROM_GROUP', userInfo, group)"
> >
이 그룹에서 삭제 {{ 'group.removeBuddyFromGroup' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
@ -203,7 +205,7 @@
" "
(click)="onClickProfileContextMenu('COPY_BUDDY', userInfo)" (click)="onClickProfileContextMenu('COPY_BUDDY', userInfo)"
> >
대화 상대 복사 {{ 'group.copyBuddyToGroup' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
@ -212,7 +214,7 @@
" "
(click)="onClickProfileContextMenu('MOVE_BUDDY', userInfo, group)" (click)="onClickProfileContextMenu('MOVE_BUDDY', userInfo, group)"
> >
대화 상대 이동 {{ 'group.moveBuddyToGroup' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
@ -221,7 +223,7 @@
" "
(click)="onClickProfileContextMenu('SEND_MESSAGE', userInfo)" (click)="onClickProfileContextMenu('SEND_MESSAGE', userInfo)"
> >
쪽지 보내기 {{ 'message.sendTo' | translate }}
</button> </button>
<!-- <button <!-- <button
mat-menu-item mat-menu-item
@ -251,14 +253,14 @@
*ngIf="getShowGroupContextMenu('CHAT', group)" *ngIf="getShowGroupContextMenu('CHAT', group)"
(click)="onClickGroupContextMenu('CHAT', group)" (click)="onClickGroupContextMenu('CHAT', group)"
> >
그룹 대화하기 {{ 'group.startChatWithGroup' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowGroupContextMenu('SEND_MESSAGE', group)" *ngIf="getShowGroupContextMenu('SEND_MESSAGE', group)"
(click)="onClickGroupContextMenu('SEND_MESSAGE', group)" (click)="onClickGroupContextMenu('SEND_MESSAGE', group)"
> >
그룹 쪽지 보내기 {{ 'group.sendMessageToGroup' | translate }}
</button> </button>
<mat-divider *ngIf="getShowGroupContextMenu('DIV1', group)"></mat-divider> <mat-divider *ngIf="getShowGroupContextMenu('DIV1', group)"></mat-divider>
<button <button
@ -266,21 +268,21 @@
*ngIf="getShowGroupContextMenu('RENAME', group)" *ngIf="getShowGroupContextMenu('RENAME', group)"
(click)="onClickGroupContextMenu('RENAME', group)" (click)="onClickGroupContextMenu('RENAME', group)"
> >
그룹 이름 바꾸기 {{ 'group.changeGroupName' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowGroupContextMenu('EDIT_MEMBER', group)" *ngIf="getShowGroupContextMenu('EDIT_MEMBER', group)"
(click)="onClickGroupContextMenu('EDIT_MEMBER', group)" (click)="onClickGroupContextMenu('EDIT_MEMBER', group)"
> >
그룹 멤버 변경 {{ 'group.modifyGroupMember' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowGroupContextMenu('DELETE', group)" *ngIf="getShowGroupContextMenu('DELETE', group)"
(click)="onClickGroupContextMenu('DELETE', group)" (click)="onClickGroupContextMenu('DELETE', group)"
> >
그룹 삭제 {{ 'group.removeGroup' | translate }}
</button> </button>
</ng-template> </ng-template>
</mat-menu> </mat-menu>

View File

@ -1,6 +1,6 @@
<div class="message-box container"> <div class="message-box container">
<div class="current-head"> <div class="current-head">
<h3>쪽지</h3> <h3>{{ 'message.label' | translate }}</h3>
<div class="btn-box"> <div class="btn-box">
<!-- <button mat-icon-button> <!-- <button mat-icon-button>
<mat-icon>timer</mat-icon> <mat-icon>timer</mat-icon>
@ -19,7 +19,7 @@
#inputSearch #inputSearch
type="text" type="text"
maxlength="20" maxlength="20"
placeholder="이름, 제목, 내용 검색" placeholder="{{ 'message.placeholderForSearch' | translate }}"
value="" value=""
formControlName="searchInput" formControlName="searchInput"
(keydown.enter)="onKeyDownEnter($event, inputSearch.value)" (keydown.enter)="onKeyDownEnter($event, inputSearch.value)"
@ -47,7 +47,7 @@
> >
<mat-tab [label]="MessageType.Receive"> <mat-tab [label]="MessageType.Receive">
<ng-template mat-tab-label> <ng-template mat-tab-label>
수신 {{ 'message.messageTypeReceiving' | translate }}
</ng-template> </ng-template>
<ucap-message-list-item <ucap-message-list-item
@ -59,7 +59,7 @@
</mat-tab> </mat-tab>
<mat-tab [label]="MessageType.Send"> <mat-tab [label]="MessageType.Send">
<ng-template mat-tab-label> <ng-template mat-tab-label>
발신 {{ 'message.messageTypeOutgoing' | translate }}
</ng-template> </ng-template>
<ucap-message-list-item <ucap-message-list-item
@ -71,7 +71,7 @@
</mat-tab> </mat-tab>
<mat-tab [label]="MessageType.Reservation"> <mat-tab [label]="MessageType.Reservation">
<ng-template mat-tab-label> <ng-template mat-tab-label>
예약 {{ 'message.messageTypeReservation' | translate }}
</ng-template> </ng-template>
<ucap-message-list-item <ucap-message-list-item
@ -91,10 +91,18 @@
formControlName="searchMessageType" formControlName="searchMessageType"
(selectionChange)="onChangeSelection($event)" (selectionChange)="onChangeSelection($event)"
> >
<mat-option [value]="MessageType.All">전체</mat-option> <mat-option [value]="MessageType.All">{{
<mat-option [value]="MessageType.Receive">수신</mat-option> 'message.messageTypeAll' | translate
<mat-option [value]="MessageType.Send">발신</mat-option> }}</mat-option>
<mat-option [value]="MessageType.Reservation">예약</mat-option> <mat-option [value]="MessageType.Receive">{{
'message.messageTypeReceiving' | translate
}}</mat-option>
<mat-option [value]="MessageType.Send">{{
'message.messageTypeOutgoing' | translate
}}</mat-option>
<mat-option [value]="MessageType.Reservation">{{
'message.messageTypeReservation' | translate
}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-radio-group <mat-radio-group
@ -102,15 +110,15 @@
aria-label="Select an searchType" aria-label="Select an searchType"
(change)="onChangeSearchType($event)" (change)="onChangeSearchType($event)"
> >
<mat-radio-button [value]="MessageSearchType.Name" [checked]="true" <mat-radio-button [value]="MessageSearchType.Name" [checked]="true">{{
>이름</mat-radio-button 'message.searchTypeName' | translate
> }}</mat-radio-button>
<mat-radio-button [value]="MessageSearchType.Title" <mat-radio-button [value]="MessageSearchType.Title">{{
>제목</mat-radio-button 'message.searchTypeTitle' | translate
> }}</mat-radio-button>
<mat-radio-button [value]="MessageSearchType.Contents" <mat-radio-button [value]="MessageSearchType.Contents">{{
>내용</mat-radio-button 'message.searchTypeContent' | translate
> }}</mat-radio-button>
</mat-radio-group> </mat-radio-group>
</form> </form>
</div> </div>

View File

@ -1,6 +1,6 @@
<div *ngIf="showTitle"> <div *ngIf="showTitle">
<div class="current-head"> <div class="current-head">
<h3>조직도</h3> <h3>{{ 'organization.chart' | translate }}</h3>
</div> </div>
<ucap-organization-tenant-search <ucap-organization-tenant-search
[companyList]="companyList$ | async" [companyList]="companyList$ | async"
@ -23,11 +23,23 @@
<dl class="select-dept text-accent-color"> <dl class="select-dept text-accent-color">
<dt> <dt>
<ng-container *ngIf="!isShowSearch"> <ng-container *ngIf="!isShowSearch">
{{ getSelectedDepartmentName() }} <ng-container
*ngIf="
!!selectedDepartmentProcessing || !selectedDepartmentName;
else useSelectedDepartmentName
"
>
{{ 'common.messages.searching' | translate }} ...
</ng-container>
<ng-template #useSelectedDepartmentName>
{{ selectedDepartmentName }}
</ng-template>
</ng-container> </ng-container>
<ng-container *ngIf="isShowSearch"> <ng-container *ngIf="isShowSearch">
검색결과<span class="text-accent-color" {{ 'common.searchResult' | translate
>({{ searchUserInfos.length }}명)</span }}<span class="text-accent-color"
>({{ searchUserInfos.length }}
{{ 'common.howManyPersons' | translate }})</span
> >
</ng-container> </ng-container>
</dt> </dt>
@ -118,7 +130,8 @@
class="mat-primary" class="mat-primary"
(click)="onClickShowSelectedUserList()" (click)="onClickShowSelectedUserList()"
> >
선택<span *ngIf="selectedUserList.length > 0" {{ 'common.messages.select' | translate
}}<span *ngIf="selectedUserList.length > 0"
>({{ selectedUserList.length }})</span >({{ selectedUserList.length }})</span
> >
</button> </button>
@ -130,7 +143,7 @@
(click)="onClickAddGroup()" (click)="onClickAddGroup()"
class="mat-primary" class="mat-primary"
> >
그룹에 추가 {{ 'organization.addToGroup' | translate }}
</button> </button>
</li> </li>
<li> <li>
@ -140,7 +153,7 @@
(click)="onClickChatOpen()" (click)="onClickChatOpen()"
class="mat-primary" class="mat-primary"
> >
대화 {{ 'organization.startChat' | translate }}
</button> </button>
</li> </li>
<li> <li>
@ -150,7 +163,7 @@
(click)="onClickConference()" (click)="onClickConference()"
class="mat-primary" class="mat-primary"
> >
화상회의 {{ 'organization.startVideoConference' | translate }}
</button> </button>
</li> </li>
</ul> </ul>
@ -176,7 +189,7 @@
[disabled]="getEnableCall()" [disabled]="getEnableCall()"
(click)="onClickContextMenu('CALL_LINE', userInfo)" (click)="onClickContextMenu('CALL_LINE', userInfo)"
> >
내선번호 전화걸기 {{ 'organization.makeExtensionCall' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
@ -184,16 +197,16 @@
[disabled]="getEnableCall()" [disabled]="getEnableCall()"
(click)="onClickContextMenu('CALL_MOBILE', userInfo)" (click)="onClickContextMenu('CALL_MOBILE', userInfo)"
> >
모바일 전화걸기 {{ 'organization.makeMobileCall' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
(click)="onClickContextMenu('SEND_MESSAGE', userInfo)" (click)="onClickContextMenu('SEND_MESSAGE', userInfo)"
> >
쪽지 보내기 {{ 'organization.sendMessage' | translate }}
</button> </button>
<button mat-menu-item (click)="onClickContextMenu('SEND_SMS', userInfo)"> <button mat-menu-item (click)="onClickContextMenu('SEND_SMS', userInfo)">
SMS 보내기 {{ 'organization.sendSMS' | translate }}
</button> </button>
</ng-template> </ng-template>
</mat-menu> </mat-menu>

View File

@ -46,6 +46,7 @@ import { Company } from '@ucap-webmessenger/api-external';
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar'; import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
import { MatMenuTrigger } from '@angular/material'; import { MatMenuTrigger } from '@angular/material';
import { TranslateService } from '@ngx-translate/core';
import { import {
MessageWriteDialogComponent, MessageWriteDialogComponent,
MessageWriteDialogResult, MessageWriteDialogResult,
@ -146,6 +147,7 @@ export class OrganizationComponent
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private queryProtocolService: QueryProtocolService, private queryProtocolService: QueryProtocolService,
private dialogService: DialogService, private dialogService: DialogService,
private translateService: TranslateService,
private logger: NGXLogger private logger: NGXLogger
) { ) {
this.loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO); this.loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
@ -342,18 +344,6 @@ export class OrganizationComponent
.subscribe(); .subscribe();
} }
getSelectedDepartmentName() {
if (!!this.selectedDepartmentProcessing) {
return '조회중..';
}
if (!!this.selectedDepartmentName) {
return this.selectedDepartmentName;
} else {
return '조회중..';
}
}
/** 전체 체크여부 */ /** 전체 체크여부 */
getCheckedAllUser() { getCheckedAllUser() {
const compareList: UserInfoSS[] = this.isShowSearch const compareList: UserInfoSS[] = this.isShowSearch

View File

@ -5,8 +5,8 @@
animationDuration="0ms" animationDuration="0ms"
(selectedIndexChange)="onSelectedIndexChange($event)" (selectedIndexChange)="onSelectedIndexChange($event)"
> >
<mat-tab label="Image"></mat-tab> <mat-tab label="{{ 'common.file.type.images' | translate }}"></mat-tab>
<mat-tab label="Video"></mat-tab> <mat-tab label="{{ 'common.file.type.video' | translate }}"></mat-tab>
</mat-tab-group> </mat-tab-group>
</div> </div>
<div fxFlex="1 1 240px" class="select-filebox bg-accent-brightest"> <div fxFlex="1 1 240px" class="select-filebox bg-accent-brightest">
@ -28,7 +28,7 @@
<circle cx="8.5" cy="8.5" r="1.5" /> <circle cx="8.5" cy="8.5" r="1.5" />
<path d="M20.4 14.5L16 10 4 20" /> <path d="M20.4 14.5L16 10 4 20" />
</svg> </svg>
<span>Select File.</span> <span>{{ 'common.file.selectFiles' | translate }}</span>
</div> </div>
<div class="empty-msg" *ngIf="currentTabIndex === 1"> <div class="empty-msg" *ngIf="currentTabIndex === 1">
@ -53,7 +53,7 @@
<line x1="17" y1="17" x2="22" y2="17"></line> <line x1="17" y1="17" x2="22" y2="17"></line>
<line x1="17" y1="7" x2="22" y2="7"></line> <line x1="17" y1="7" x2="22" y2="7"></line>
</svg> </svg>
<span>Select File.</span> <span>{{ 'common.file.selectFiles' | translate }}</span>
</div> </div>
</ng-container> </ng-container>
<ng-container *ngIf="selectedFile"> <ng-container *ngIf="selectedFile">
@ -160,14 +160,14 @@
class="mat-primary" class="mat-primary"
(click)="onClickDownloadAll()" (click)="onClickDownloadAll()"
> >
Download All {{ 'common.file.downloadSelected' | translate }}
</button> </button>
<button <button
mat-flat-button mat-flat-button
class="mat-primary" class="mat-primary"
(click)="onClickOpenDownloadFolder()" (click)="onClickOpenDownloadFolder()"
> >
Open Folder {{ 'common.file.openDownloadFolder' | translate }}
</button> </button>
</div> </div>
</div> </div>

View File

@ -27,6 +27,7 @@ import { SnackBarService } from '@ucap-webmessenger/ui';
import { FileDownloadItem } from '@ucap-webmessenger/api'; import { FileDownloadItem } from '@ucap-webmessenger/api';
import { ModuleConfig } from '@ucap-webmessenger/api-common'; import { ModuleConfig } from '@ucap-webmessenger/api-common';
import { _MODULE_CONFIG } from 'projects/ucap-webmessenger-api-common/src/lib/config/token'; import { _MODULE_CONFIG } from 'projects/ucap-webmessenger-api-common/src/lib/config/token';
import { TranslateService } from '@ngx-translate/core';
export interface FileInfoTotal { export interface FileInfoTotal {
info: FileInfo; info: FileInfo;
@ -61,6 +62,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
private store: Store<any>, private store: Store<any>,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private commonApiService: CommonApiService, private commonApiService: CommonApiService,
private translateService: TranslateService,
private snackBarService: SnackBarService, private snackBarService: SnackBarService,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
@Inject(_MODULE_CONFIG) private moduleConfig: ModuleConfig, @Inject(_MODULE_CONFIG) private moduleConfig: ModuleConfig,
@ -230,26 +232,33 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
.saveFile(buffer, fileInfo.info.name, mimeType) .saveFile(buffer, fileInfo.info.name, mimeType)
.then(result => { .then(result => {
if (!!result) { if (!!result) {
this.snackBarService.open( this.translateService
`파일이 경로[${result}]에 저장되었습니다.`, .get('common.file.savedToPath', {
'', v: result
{ })
duration: 3000, .pipe(take(1))
verticalPosition: 'bottom' .subscribe(v => {
} this.snackBarService.open(v, '', {
); duration: 3000,
verticalPosition: 'bottom'
});
});
} else { } else {
this.snackBarService.open( this.translateService
'파일 저장에 실패하였습니다.', .get('common.file.failToSave')
'확인' .pipe(take(1))
); .subscribe(v => {
this.snackBarService.open(v);
});
} }
}) })
.catch(reason => { .catch(reason => {
this.snackBarService.open( this.translateService
'파일 저장에 실패하였습니다.', .get('common.file.failToSave')
'확인' .pipe(take(1))
); .subscribe(v => {
this.snackBarService.open(v);
});
}); });
}) })
.catch(reason => { .catch(reason => {

View File

@ -5,8 +5,8 @@
animationDuration="0ms" animationDuration="0ms"
(selectedIndexChange)="onSelectedIndexChange($event)" (selectedIndexChange)="onSelectedIndexChange($event)"
> >
<mat-tab label="Receive"></mat-tab> <mat-tab label="{{ 'chat.typeReceived' | translate }}"></mat-tab>
<mat-tab label="Send"></mat-tab> <mat-tab label="{{ 'chat.typeSent' | translate }}"></mat-tab>
</mat-tab-group> </mat-tab-group>
</div> </div>
<div fxFlex="1 1 200px" class="select-filebox bg-accent-brightest"> <div fxFlex="1 1 200px" class="select-filebox bg-accent-brightest">
@ -28,7 +28,7 @@
/> />
<path d="M13 3v6h6" /> <path d="M13 3v6h6" />
</svg> </svg>
<span>Select File.</span> <span>{{ 'common.file.selectFiles' | translate }}</span>
</div> </div>
</ng-container> </ng-container>
<ng-container *ngIf="selectedFile"> <ng-container *ngIf="selectedFile">
@ -45,11 +45,15 @@
<ul> <ul>
<li class="name">{{ selectedFile.info.name }}</li> <li class="name">{{ selectedFile.info.name }}</li>
<li> <li>
<span class="text-accent-color">size :</span> <span class="text-accent-color"
>{{ 'common.file.size' | translate }} :</span
>
{{ selectedFile.info.size | ucapBytes }} {{ selectedFile.info.size | ucapBytes }}
</li> </li>
<li> <li>
<span class="text-accent-color">date :</span> <span class="text-accent-color"
>{{ 'chat.validityPeriod' | translate }} :</span
>
{{ selectedFile.info.sendDate | ucapDate: 'YYYY.MM.DD' }} {{ selectedFile.info.sendDate | ucapDate: 'YYYY.MM.DD' }}
<span *ngIf="loginRes.fileRetentionPeriod > 0"> <span *ngIf="loginRes.fileRetentionPeriod > 0">
~ ~
@ -63,7 +67,7 @@
</div> </div>
<div class="select-file-option"> <div class="select-file-option">
<span <span
matTooltip="다운로드" matTooltip="{{ 'common.file.download' | translate }}"
class="text-accent-darkest" class="text-accent-darkest"
(click)="onClickDownload(selectedFile)" (click)="onClickDownload(selectedFile)"
> >
@ -91,7 +95,10 @@
/> />
</svg> </svg>
</span> </span>
<span matTooltip="나에게전달" class="text-accent-darkest"> <span
matTooltip="{{ 'chat.forwardFileToMe' | translate }}"
class="text-accent-darkest"
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="20" width="20"
@ -111,7 +118,10 @@
<circle cx="12" cy="12" r="10" /> <circle cx="12" cy="12" r="10" />
</svg> </svg>
</span> </span>
<span matTooltip="파일전달" class="text-accent-darkest"> <span
matTooltip="{{ 'chat.forwardFileTo' | translate }}"
class="text-accent-darkest"
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="20" width="20"
@ -131,7 +141,10 @@
</g> </g>
</svg> </svg>
</span> </span>
<span matTooltip="파일삭제" class="text-accent-darkest"> <span
matTooltip="{{ 'common.file.delete' | translate }}"
class="text-accent-darkest"
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="20" width="20"
@ -176,7 +189,7 @@
</ng-container> </ng-container>
<ng-container matColumnDef="name"> <ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="infos"> <th mat-header-cell *matHeaderCellDef mat-sort-header class="infos">
Name {{ 'common.file.name' | translate }}
</th> </th>
<td mat-cell *matCellDef="let element" class="file-info"> <td mat-cell *matCellDef="let element" class="file-info">
<div class="file-name"> <div class="file-name">
@ -205,7 +218,9 @@
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="sendDate" class="date"> <ng-container matColumnDef="sendDate" class="date">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Size</th> <th mat-header-cell *matHeaderCellDef mat-sort-header>
{{ 'chat.sentDate' | translate }}
</th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<!--{{ element.info.sendDate | ucapDate: 'YYYY.MM.DD' }}--> <!--{{ element.info.sendDate | ucapDate: 'YYYY.MM.DD' }}-->
{{ element.info.size | ucapBytes }} {{ element.info.size | ucapBytes }}
@ -242,14 +257,14 @@
class="mat-primary" class="mat-primary"
(click)="onClickDownloadAll()" (click)="onClickDownloadAll()"
> >
Download All {{ 'common.file.downloadSelected' | translate }}
</button> </button>
<button <button
mat-flat-button mat-flat-button
class="mat-primary" class="mat-primary"
(click)="onClickOpenDownloadFolder()" (click)="onClickOpenDownloadFolder()"
> >
Open Folder {{ 'common.file.openDownloadFolder' | translate }}
</button> </button>
</div> </div>
</div> </div>

View File

@ -39,6 +39,7 @@ import {
KEY_ENVIRONMENTS_INFO KEY_ENVIRONMENTS_INFO
} from '@app/types'; } from '@app/types';
import { RoomInfo } from '@ucap-webmessenger/protocol-room'; import { RoomInfo } from '@ucap-webmessenger/protocol-room';
import { TranslateService } from '@ngx-translate/core';
export interface FileInfoTotal { export interface FileInfoTotal {
info: FileInfo; info: FileInfo;
@ -75,6 +76,7 @@ export class FileBoxComponent implements OnInit, OnDestroy {
private store: Store<any>, private store: Store<any>,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private commonApiService: CommonApiService, private commonApiService: CommonApiService,
private translateService: TranslateService,
private snackBarService: SnackBarService, private snackBarService: SnackBarService,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private dialogService: DialogService, private dialogService: DialogService,
@ -274,26 +276,33 @@ export class FileBoxComponent implements OnInit, OnDestroy {
.saveFile(buffer, fileInfo.info.name, mimeType) .saveFile(buffer, fileInfo.info.name, mimeType)
.then(result => { .then(result => {
if (!!result) { if (!!result) {
this.snackBarService.open( this.translateService
`파일이 경로[${result}]에 저장되었습니다.`, .get('common.file.savedToPath', {
'', v: result
{ })
duration: 3000, .pipe(take(1))
verticalPosition: 'bottom' .subscribe(v => {
} this.snackBarService.open(v, '', {
); duration: 3000,
verticalPosition: 'bottom'
});
});
} else { } else {
this.snackBarService.open( this.translateService
'파일 저장에 실패하였습니다.', .get('common.file.failToSave')
'확인' .pipe(take(1))
); .subscribe(v => {
this.snackBarService.open(v);
});
} }
}) })
.catch(reason => { .catch(reason => {
this.snackBarService.open( this.translateService
'파일 저장에 실패하였습니다.', .get('common.file.failToSave')
'확인' .pipe(take(1))
); .subscribe(v => {
this.snackBarService.open(v);
});
}); });
}) })
.catch(reason => { .catch(reason => {
@ -343,74 +352,84 @@ export class FileBoxComponent implements OnInit, OnDestroy {
); );
} }
async onClickForward(fileInfo: FileInfoTotal) { onClickForward(fileInfo: FileInfoTotal) {
const result = await this.dialogService.open< this.translateService
CreateChatDialogComponent, .get('chat.forwardFileTo')
CreateChatDialogData, .pipe(take(1))
CreateChatDialogResult .subscribe(async v => {
>(CreateChatDialogComponent, { const result = await this.dialogService.open<
width: '600px', CreateChatDialogComponent,
data: { CreateChatDialogData,
type: UserSelectDialogType.MessageForward, CreateChatDialogResult
title: 'MessageForward', >(CreateChatDialogComponent, {
ignoreRoom: [this.roomInfo] width: '600px',
} data: {
}); type: UserSelectDialogType.MessageForward,
title: v,
ignoreRoom: [this.roomInfo]
}
});
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
const userSeqs: number[] = []; const userSeqs: number[] = [];
let roomSeq = ''; let roomSeq = '';
if (!!result.selectedUserList && result.selectedUserList.length > 0) { if (!!result.selectedUserList && result.selectedUserList.length > 0) {
result.selectedUserList.map(user => userSeqs.push(user.seq)); result.selectedUserList.map(user => userSeqs.push(user.seq));
} }
if (!!result.selectedRoom) { if (!!result.selectedRoom) {
roomSeq = result.selectedRoom.roomSeq; roomSeq = result.selectedRoom.roomSeq;
} }
if (userSeqs.length > 0 || roomSeq.trim().length > 0) { if (userSeqs.length > 0 || roomSeq.trim().length > 0) {
this.store.dispatch( this.store.dispatch(
EventStore.forward({ EventStore.forward({
senderSeq: this.loginRes.userSeq, senderSeq: this.loginRes.userSeq,
req: { req: {
roomSeq: '-999', roomSeq: '-999',
eventType: EventType.File, eventType: EventType.File,
sentMessage: fileInfo.info.sentMessage sentMessage: fileInfo.info.sentMessage
}, },
trgtUserSeqs: userSeqs, trgtUserSeqs: userSeqs,
trgtRoomSeq: roomSeq trgtRoomSeq: roomSeq
}) })
); );
} }
} }
});
} }
async onClickDelete(fileInfo: FileInfoTotal) { onClickDelete(fileInfo: FileInfoTotal) {
const result = await this.dialogService.open< this.translateService
ConfirmDialogComponent, .get('chat.confirmDeleteFile')
ConfirmDialogData, .pipe(take(1))
ConfirmDialogResult .subscribe(async v => {
>(ConfirmDialogComponent, { const result = await this.dialogService.open<
width: '400px', ConfirmDialogComponent,
data: { ConfirmDialogData,
title: 'Delete', ConfirmDialogResult
html: `선택한 파일(메시지)를 삭제하시겠습니까?<br/>삭제된 파일(메시지)는 내 대화방에서만 적용되며 상대방의 대화방에서는 삭제되지 않습니다.` >(ConfirmDialogComponent, {
} width: '400px',
}); data: {
title: 'Delete',
html: v
}
});
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
this.store.dispatch( this.store.dispatch(
EventStore.del({ EventStore.del({
roomSeq: this.roomInfo.roomSeq, roomSeq: this.roomInfo.roomSeq,
eventSeq: fileInfo.info.eventSeq eventSeq: fileInfo.info.eventSeq
}) })
); );
this.fileInfoTotal = this.fileInfoTotal.filter( this.fileInfoTotal = this.fileInfoTotal.filter(
fInfo => fInfo.info.seq !== fileInfo.info.seq fInfo => fInfo.info.seq !== fileInfo.info.seq
); );
this.onSelectedIndexChange(this.currentTabIndex); this.onSelectedIndexChange(this.currentTabIndex);
} }
});
} }
get fileRetentionPeriodOptions(): DateOptions { get fileRetentionPeriodOptions(): DateOptions {

View File

@ -6,14 +6,36 @@
"useOnlyForSpecialCharacter": "Can only use Special characters: {{v}}", "useOnlyForSpecialCharacter": "Can only use Special characters: {{v}}",
"howManyPersons": "person(s)", "howManyPersons": "person(s)",
"file": { "file": {
"name": "Name of file",
"size": "Size of file",
"download": "Download",
"delete": "Delete",
"saved": "The file has been saved.", "saved": "The file has been saved.",
"savedToPath": "The file has been saved to path[{{v}}].", "savedToPath": "The file has been saved to path[{{v}}].",
"failToSave": "File save failed." "failToSave": "File save failed.",
"downloadSelected": "Download selected",
"openDownloadFolder": "Open download folder",
"selectFiles": "Select files",
"type": {
"label": "Type of file",
"images": "Images",
"video": "Video"
}
}, },
"messages": { "messages": {
"yes": "Yes", "yes": "Yes",
"no": "No", "no": "No",
"confirm": "Confirm" "confirm": "Confirm",
"select": "Select",
"unselect": "Unselect",
"searching": "Searching"
},
"paginator": {
"itemsPerPage": "Items per page",
"nextPage": "Next page",
"prevPage": "Previous page",
"firstPage": "First page",
"lastPage": "Last page"
}, },
"timezone": { "timezone": {
"Africa/Abidjan": "Africa/Abidjan", "Africa/Abidjan": "Africa/Abidjan",
@ -622,7 +644,17 @@
"name": "Group name", "name": "Group name",
"nameFavorit": "Favorit", "nameFavorit": "Favorit",
"nameMyDept": "My Dept", "nameMyDept": "My Dept",
"nameDefault": "Default" "nameDefault": "Default",
"favorite": "Favorite",
"unfavorite": "Unfavorite",
"removeBuddyFromGroup": "Remove buddy from group",
"copyBuddyToGroup": "Copy buddy to other group",
"moveBuddyToGroup": "Move buddy to otyer group",
"changeGroupName": "Change name of group",
"modifyGroupMember": "Modify member of group",
"removeGroup": "Remove group",
"startChatWithGroup": "Chat with group",
"sendMessageToGroup": "Send message to group"
}, },
"chat": { "chat": {
"label": "Chat", "label": "Chat",
@ -630,14 +662,40 @@
"searchRoomByName": "Search by room name", "searchRoomByName": "Search by room name",
"newTimerChat": "New Timer Chat", "newTimerChat": "New Timer Chat",
"newChat": "New Chat", "newChat": "New Chat",
"startChat": "Chat",
"openRoom": "Open room", "openRoom": "Open room",
"turnOnRoomAlert": "turn on room alert", "turnOnRoomAlert": "turn on room alert",
"turnOffRoomAlert": "turn off room alert", "turnOffRoomAlert": "turn off room alert",
"leaveFromRoom": "leave room", "leaveFromRoom": "leave room",
"confirmLeaveFromRoom": "Are you sure you want to leave the chat room?<br/>Leave your chat history and chat room information." "confirmLeaveFromRoom": "Do you want to leave the chat room?<br/>Leave your chat history and chat room information.",
"confirmDeleteFile": "Do you want to delete the file?<br/>The deleted file (message) will only be applied to your chat room and will not be deleted from their chat room.",
"typeReceived": "Received",
"typeSent": "Sent",
"sentDate": "Sent date",
"validityPeriod": "Validity period",
"forwardFileToMe": "Forward file to me",
"forwardFileTo": "Forward file to ..."
}, },
"organization": { "organization": {
"chart": "Organization chart" "chart": "Organization chart",
"addToGroup": "Add to group",
"startChat": "Chat",
"startVideoConference": "Video conference",
"makeExtensionCall": "Make extension call",
"makeMobileCall": "Make mobile call",
"sendMessage": "Send message",
"sendSMS": "Send SMS"
}, },
"message": {} "message": {
"label": "Message",
"sendTo": "Send message",
"placeholderForSearch": "search for name, title, content",
"messageTypeAll": "All",
"messageTypeReceiving": "Receiving",
"messageTypeOutgoing": "Outgoing",
"messageTypeReservation": "Reservation",
"searchTypeName": "Name",
"searchTypeTitle": "Title",
"searchTypeContent": "Content"
}
} }

View File

@ -6,14 +6,36 @@
"useOnlyForSpecialCharacter": "특수문자는 {{v}}만 사용할 수 있습니다.", "useOnlyForSpecialCharacter": "특수문자는 {{v}}만 사용할 수 있습니다.",
"howManyPersons": "명", "howManyPersons": "명",
"file": { "file": {
"name": "파일 이름",
"size": "파일 크기",
"download": "파일 다운로드",
"delete": "파일 삭제",
"saved": "파일이 저장되었습니다.", "saved": "파일이 저장되었습니다.",
"savedToPath": "파일이 경로[{{v}}]에 저장되었습니다.", "savedToPath": "파일이 경로[{{v}}]에 저장되었습니다.",
"failToSave": "파일 저장에 실패하였습니다." "failToSave": "파일 저장에 실패하였습니다.",
"downloadSelected": "선택된 파일 다운로드",
"openDownloadFolder": "다운로드 폴더 열기",
"selectFiles": "파일을 선택하세요",
"type": {
"label": "파일 종류",
"images": "이미지",
"video": "동영상"
}
}, },
"messages": { "messages": {
"yes": "네", "yes": "네",
"no": "아니오", "no": "아니오",
"confirm": "확인" "confirm": "확인",
"select": "선택",
"unselect": "선택 해제",
"searching": "검색중"
},
"paginator": {
"itemsPerPage": "페이지별 갯수",
"nextPage": "다음 페이지",
"prevPage": "이전 페이지",
"firstPage": "처음 페이지",
"lastPage": "마지막 페이지"
}, },
"timezone": { "timezone": {
"Africa/Abidjan": "아프리카/아비 장", "Africa/Abidjan": "아프리카/아비 장",
@ -622,7 +644,17 @@
"name": "그룹 이름", "name": "그룹 이름",
"nameFavorit": "즐겨찾기", "nameFavorit": "즐겨찾기",
"nameMyDept": "소속부서", "nameMyDept": "소속부서",
"nameDefault": "기본" "nameDefault": "기본",
"favorite": "즐겨찾기 등록",
"unfavorite": "즐겨찾기 해제",
"removeBuddyFromGroup": "이 그룹에서 삭제",
"copyBuddyToGroup": "대화 상대 복사",
"moveBuddyToGroup": "대화 상대 이동",
"changeGroupName": "그룹 이름 바꾸기",
"modifyGroupMember": "그룹 멤버 변경",
"removeGroup": "그룹 삭제",
"startChatWithGroup": "그룹 대화하기",
"sendMessageToGroup": "그룹 쪽지 보내기"
}, },
"chat": { "chat": {
"label": "대화", "label": "대화",
@ -630,14 +662,40 @@
"searchRoomByName": "대화방 이름 검색", "searchRoomByName": "대화방 이름 검색",
"newTimerChat": "새로운 타이머 대화", "newTimerChat": "새로운 타이머 대화",
"newChat": "새로운 대화", "newChat": "새로운 대화",
"startChat": "대화하기",
"openRoom": "대화방 열기", "openRoom": "대화방 열기",
"turnOnRoomAlert": "대화방 알람 켜기", "turnOnRoomAlert": "대화방 알람 켜기",
"turnOffRoomAlert": "대화방 알람 끄기", "turnOffRoomAlert": "대화방 알람 끄기",
"leaveFromRoom": "대화방 나가기", "leaveFromRoom": "대화방 나가기",
"confirmLeaveFromRoom": "대화방을 나가시겠습니까?<br/>나가기를 하면 대화내용 및 대화방 정보가 삭제됩니다." "confirmLeaveFromRoom": "대화방을 나가시겠습니까?<br/>나가기를 하면 대화내용 및 대화방 정보가 삭제됩니다.",
"confirmDeleteFile": "선택한 파일(메시지)를 삭제하시겠습니까?<br/>삭제된 파일(메시지)는 내 대화방에서만 적용되며 상대방의 대화방에서는 삭제되지 않습니다.",
"typeReceived": "수신",
"typeSent": "발신",
"sentDate": "보낸 날짜",
"validityPeriod": "유효 기간",
"forwardFileToMe": "파일을 나에게 전달",
"forwardFileTo": "파일 전달"
}, },
"organization": { "organization": {
"chart": "조직도" "chart": "조직도",
"addToGroup": "그룹에 추가",
"startChat": "대화",
"startVideoConference": "화상회의",
"makeExtensionCall": "내선번호 전화걸기",
"makeMobileCall": "모바일 전화걸기",
"sendMessage": "쪽지 보내기",
"sendSMS": "SMS 보내기"
}, },
"message": {} "message": {
"label": "쪽지",
"sendTo": "쪽지 보내기",
"placeholderForSearch": "이름, 제목, 내용 검색",
"messageTypeAll": "전체",
"messageTypeReceiving": "수신",
"messageTypeOutgoing": "발신",
"messageTypeReservation": "예약",
"searchTypeName": "이름",
"searchTypeTitle": "제목",
"searchTypeContent": "내용"
}
} }

View File

@ -0,0 +1,66 @@
import { Injectable } from '@angular/core';
import { MatPaginatorIntl } from '@angular/material';
import { TranslateService } from '@ngx-translate/core';
const KEY_ITEMS_PER_PAGE = 'common.paginator.itemsPerPage';
const KEY_NEXT_PAGE = 'common.paginator.nextPage';
const KEY_PREV_PAGE = 'common.paginator.prevPage';
const KEY_FIRST_PAGE = 'common.paginator.firstPage';
const KEY_LAST_PAGE = 'common.paginator.lastPage';
@Injectable({
providedIn: 'root'
})
export class PaginatorIntlService extends MatPaginatorIntl {
public constructor(private translateService: TranslateService) {
super();
this.translateService.onLangChange.subscribe((e: Event) => {
this.getAndInitTranslations();
});
this.getAndInitTranslations();
}
public getRangeLabel = (
page: number,
pageSize: number,
length: number
): string => {
if (0 === length || 0 === pageSize) {
return `0 / ${length}`;
}
length = Math.max(length, 0);
const startIndex = page * pageSize;
const endIndex =
startIndex < length
? Math.min(startIndex + pageSize, length)
: startIndex + pageSize;
return `${startIndex + 1} - ${endIndex} / ${length}`;
// tslint:disable-next-line: semicolon
};
public getAndInitTranslations(): void {
this.translateService
.get([
KEY_ITEMS_PER_PAGE,
KEY_NEXT_PAGE,
KEY_PREV_PAGE,
KEY_FIRST_PAGE,
KEY_LAST_PAGE
])
.subscribe((translation: any) => {
this.itemsPerPageLabel = translation[KEY_ITEMS_PER_PAGE];
this.nextPageLabel = translation[KEY_NEXT_PAGE];
this.previousPageLabel = translation[KEY_PREV_PAGE];
this.firstPageLabel = translation[KEY_FIRST_PAGE];
this.lastPageLabel = translation[KEY_LAST_PAGE];
this.changes.next();
});
}
}

View File

@ -22,7 +22,7 @@ import { MatDatepickerModule } from '@angular/material/datepicker';
import { import {
MatTabsModule, MatTabsModule,
MatSelectModule, MatSelectModule,
MatSlideToggleModule, MatSlideToggleModule
} from '@angular/material'; } from '@angular/material';
import { DragDropModule } from '@angular/cdk/drag-drop'; import { DragDropModule } from '@angular/cdk/drag-drop';
@ -50,6 +50,7 @@ import { SnackBarService } from './services/snack-bar.service';
import { SplashScreenService } from './services/splash-screen.service'; import { SplashScreenService } from './services/splash-screen.service';
import { TranslateService } from './services/translate.service'; import { TranslateService } from './services/translate.service';
import { DateService } from './services/date.service'; import { DateService } from './services/date.service';
import { PaginatorIntlService } from './services/paginator-intl.service';
import { ClickOutsideDirective } from './directives/click-outside.directive'; import { ClickOutsideDirective } from './directives/click-outside.directive';
import { FileUploadForDirective } from './directives/file-upload-for.directive'; import { FileUploadForDirective } from './directives/file-upload-for.directive';
@ -125,7 +126,8 @@ const SERVICES = [
SnackBarService, SnackBarService,
SplashScreenService, SplashScreenService,
TranslateService, TranslateService,
DateService DateService,
PaginatorIntlService
]; ];
@NgModule({ @NgModule({

View File

@ -35,6 +35,7 @@ export * from './lib/services/snack-bar.service';
export * from './lib/services/splash-screen.service'; export * from './lib/services/splash-screen.service';
export * from './lib/services/translate.service'; export * from './lib/services/translate.service';
export * from './lib/services/date.service'; export * from './lib/services/date.service';
export * from './lib/services/paginator-intl.service';
export * from './lib/types/file-viewer.type'; export * from './lib/types/file-viewer.type';