diff --git a/package.json b/package.json index f80e9626..d243627f 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" diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html index b01b9f76..cb2ee477 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.html @@ -74,7 +74,7 @@ [userInfo]="userInfo" [sessionVerinfo]="sessionVerinfo" [selectedUserList]="selectedUserList" - [checkable]="userInfo.seq !== loginRes.userSeq" + [checkable]="!!loginRes && userInfo.seq !== loginRes.userSeq" [checkDisabled]="!getCheckableUser(userInfo)" [isChecked]="getCheckedUser(userInfo)" (checkUser)="onCheckUser($event)" 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 }} +
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..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 @@ -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,71 @@ 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.Conf: + /** 화상회의 URL */ + { + } + break; + case WebLinkType.Itsvcdesk: + /** IT서비스데스크 URL */ + case WebLinkType.Dsp: + /** DSP URL */ + case WebLinkType.Webhard: + /** 웹하드 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 메신저만 해당 비밀번호 만료시 */ + { + openType = 'DEFAULT-BROWSER'; + } + 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-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-app/src/assets/scss/global/_default.scss b/projects/ucap-webmessenger-app/src/assets/scss/global/_default.scss index 8dd59ef1..395102dc 100644 --- a/projects/ucap-webmessenger-app/src/assets/scss/global/_default.scss +++ b/projects/ucap-webmessenger-app/src/assets/scss/global/_default.scss @@ -407,15 +407,21 @@ $daesang-grey: ( mat-tab-group[vertical] { display: flex; flex-direction: row; - .mat-tab-labels { - display: flex; - flex-direction: column; - align-content: flex-start; - .mat-tab-label { - justify-content: flex-start; - padding: 0; - .mat-checkbox { - margin-right: 8px; + .mat-tab-header { + border-bottom: none; + .mat-tab-labels { + display: flex; + flex-direction: column; + align-content: flex-start; + .mat-tab-label { + justify-content: flex-start; + padding: 0; + &[aria-selected='true'] { + opacity: 1; + } + .mat-checkbox { + margin-right: 8px; + } } } } @@ -425,7 +431,7 @@ $daesang-grey: ( .mat-tab-body-wrapper { flex: 1 1 auto; border-left: 1px solid #dddddd; - padding: 0 10px; + padding: 0; } } 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 ); } } 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; 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 355e1595..ccbc43a5 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 @@ -182,10 +182,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 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 e591babb..7755bd5d 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++) { @@ -283,6 +289,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; }