From 66d32415d4259d6cbdadb433d42e4ab3d9e53262 Mon Sep 17 00:00:00 2001 From: leejinho Date: Fri, 14 Feb 2020 17:28:17 +0900 Subject: [PATCH 01/10] version up to 0.0.22 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7141823..7128d79e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ucap-webmessenger", - "version": "0.0.21", + "version": "0.0.22", "author": { "name": "LG CNS", "email": "lgucap@lgcns.com" From 14dcd34688dc826f1968a3470cd17d324cff0938 Mon Sep 17 00:00:00 2001 From: leejinho Date: Fri, 14 Feb 2020 17:28:38 +0900 Subject: [PATCH 02/10] =?UTF-8?q?weblink=20=EA=B4=80=EB=A0=A8=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EC=98=A4=ED=94=88=EB=A1=9C=EC=A7=81=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 --- .../native/components/top-bar.component.ts | 73 ++++++++++++++++--- .../src/lib/utils/window.util.ts | 17 +++++ .../ucap-webmessenger-core/src/public-api.ts | 1 + .../src/lib/utils/SmsUtils.ts | 8 +- 4 files changed, 86 insertions(+), 13 deletions(-) create mode 100644 projects/ucap-webmessenger-core/src/lib/utils/window.util.ts diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts index 012a49b2..80159b4c 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts @@ -64,7 +64,7 @@ import { import { DialogService } from '@ucap-webmessenger/ui'; import { DOCUMENT } from '@angular/common'; import { MatMenu, MatRadioChange, MatMenuTrigger } from '@angular/material'; -import { StatusCode, StatusType } from '@ucap-webmessenger/core'; +import { StatusCode, StatusType, WindowUtil } from '@ucap-webmessenger/core'; import { StatusInfo, MessageIndexType, @@ -411,16 +411,69 @@ export class TopBarComponent implements OnInit, OnDestroy { .replace(/(\(%USER_ID%\))/g, loginId) .replace(/(\(%USER_PASS%\))/g, loginPw); - // this.nativeService.openDefaultBrowser(url, { - // features: - // 'menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=400,height=400' - // }); + let width = 1160; + let height = 800; + let openType = 'INNER-POPUP'; + switch (link.key) { + case WebLinkType.Sms: + /** SMS URL */ + { + width = 685; + height = 640; + } + break; + // case WebLinkType.Itsvcdesk: + // /** IT서비스데스크 URL */ + // { + // width = 1400; + // height = 1000; + // } + // break; + case WebLinkType.Itsvcdesk: + /** IT서비스데스크 URL */ + case WebLinkType.Dsp: + /** DSP URL */ + { + openType = 'DEFAULT-BROWSER'; + } + break; + case WebLinkType.Webhard: + /** 웹하드 URL */ + case WebLinkType.Conf: + /** 화상회의 URL */ + case WebLinkType.Ep: + /** EP URL */ + case WebLinkType.Sop: + /** S&OP회의 URL */ + case WebLinkType.Som: + /** S&OM회의 URL */ + case WebLinkType.Elephant: + /** 코끼리 URL */ + case WebLinkType.UrgntNews: + /** 개인속보 URL */ + case WebLinkType.MailCnt: + /** 메일Count URL */ + case WebLinkType.Mail: + /** 메일 링크 URL */ + case WebLinkType.PaymentCnt: + /** 결재Count URL */ + case WebLinkType.Payment: + /** 결재링크 URL */ + case WebLinkType.ChgPassword: + /** 비밀번호변경 URL ; PC 메신저만 해당 비밀번호 만료시 */ + break; + } - open( - url, - link.title, - 'frame=true,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=1000,height=800' - ); + if (openType === 'DEFAULT-BROWSER') { + // // Old popup open.. >> default browser open. + // this.nativeService.openDefaultBrowser(url, { + // features: + // 'menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=400,height=400' + // }); + this.nativeService.openDefaultBrowser(url); + } else { + WindowUtil.popupOpen(url, link.title, width, height); + } } onClosedProfileMenu() { diff --git a/projects/ucap-webmessenger-core/src/lib/utils/window.util.ts b/projects/ucap-webmessenger-core/src/lib/utils/window.util.ts new file mode 100644 index 00000000..7093b004 --- /dev/null +++ b/projects/ucap-webmessenger-core/src/lib/utils/window.util.ts @@ -0,0 +1,17 @@ +export class WindowUtil { + public static popupOpen( + url: string, + title: string = 'Messenger', + width: number, + height: number + ): void { + let optionStr = `frame=true,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no`; + if (width > 0) { + optionStr += `,width=${width}`; + } + if (width > 0) { + optionStr += `,height=${height + 15}`; + } + open(url, title, optionStr); + } +} diff --git a/projects/ucap-webmessenger-core/src/public-api.ts b/projects/ucap-webmessenger-core/src/public-api.ts index 6ac6bb66..d02bcbe7 100644 --- a/projects/ucap-webmessenger-core/src/public-api.ts +++ b/projects/ucap-webmessenger-core/src/public-api.ts @@ -25,6 +25,7 @@ export * from './lib/utils/mime.util'; export * from './lib/utils/object.util'; export * from './lib/utils/sticker.util'; export * from './lib/utils/string.util'; +export * from './lib/utils/window.util'; export * from './lib/config/host.config'; export * from './lib/config/url.config'; diff --git a/projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts b/projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts index 925b69a8..cc178219 100644 --- a/projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts +++ b/projects/ucap-webmessenger-daesang/src/lib/utils/SmsUtils.ts @@ -3,6 +3,7 @@ import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { KEY_URL_INFO } from '@app/types'; import { NativeService } from '@ucap-webmessenger/native'; import { WebLinkType } from '../types/web-link.type'; +import { WindowUtil } from '@ucap-webmessenger/core'; export class SmsUtils { constructor( @@ -39,10 +40,11 @@ export class SmsUtils { const url = this.url.replace(/(\(%USER_TOKEN%\))/g, token); // this.nativeService.openDefaultBrowser(url); - open( - url + `&ruser=${employeeNum},`, // ruser 파라미터에 ','가 마지막에 꼭 붙어야 한다. + WindowUtil.popupOpen( + url + `&ruser=${employeeNum},`, 'DaesangSMS', - 'frame=true,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=685,height=700' + 685, + 640 ); } } From 23507a52aad66e6f54866fc0bc33eab2855f31d0 Mon Sep 17 00:00:00 2001 From: khk Date: Fri, 14 Feb 2020 17:33:37 +0900 Subject: [PATCH 03/10] =?UTF-8?q?=EC=84=B8=EB=A1=9C=ED=98=95=20mat-tab=20?= =?UTF-8?q?=EB=9D=BC=EC=9D=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/clipboard.dialog.component.html | 8 +- .../chat/clipboard.dialog.component.scss | 93 ++++++++++--------- .../src/assets/scss/global/_default.scss | 26 ++++-- 3 files changed, 72 insertions(+), 55 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/clipboard.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/clipboard.dialog.component.html index 662b94bd..e1672ad4 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/clipboard.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/clipboard.dialog.component.html @@ -15,13 +15,15 @@ - + {{ 'common.file.clipboardType.text' | translate }} -
{{ data.content.text }}
+
+ {{ data.content.text }} +
From 5b84d02f7b9d367c24403e457ced577422734346 Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 17 Feb 2020 10:49:09 +0900 Subject: [PATCH 06/10] =?UTF-8?q?bugfix=20::=20wlndowstateChanged=20?= =?UTF-8?q?=EC=9D=98=20=EC=98=B5=EC=A0=80=EB=B2=84=EB=B8=94=EC=9D=B4=20dis?= =?UTF-8?q?patch=20=EB=90=98=EC=A7=80=20=EC=95=8A=EC=95=84=20noti=20?= =?UTF-8?q?=EC=AA=BD=EC=9D=B4=20=EC=9B=80=EC=A7=81=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/services/notification.service.ts | 13 +++++++------ .../src/lib/services/browser-native.service.ts | 3 +++ .../src/lib/services/electron-native.service.ts | 16 ++++++++++++++++ .../src/lib/services/native.service.ts | 1 + 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts index 7f9eff2c..dbec144a 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -209,10 +209,9 @@ export class AppNotificationService { (state: any) => state.messenger.sync.room.entities as Dictionary ) - ), - this.nativeService.windowStateChanged() + ) ), - tap(([notiOrRes, curRoomInfo, roomList, windowStateChanged]) => { + tap(([notiOrRes, curRoomInfo, roomList]) => { switch (notiOrRes.SSVC_TYPE) { case SSVC_TYPE_EVENT_SEND_RES: case SSVC_TYPE_EVENT_SEND_NOTI: @@ -241,14 +240,16 @@ export class AppNotificationService { doNoti = false; } + const windowState = this.nativeService.getWindowState(); + // 현재 열려 있는 방일경우 노티 안함. if ( !!curRoomInfo && !!curRoomInfo.roomSeq && curRoomInfo.roomSeq === noti.roomSeq && - !!windowStateChanged && - windowStateChanged !== WindowState.Minimized && - windowStateChanged !== WindowState.Hidden + !!windowState && + windowState !== WindowState.Minimized && + windowState !== WindowState.Hidden ) { doNoti = false; } 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 cb833db0..88daa6e3 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 @@ -227,6 +227,9 @@ export class BrowserNativeService extends NativeService { windowMinimize(): void {} windowMaximize(): void {} + getWindowState(): WindowState { + return WindowState.Normal; + } appExit(): void {} 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 7a16a116..3114ae0c 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 @@ -391,6 +391,22 @@ export class ElectronNativeService implements NativeService { } } + getWindowState(): WindowState { + if (!remote.getCurrentWindow().isVisible()) { + return WindowState.Hidden; + } else if (remote.getCurrentWindow().isMinimized()) { + return WindowState.Minimized; + } else if (remote.getCurrentWindow().isNormal()) { + return WindowState.Normal; + } else if (remote.getCurrentWindow().isMaximized()) { + return WindowState.Maximized; + } else if (remote.getCurrentWindow().isFullScreen()) { + return WindowState.FullScreen; + } else { + return WindowState.Normal; + } + } + appExit(): void { this.ipcRenderer.send(AppChannel.Exit); } 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 03f97d15..66a40df4 100644 --- a/projects/ucap-webmessenger-native/src/lib/services/native.service.ts +++ b/projects/ucap-webmessenger-native/src/lib/services/native.service.ts @@ -72,6 +72,7 @@ export abstract class NativeService { abstract windowClose(): void; abstract windowMinimize(): void; abstract windowMaximize(): void; + abstract getWindowState(): WindowState; abstract zoomTo(factor: number): Promise; abstract appExit(): void; From 1e76418569482550c51d040100fd319bf3be7485 Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 17 Feb 2020 10:49:21 +0900 Subject: [PATCH 07/10] =?UTF-8?q?=EC=9B=B9=EB=A7=81=ED=81=AC=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../native/components/top-bar.component.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts index 80159b4c..c86bc5a7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts @@ -429,18 +429,17 @@ export class TopBarComponent implements OnInit, OnDestroy { // height = 1000; // } // break; + case WebLinkType.Conf: + /** 화상회의 URL */ + { + } + break; case WebLinkType.Itsvcdesk: /** IT서비스데스크 URL */ case WebLinkType.Dsp: - /** DSP URL */ - { - openType = 'DEFAULT-BROWSER'; - } - break; + /** DSP URL */ case WebLinkType.Webhard: /** 웹하드 URL */ - case WebLinkType.Conf: - /** 화상회의 URL */ case WebLinkType.Ep: /** EP URL */ case WebLinkType.Sop: @@ -461,6 +460,9 @@ export class TopBarComponent implements OnInit, OnDestroy { /** 결재링크 URL */ case WebLinkType.ChgPassword: /** 비밀번호변경 URL ; PC 메신저만 해당 비밀번호 만료시 */ + { + openType = 'DEFAULT-BROWSER'; + } break; } From 10744cfb600a71243b0677180a6d8dfdd0534ddd Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 17 Feb 2020 10:49:54 +0900 Subject: [PATCH 08/10] =?UTF-8?q?#=20=EC=9D=B4=EC=8A=88=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=20246?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lib/components/messages.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index 9c4caf79..a0943fd9 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -185,10 +185,10 @@ export class MessagesComponent implements OnInit, OnDestroy { this.roomInfo.roomSeq !== roomInfo.roomSeq) ) { this.baseEventSeq = 0; + this.showMore = false; } this.roomInfo = roomInfo; - this.showMore = false; /** [S] initializing by changed room */ // reset :: roomLastEventSeq From f113e66377ab1c7f1175c9f9149a9839dbf527d8 Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 17 Feb 2020 11:36:06 +0900 Subject: [PATCH 09/10] =?UTF-8?q?#=20=EC=9D=B4=EC=8A=88=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=20236?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messenger/dialogs/chat/create-chat.dialog.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts index 3045e5b3..7fca4835 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts @@ -182,6 +182,12 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { const loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); this.companyCode = loginInfo.companyCode; + this.store.dispatch( + SettingsStore.organizationTreeActivated({ + activate: false + }) + ); + this.companyList$ = this.store.pipe( select(AppStore.SettingSelector.CompanySelector.companyList) ); From d6b518f29bc38288e7a19ba8aa622e8ade1f4161 Mon Sep 17 00:00:00 2001 From: leejinho Date: Mon, 17 Feb 2020 13:12:42 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fake=20image=20=EC=AA=BD=EC=A7=80?= =?UTF-8?q?=EC=AA=BD=20=EC=B2=98=EB=A6=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lib/components/write.component.ts | 73 ++++++++++++++----- 1 file changed, 56 insertions(+), 17 deletions(-) diff --git a/projects/ucap-webmessenger-ui-message/src/lib/components/write.component.ts b/projects/ucap-webmessenger-ui-message/src/lib/components/write.component.ts index e61131e3..69a009d2 100644 --- a/projects/ucap-webmessenger-ui-message/src/lib/components/write.component.ts +++ b/projects/ucap-webmessenger-ui-message/src/lib/components/write.component.ts @@ -178,26 +178,32 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit { return; } - for (let i = 0; i < fileList.length; i++) { - const file = fileList.item(i); + this.validUploadFile(fileList).then(async result => { + if (!result) { + return; + } else { + for (let i = 0; i < fileList.length; i++) { + const file = fileList.item(i); - const dataUrl = await FileUtil.fromBlobToDataUrl(file); - const img = document.createElement('img'); - img.src = dataUrl as string; - img.setAttribute('style', 'max-height:250px; max-width:250px;'); - img[ATTR_FILE] = file; - self.insertNode(img); + const dataUrl = await FileUtil.fromBlobToDataUrl(file); + const img = document.createElement('img'); + img.src = dataUrl as string; + img.setAttribute('style', 'max-height:250px; max-width:250px;'); + img[ATTR_FILE] = file; + self.insertNode(img); - const empty = document.createElement('div'); - empty.innerHTML = ' 
'; - self.insertNode(empty, true); - } + const empty = document.createElement('div'); + empty.innerHTML = ' 
'; + self.insertNode(empty, true); + } - self.fileInput.nativeElement.value = ''; - self.fileInput.nativeElement.onchange = undefined; + self.fileInput.nativeElement.value = ''; + self.fileInput.nativeElement.onchange = undefined; - self.checkContentLength(); - self.changeDetectorRef.detectChanges(); + self.checkContentLength(); + self.changeDetectorRef.detectChanges(); + } + }); }; } @@ -228,7 +234,7 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit { }; } - validUploadFile(fileList: FileList): boolean { + async validUploadFile(fileList: FileList): Promise { let valid = true; if (this.fileAllowSize > 0) { for (let i = 0; i < fileList.length; i++) { @@ -284,6 +290,39 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit { return valid; } + const files: File[] = []; + for (let i = 0; i < fileList.length; i++) { + files.push(fileList.item(i)); + } + const fakeMedia = await this.commonApiService.checkInvalidMediaMimeForFileTalk( + files + ); + if (!fakeMedia.accept) { + this.ngZone.run(() => { + this.snackBarService.openFromComponent< + AlertSnackbarComponent, + AlertSnackbarData + >(AlertSnackbarComponent, { + duration: 1000, + verticalPosition: 'bottom', + horizontalPosition: 'center', + data: { + html: this.translateService.instant( + 'common.file.errors.notAcceptableMime', + { + supporedType: + fakeMedia.rejected.length > 0 + ? fakeMedia.rejected.join(',') + : '' + } + ) + } + }); + }); + valid = false; + return valid; + } + return valid; }