This commit is contained in:
richard-loafle 2020-02-17 14:39:44 +09:00
commit c0bfae71e2
17 changed files with 268 additions and 104 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "ucap-webmessenger", "name": "ucap-webmessenger",
"version": "0.0.21", "version": "0.0.22",
"author": { "author": {
"name": "LG CNS", "name": "LG CNS",
"email": "lgucap@lgcns.com" "email": "lgucap@lgcns.com"

View File

@ -74,7 +74,7 @@
[userInfo]="userInfo" [userInfo]="userInfo"
[sessionVerinfo]="sessionVerinfo" [sessionVerinfo]="sessionVerinfo"
[selectedUserList]="selectedUserList" [selectedUserList]="selectedUserList"
[checkable]="userInfo.seq !== loginRes.userSeq" [checkable]="!!loginRes && userInfo.seq !== loginRes.userSeq"
[checkDisabled]="!getCheckableUser(userInfo)" [checkDisabled]="!getCheckableUser(userInfo)"
[isChecked]="getCheckedUser(userInfo)" [isChecked]="getCheckedUser(userInfo)"
(checkUser)="onCheckUser($event)" (checkUser)="onCheckUser($event)"

View File

@ -15,13 +15,15 @@
<mat-tab-group animationDuration="0ms" vertical> <mat-tab-group animationDuration="0ms" vertical>
<mat-tab *ngIf="data.content.text"> <mat-tab *ngIf="data.content.text">
<ng-template mat-tab-label> <ng-template mat-tab-label>
<mat-checkbox #chkText> </mat-checkbox> <mat-checkbox #chkText checked="true"> </mat-checkbox>
<span class="title-text">{{ <span class="title-text">{{
'common.file.clipboardType.text' | translate 'common.file.clipboardType.text' | translate
}}</span> }}</span>
</ng-template> </ng-template>
<perfect-scrollbar> <perfect-scrollbar>
<div style="white-space: pre-wrap;">{{ data.content.text }}</div> <div class="clipboard-text" style="white-space: pre-wrap;">
{{ data.content.text }}
</div>
</perfect-scrollbar> </perfect-scrollbar>
</mat-tab> </mat-tab>
<!-- <mat-tab *ngIf="data.content.rtf"> <!-- <mat-tab *ngIf="data.content.rtf">
@ -59,7 +61,7 @@
</ng-template> </ng-template>
<perfect-scrollbar> <perfect-scrollbar>
<div> <div class="clipboard-img">
<img [src]="data.content.imageDataUrl" /> <img [src]="data.content.imageDataUrl" />
</div> </div>
</perfect-scrollbar> </perfect-scrollbar>

View File

@ -1,55 +1,64 @@
.clipboard-frame { .clipboard {
padding: 16px; &-frame {
height: 100%; padding: 16px;
min-width: 500px; height: 100%;
position: relative; min-width: 500px;
.mat-dialog-container {
position: relative; position: relative;
}
.mat-card-header { .mat-dialog-container {
position: relative; position: relative;
width: 100%;
border-bottom: 1px solid #dddddd;
margin-bottom: 12px;
.btn-dialog-close {
font-size: 20px;
display: flex;
margin-left: auto;
align-self: flex-start;
color: #444444;
} }
}
.mat-card-content { .mat-card-header {
flex: 0 0 auto;
display: flex;
align-items: flex-start;
height: calc(100% - 100px);
border-bottom: 1px solid #dddddd;
.clipboard-tab {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; border-bottom: 1px solid #dddddd;
.mat-tab-group { margin-bottom: 12px;
.btn-dialog-close {
font-size: 20px;
display: flex; display: flex;
flex-direction: row; margin-left: auto;
align-self: flex-start;
color: #444444;
}
}
.mat-card-content {
flex: 0 0 auto;
display: flex;
align-items: flex-start;
height: calc(100% - 100px);
border-bottom: 1px solid #dddddd;
.clipboard-tab {
position: relative; position: relative;
height: 100%;
width: 100%; width: 100%;
height: 100%;
.mat-tab-group {
display: flex;
flex-direction: row;
position: relative;
height: 100%;
width: 100%;
}
}
}
.button-farm {
text-align: right;
position: absolute;
width: 100%;
bottom: 10px;
margin: 0 -16px;
.mat-primary {
margin-left: 4px;
} }
} }
} }
&-text {
.button-farm { padding: 0 10px;
text-align: right; white-space: pre-wrap;
position: absolute; }
width: 100%; &-img {
bottom: 10px; padding: 0 10px;
margin: 0 -16px;
.mat-primary {
margin-left: 4px;
}
} }
} }

View File

@ -182,6 +182,12 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO); const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
this.companyCode = loginInfo.companyCode; this.companyCode = loginInfo.companyCode;
this.store.dispatch(
SettingsStore.organizationTreeActivated({
activate: false
})
);
this.companyList$ = this.store.pipe( this.companyList$ = this.store.pipe(
select(AppStore.SettingSelector.CompanySelector.companyList) select(AppStore.SettingSelector.CompanySelector.companyList)
); );

View File

@ -38,7 +38,21 @@
perfectScrollbar perfectScrollbar
fxFlexFill fxFlexFill
> >
<ucap-profile-user-list-item <ucap-daesang-profile-user-list-item
*cdkVirtualFor="let userInfo of data.selectedUserList"
[userInfo]="userInfo"
[showPresence]="false"
[sessionVerinfo]="sessionVerinfo"
[selectedUserList]="selectedUserList"
[checkable]="!!loginRes && userInfo.seq !== loginRes.userSeq"
[checkDisabled]="false"
[isChecked]="getCheckedUser(userInfo)"
(checkUser)="onCheckUser($event)"
(click)="onToggleUser(userInfo)"
(openProfile)="onClickOpenProfile($event)"
>
</ucap-daesang-profile-user-list-item>
<!-- <ucap-profile-user-list-item
*cdkVirtualFor="let userInfo of data.selectedUserList" *cdkVirtualFor="let userInfo of data.selectedUserList"
[userInfo]="userInfo" [userInfo]="userInfo"
[showPresence]="false" [showPresence]="false"
@ -50,16 +64,8 @@
(checkUser)="onCheckUser($event)" (checkUser)="onCheckUser($event)"
(click)="onToggleUser(userInfo)" (click)="onToggleUser(userInfo)"
(openProfile)="onClickOpenProfile($event)" (openProfile)="onClickOpenProfile($event)"
[matTooltip]="
userInfo.companyName +
' / ' +
userInfo.lineNumber +
' / ' +
userInfo.hpNumber
"
matTooltipPosition="after"
> >
</ucap-profile-user-list-item> </ucap-profile-user-list-item> -->
</cdk-virtual-scroll-viewport> </cdk-virtual-scroll-viewport>
</div> </div>
</mat-card-content> </mat-card-content>

View File

@ -64,7 +64,7 @@ import {
import { DialogService } from '@ucap-webmessenger/ui'; import { DialogService } from '@ucap-webmessenger/ui';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { MatMenu, MatRadioChange, MatMenuTrigger } from '@angular/material'; import { MatMenu, MatRadioChange, MatMenuTrigger } from '@angular/material';
import { StatusCode, StatusType } from '@ucap-webmessenger/core'; import { StatusCode, StatusType, WindowUtil } from '@ucap-webmessenger/core';
import { import {
StatusInfo, StatusInfo,
MessageIndexType, MessageIndexType,
@ -411,16 +411,71 @@ export class TopBarComponent implements OnInit, OnDestroy {
.replace(/(\(%USER_ID%\))/g, loginId) .replace(/(\(%USER_ID%\))/g, loginId)
.replace(/(\(%USER_PASS%\))/g, loginPw); .replace(/(\(%USER_PASS%\))/g, loginPw);
// this.nativeService.openDefaultBrowser(url, { let width = 1160;
// features: let height = 800;
// 'menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=400,height=400' 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( if (openType === 'DEFAULT-BROWSER') {
url, // // Old popup open.. >> default browser open.
link.title, // this.nativeService.openDefaultBrowser(url, {
'frame=true,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=1000,height=800' // 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() { onClosedProfileMenu() {

View File

@ -209,10 +209,9 @@ export class AppNotificationService {
(state: any) => (state: any) =>
state.messenger.sync.room.entities as Dictionary<RoomInfo> state.messenger.sync.room.entities as Dictionary<RoomInfo>
) )
), )
this.nativeService.windowStateChanged()
), ),
tap(([notiOrRes, curRoomInfo, roomList, windowStateChanged]) => { tap(([notiOrRes, curRoomInfo, roomList]) => {
switch (notiOrRes.SSVC_TYPE) { switch (notiOrRes.SSVC_TYPE) {
case SSVC_TYPE_EVENT_SEND_RES: case SSVC_TYPE_EVENT_SEND_RES:
case SSVC_TYPE_EVENT_SEND_NOTI: case SSVC_TYPE_EVENT_SEND_NOTI:
@ -241,14 +240,16 @@ export class AppNotificationService {
doNoti = false; doNoti = false;
} }
const windowState = this.nativeService.getWindowState();
// 현재 열려 있는 방일경우 노티 안함. // 현재 열려 있는 방일경우 노티 안함.
if ( if (
!!curRoomInfo && !!curRoomInfo &&
!!curRoomInfo.roomSeq && !!curRoomInfo.roomSeq &&
curRoomInfo.roomSeq === noti.roomSeq && curRoomInfo.roomSeq === noti.roomSeq &&
!!windowStateChanged && !!windowState &&
windowStateChanged !== WindowState.Minimized && windowState !== WindowState.Minimized &&
windowStateChanged !== WindowState.Hidden windowState !== WindowState.Hidden
) { ) {
doNoti = false; doNoti = false;
} }

View File

@ -407,15 +407,21 @@ $daesang-grey: (
mat-tab-group[vertical] { mat-tab-group[vertical] {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
.mat-tab-labels { .mat-tab-header {
display: flex; border-bottom: none;
flex-direction: column; .mat-tab-labels {
align-content: flex-start; display: flex;
.mat-tab-label { flex-direction: column;
justify-content: flex-start; align-content: flex-start;
padding: 0; .mat-tab-label {
.mat-checkbox { justify-content: flex-start;
margin-right: 8px; padding: 0;
&[aria-selected='true'] {
opacity: 1;
}
.mat-checkbox {
margin-right: 8px;
}
} }
} }
} }
@ -425,7 +431,7 @@ $daesang-grey: (
.mat-tab-body-wrapper { .mat-tab-body-wrapper {
flex: 1 1 auto; flex: 1 1 auto;
border-left: 1px solid #dddddd; border-left: 1px solid #dddddd;
padding: 0 10px; padding: 0;
} }
} }

View File

@ -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);
}
}

View File

@ -25,6 +25,7 @@ export * from './lib/utils/mime.util';
export * from './lib/utils/object.util'; export * from './lib/utils/object.util';
export * from './lib/utils/sticker.util'; export * from './lib/utils/sticker.util';
export * from './lib/utils/string.util'; export * from './lib/utils/string.util';
export * from './lib/utils/window.util';
export * from './lib/config/host.config'; export * from './lib/config/host.config';
export * from './lib/config/url.config'; export * from './lib/config/url.config';

View File

@ -3,6 +3,7 @@ import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { KEY_URL_INFO } from '@app/types'; import { KEY_URL_INFO } from '@app/types';
import { NativeService } from '@ucap-webmessenger/native'; import { NativeService } from '@ucap-webmessenger/native';
import { WebLinkType } from '../types/web-link.type'; import { WebLinkType } from '../types/web-link.type';
import { WindowUtil } from '@ucap-webmessenger/core';
export class SmsUtils { export class SmsUtils {
constructor( constructor(
@ -39,10 +40,11 @@ export class SmsUtils {
const url = this.url.replace(/(\(%USER_TOKEN%\))/g, token); const url = this.url.replace(/(\(%USER_TOKEN%\))/g, token);
// this.nativeService.openDefaultBrowser(url); // this.nativeService.openDefaultBrowser(url);
open( WindowUtil.popupOpen(
url + `&ruser=${employeeNum},`, // ruser 파라미터에 ','가 마지막에 꼭 붙어야 한다. url + `&ruser=${employeeNum},`,
'DaesangSMS', 'DaesangSMS',
'frame=true,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=685,height=700' 685,
640
); );
} }
} }

View File

@ -227,6 +227,9 @@ export class BrowserNativeService extends NativeService {
windowMinimize(): void {} windowMinimize(): void {}
windowMaximize(): void {} windowMaximize(): void {}
getWindowState(): WindowState {
return WindowState.Normal;
}
appExit(): void {} appExit(): void {}

View File

@ -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 { appExit(): void {
this.ipcRenderer.send(AppChannel.Exit); this.ipcRenderer.send(AppChannel.Exit);
} }

View File

@ -72,6 +72,7 @@ export abstract class NativeService {
abstract windowClose(): void; abstract windowClose(): void;
abstract windowMinimize(): void; abstract windowMinimize(): void;
abstract windowMaximize(): void; abstract windowMaximize(): void;
abstract getWindowState(): WindowState;
abstract zoomTo(factor: number): Promise<number>; abstract zoomTo(factor: number): Promise<number>;
abstract appExit(): void; abstract appExit(): void;

View File

@ -182,10 +182,10 @@ export class MessagesComponent implements OnInit, OnDestroy {
this.roomInfo.roomSeq !== roomInfo.roomSeq) this.roomInfo.roomSeq !== roomInfo.roomSeq)
) { ) {
this.baseEventSeq = 0; this.baseEventSeq = 0;
this.showMore = false;
} }
this.roomInfo = roomInfo; this.roomInfo = roomInfo;
this.showMore = false;
/** [S] initializing by changed room */ /** [S] initializing by changed room */
// reset :: roomLastEventSeq // reset :: roomLastEventSeq

View File

@ -178,26 +178,32 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
return; return;
} }
for (let i = 0; i < fileList.length; i++) { this.validUploadFile(fileList).then(async result => {
const file = fileList.item(i); if (!result) {
return;
} else {
for (let i = 0; i < fileList.length; i++) {
const file = fileList.item(i);
const dataUrl = await FileUtil.fromBlobToDataUrl(file); const dataUrl = await FileUtil.fromBlobToDataUrl(file);
const img = document.createElement('img'); const img = document.createElement('img');
img.src = dataUrl as string; img.src = dataUrl as string;
img.setAttribute('style', 'max-height:250px; max-width:250px;'); img.setAttribute('style', 'max-height:250px; max-width:250px;');
img[ATTR_FILE] = file; img[ATTR_FILE] = file;
self.insertNode(img); self.insertNode(img);
const empty = document.createElement('div'); const empty = document.createElement('div');
empty.innerHTML = '&nbsp;<br/>'; empty.innerHTML = '&nbsp;<br/>';
self.insertNode(empty, true); self.insertNode(empty, true);
} }
self.fileInput.nativeElement.value = ''; self.fileInput.nativeElement.value = '';
self.fileInput.nativeElement.onchange = undefined; self.fileInput.nativeElement.onchange = undefined;
self.checkContentLength(); self.checkContentLength();
self.changeDetectorRef.detectChanges(); self.changeDetectorRef.detectChanges();
}
});
}; };
} }
@ -228,7 +234,7 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
}; };
} }
validUploadFile(fileList: FileList): boolean { async validUploadFile(fileList: FileList): Promise<boolean> {
let valid = true; let valid = true;
if (this.fileAllowSize > 0) { if (this.fileAllowSize > 0) {
for (let i = 0; i < fileList.length; i++) { for (let i = 0; i < fileList.length; i++) {
@ -283,6 +289,39 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
return valid; 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; return valid;
} }