From ac54b20021c27deee430adecec04333eaa2b4926 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 4 Dec 2019 12:16:16 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EB=A7=8C=EB=A3=8C=EB=90=9C=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=ED=81=B4=EB=A6=AD=EC=8B=9C=20=EB=B7=B0=EC=96=B4=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=20=EC=95=88=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message-box/attach-file.component.scss | 11 +++---- .../components/message-box/file.component.ts | 8 +++-- .../message-box/image.component.html | 9 +++++- .../message-box/image.component.scss | 29 +++++++++++++++---- .../components/message-box/image.component.ts | 19 +++++++++++- 5 files changed, 61 insertions(+), 15 deletions(-) diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/attach-file.component.scss b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/attach-file.component.scss index a1758367..236c426b 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/attach-file.component.scss +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/attach-file.component.scss @@ -2,6 +2,7 @@ display: flex; flex-direction: row; padding: 14px; + min-width: 200px; .file-img { display: inline-flex; width: 50px; @@ -102,13 +103,13 @@ height: 100%; } } - &.expired{ - li{ - width:100%; + &.expired { + li { + width: 100%; white-space: nowrap; - color:#999999; + color: #999999; align-items: center; - line-height:40px; + line-height: 40px; } } } diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/file.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/file.component.ts index 1c089d36..9e889c19 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/file.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/file.component.ts @@ -51,10 +51,14 @@ export class FileComponent implements OnInit { } onClickFileViewer(fileInfo: FileEventJson) { - this.fileViewer.emit(fileInfo); + if (!this.getExpiredFile()) { + this.fileViewer.emit(fileInfo); + } } onSave(value: string) { - this.save.emit({ fileInfo: this.fileInfo, type: value }); + if (!this.getExpiredFile()) { + this.save.emit({ fileInfo: this.fileInfo, type: value }); + } } } diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.html b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.html index 08f637dc..cc124b16 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.html +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.html @@ -1,3 +1,10 @@ -
+
+
+ 기간이 만료된 파일입니다 +
diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.scss b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.scss index b8b6c028..5d3d13e0 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.scss +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.scss @@ -1,7 +1,24 @@ -.bubble-main{ - padding:10px; - img{ - height:140px; - width:auto; +.bubble-main { + padding: 10px; + position: relative; + + img { + height: 140px; + width: auto; } -} \ No newline at end of file + + .expired-text { + position: absolute; + background-color: rgb(255, 255, 255, 0.6); + width: calc(100% - 20px); + height: calc(100% - 20px); + text-align: center; + display: table; + + span { + color: #666666; + display: table-cell; + vertical-align: middle; + } + } +} diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.ts index 0c66d5fa..1416288b 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/image.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, ViewChild, ElementRef } from '@angular/core'; import { NGXLogger } from 'ngx-logger'; import { FileEventJson } from '@ucap-webmessenger/protocol-event'; @@ -13,7 +13,24 @@ export class ImageComponent implements OnInit { @Input() expired = false; + showExpired = false; + constructor(private logger: NGXLogger) {} ngOnInit() {} + + mouseEnter(event: MouseEvent): void { + if (this.expired) { + this.showExpired = true; + } + event.stopPropagation(); + event.preventDefault(); + } + mouseLeave(event: MouseEvent): void { + if (this.expired) { + this.showExpired = false; + } + event.stopPropagation(); + event.preventDefault(); + } } From d1b7c4585d25f657e24dbf2ab6b108732091aef0 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 4 Dec 2019 13:51:50 +0900 Subject: [PATCH 2/4] =?UTF-8?q?#=20=EC=9D=B4=EC=8A=88=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?[17=20=EC=B5=9C=EC=86=8C=ED=99=94=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EC=8B=9C=20=EC=9E=91=EC=97=85=ED=91=9C=EC=8B=9C=EC=A4=84?= =?UTF-8?q?=EC=97=90=20=EB=A9=94=EC=8B=A0=EC=A0=80=20=EC=95=88=EB=B3=B4?= =?UTF-8?q?=EC=9E=84]=20::=20=EC=B5=9C=EC=86=8C=ED=99=94=EC=8B=9C=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=ED=91=9C=EC=8B=9C=EC=A4=84=EC=97=90=20?= =?UTF-8?q?=EB=B3=B4=EC=9D=B4=EA=B3=A0,=20=EB=8B=AB=EA=B8=B0=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=EC=8B=9C=20=EC=9E=91=EC=97=85=ED=9A=A8=EC=8B=9C?= =?UTF-8?q?=EC=A4=84=EC=97=90=20=EC=97=86=EC=96=B4=EC=A7=80=EB=A9=B0=20tra?= =?UTF-8?q?y=20=EC=97=90=EB=A7=8C=20=ED=91=9C=EC=8B=9C=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 노티 발생시 작업표시줄에 깜빡이도록 기능 추가. --- .../src/lib/types/channel.type.ts | 3 ++- .../src/app/AppWindow.ts | 14 +++++++++----- .../ucap-webmessenger-electron/src/index.ts | 4 ++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/electron-projects/ucap-webmessenger-electron-core/src/lib/types/channel.type.ts b/electron-projects/ucap-webmessenger-electron-core/src/lib/types/channel.type.ts index aab87d73..d9f55c52 100644 --- a/electron-projects/ucap-webmessenger-electron-core/src/lib/types/channel.type.ts +++ b/electron-projects/ucap-webmessenger-electron-core/src/lib/types/channel.type.ts @@ -26,7 +26,8 @@ export enum ElectronBrowserWindowChannel { Show = 'show', Close = 'close', Closed = 'closed', - ReadyToShow = 'ready-to-show' + ReadyToShow = 'ready-to-show', + Focus = 'focus' } export enum ElectronWebContentsChannel { diff --git a/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts b/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts index db325595..ab45380d 100644 --- a/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts +++ b/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts @@ -65,7 +65,7 @@ export class AppWindow { this.window = new BrowserWindow(windowOptions); savedWindowState.manage(this.window); - let quitting = false; + let quitting = true; app.on(ElectronAppChannel.BeforeQuit, () => { quitting = true; }); @@ -92,10 +92,14 @@ export class AppWindow { } }); this.window.on(ElectronBrowserWindowChannel.Close, e => { - if (!quitting) { - e.preventDefault(); - this.window.hide(); - } + // if (!quitting) { + e.preventDefault(); + this.window.hide(); + // } + }); + this.window.on(ElectronBrowserWindowChannel.Focus, e => { + console.log(e); + this.window.flashFrame(false); }); } diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index b5c5bf95..cc623dac 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -350,6 +350,7 @@ ipcMain.on( ) : '', onClick: e => { + appWindow.browserWindow.flashFrame(false); appWindow.browserWindow.webContents.send( ChatChannel.OpenRoom, noti.roomSeq @@ -358,12 +359,15 @@ ipcMain.on( e.close(); } }); + + appWindow.browserWindow.flashFrame(true); } ); ipcMain.on( NotificationChannel.CloseAllNotify, (event: IpcMainEvent, ...args: any[]) => { + appWindow.browserWindow.flashFrame(false); console.log('Channel.closeAllNotify', args); } ); From baafd13cd67af0436ec2ff7dd9605170ca6bbcbd Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 4 Dec 2019 14:36:15 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=EA=B8=B0=EA=B0=84=EB=A7=8C=EB=A3=8C?= =?UTF-8?q?=EB=90=9C=20=ED=8C=8C=EC=9D=BC=20=EC=A0=84=EB=8B=AC=20=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EB=AA=BB=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/AppWindow.ts | 1 - .../components/messages.component.html | 4 +++- .../messenger/components/messages.component.ts | 17 +++++++++++++---- .../src/lib/models/info.ts | 13 +++++++++++++ 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts b/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts index ab45380d..7293ec1b 100644 --- a/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts +++ b/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts @@ -98,7 +98,6 @@ export class AppWindow { // } }); this.window.on(ElectronBrowserWindowChannel.Focus, e => { - console.log(e); this.window.flashFrame(false); }); } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html index d7d90dc1..2d7b9239 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html @@ -172,7 +172,7 @@ > -
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts index 4c0a9cf0..62e67ebc 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts @@ -1,9 +1,9 @@ -import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core'; +import { Component, OnInit, ViewChild, OnDestroy, Inject } from '@angular/core'; import { MatPaginator, MatTableDataSource } from '@angular/material'; import { FileInfo, FileDownloadInfo, - FileType, + FileType } from '@ucap-webmessenger/protocol-file'; import { Subscription, combineLatest } from 'rxjs'; import { Store, select } from '@ngrx/store'; @@ -14,7 +14,7 @@ import { tap, map } from 'rxjs/operators'; import { Info, EventJson, - FileEventJson, + FileEventJson } from '@ucap-webmessenger/protocol-event'; import { FileUtil } from '@ucap-webmessenger/core'; import { CommonApiService } from '@ucap-webmessenger/api-common'; @@ -24,6 +24,8 @@ import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { KEY_VER_INFO } from '@app/types/ver-info.type'; +import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native'; +import { NGXLogger } from 'ngx-logger'; export interface FileInfoTotal { info: FileInfo; @@ -34,7 +36,7 @@ export interface FileInfoTotal { @Component({ selector: 'app-layout-chat-right-drawer-album-box', templateUrl: './album-box.component.html', - styleUrls: ['./album-box.component.scss'], + styleUrls: ['./album-box.component.scss'] }) export class AlbumBoxComponent implements OnInit, OnDestroy { filteredList: FileInfoTotal[] = []; @@ -55,7 +57,9 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { constructor( private store: Store, private sessionStorageService: SessionStorageService, - private commonApiService: CommonApiService + private commonApiService: CommonApiService, + @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, + private loggger: NGXLogger ) { this.loginRes = this.sessionStorageService.get( KEY_LOGIN_RES_INFO @@ -81,7 +85,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { ), this.store.pipe( select(AppStore.MessengerSelector.EventSelector.selectAllInfoList) - ), + ) ]) .pipe( tap(() => (this.fileInfoTotal = [])), @@ -109,7 +113,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { checkInfo => checkInfo.seq === fileInfo.seq ), eventInfo: - events.length > 0 ? (events[0] as Info) : null, + events.length > 0 ? (events[0] as Info) : null }); }); @@ -135,7 +139,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { userSeq: this.loginRes.userSeq, deviceType: this.environmentsInfo.deviceType, token: this.loginRes.tokenString, - attachmentsSeq: fileInfo.info.seq, + attachmentsSeq: fileInfo.info.seq }, this.sessionVerinfo.downloadUrl ); @@ -195,4 +199,18 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { onClickDownload(fileInfo: FileInfoTotal) { console.log(fileInfo); } + + onClickOpenDownloadFolder(): void { + this.nativeService + .openDefaultDownloadFolder() + .then(result => { + if (!!result) { + } else { + throw new Error('response Error'); + } + }) + .catch(reason => { + this.loggger.error(reason); + }); + } } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.html index 0f7dab5b..d1460725 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.html @@ -202,7 +202,11 @@ > Download All - diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts index c583a335..463bfdba 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/file-box.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core'; +import { Component, OnInit, ViewChild, OnDestroy, Inject } from '@angular/core'; import { MatPaginator, MatTableDataSource, MatSort } from '@angular/material'; import { FileInfo, @@ -15,6 +15,8 @@ import { FileUtil } from '@ucap-webmessenger/core'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; +import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; +import { NGXLogger } from 'ngx-logger'; export interface FileInfoTotal { info: FileInfo; @@ -46,7 +48,9 @@ export class FileBoxComponent implements OnInit, OnDestroy { constructor( private store: Store, - private sessionStorageService: SessionStorageService + private sessionStorageService: SessionStorageService, + @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, + private loggger: NGXLogger ) { this.loginRes = this.sessionStorageService.get( KEY_LOGIN_RES_INFO @@ -212,4 +216,18 @@ export class FileBoxComponent implements OnInit, OnDestroy { onClickRow(row: FileInfoTotal) { this.selectedFile = row; } + + onClickOpenDownloadFolder(): void { + this.nativeService + .openDefaultDownloadFolder() + .then(result => { + if (!!result) { + } else { + throw new Error('response Error'); + } + }) + .catch(reason => { + this.loggger.error(reason); + }); + } } diff --git a/projects/ucap-webmessenger-native-browser/src/lib/services/browser-native.service.ts b/projects/ucap-webmessenger-native-browser/src/lib/services/browser-native.service.ts index 519e7811..c5e4ab72 100644 --- a/projects/ucap-webmessenger-native-browser/src/lib/services/browser-native.service.ts +++ b/projects/ucap-webmessenger-native-browser/src/lib/services/browser-native.service.ts @@ -99,6 +99,22 @@ export class BrowserNativeService extends NativeService { }); } + openDefaultDownloadFolder(): Promise { + return new Promise((resolve, reject) => { + resolve(true); + }); + } + openTargetFolder(folderPath?: string, make?: boolean): Promise { + return new Promise((resolve, reject) => { + resolve(true); + }); + } + openTargetItem(filePath?: string): Promise { + return new Promise((resolve, reject) => { + resolve(true); + }); + } + windowStateChanged(): Observable { return new Observable(subscriber => { try { diff --git a/projects/ucap-webmessenger-native-electron/src/lib/services/electron-native.service.ts b/projects/ucap-webmessenger-native-electron/src/lib/services/electron-native.service.ts index 06601094..af3876c4 100644 --- a/projects/ucap-webmessenger-native-electron/src/lib/services/electron-native.service.ts +++ b/projects/ucap-webmessenger-native-electron/src/lib/services/electron-native.service.ts @@ -147,6 +147,44 @@ export class ElectronNativeService implements NativeService { }); } + openDefaultDownloadFolder(): Promise { + return new Promise((resolve, reject) => { + try { + resolve( + this.ipcRenderer.sendSync(FileChannel.OpenFolderItem, undefined, true) + ); + } catch (error) { + reject(error); + } + }); + } + openTargetFolder(folderPath?: string, make?: boolean): Promise { + return new Promise((resolve, reject) => { + try { + resolve( + this.ipcRenderer.sendSync( + FileChannel.OpenFolderItem, + folderPath, + !make ? false : make + ) + ); + } catch (error) { + reject(error); + } + }); + } + openTargetItem(filePath?: string): Promise { + return new Promise((resolve, reject) => { + try { + resolve( + this.ipcRenderer.sendSync(FileChannel.OpenFolderItem, filePath, false) + ); + } catch (error) { + reject(error); + } + }); + } + windowStateChanged(): Observable { if (!this.windowStateChangedSubject) { this.windowStateChangedSubject = new Subject(); diff --git a/projects/ucap-webmessenger-native-electron/src/lib/types/channel.type.ts b/projects/ucap-webmessenger-native-electron/src/lib/types/channel.type.ts index 2b3aa1e1..fe516543 100644 --- a/projects/ucap-webmessenger-native-electron/src/lib/types/channel.type.ts +++ b/projects/ucap-webmessenger-native-electron/src/lib/types/channel.type.ts @@ -18,6 +18,7 @@ export enum UpdaterChannel { } export enum FileChannel { + OpenFolderItem = 'UCAP::file::openFolderItem', ShowImageViewer = 'UCAP::file::showImageViewer', SaveFile = 'UCAP::file::saveFile', ReadFile = 'UCAP::file::readFile' diff --git a/projects/ucap-webmessenger-native/src/lib/services/native.service.ts b/projects/ucap-webmessenger-native/src/lib/services/native.service.ts index 735342c8..a4ae7f39 100644 --- a/projects/ucap-webmessenger-native/src/lib/services/native.service.ts +++ b/projects/ucap-webmessenger-native/src/lib/services/native.service.ts @@ -27,6 +27,12 @@ export abstract class NativeService { path?: string ): Promise; abstract readFile(path: string): Promise; + abstract openDefaultDownloadFolder(): Promise; + abstract openTargetFolder( + folderPath?: string, + make?: boolean + ): Promise; + abstract openTargetItem(filePath?: string): Promise; abstract windowStateChanged(): Observable; abstract windowClose(): void;