This commit is contained in:
병준 박 2019-11-25 10:57:10 +09:00
commit 746a5f2a5c
10 changed files with 76 additions and 237 deletions

View File

@ -166,6 +166,7 @@ function createTray() {
// accelerator: 'Q',
// selector: 'terminate:',
click: () => {
appWindow.show();
appWindow.browserWindow.webContents.send(MessengerChannel.Logout);
}
},

View File

@ -109,9 +109,8 @@
</ng-template>
</mat-tab>
<mat-tab [aria-label]="MainMenu.Call">
<!-- <mat-tab [aria-label]="MainMenu.Call">
<ng-template mat-tab-label>
<!--<mat-icon>phone</mat-icon>-->
<div class="icon-item" matTooltip="Call" matTooltipPosition="after">
<svg
xmlns="http://www.w3.org/2000/svg"
@ -137,7 +136,7 @@
</svg>
</div>
</ng-template>
</mat-tab>
</mat-tab> -->
</mat-tab-group>
<ucap-profile-my-profile-widget

View File

@ -1,4 +1,4 @@
<!--<mat-card class="confirm-card mat-elevation-z">
<mat-card class="confirm-card mat-elevation-z">
<mat-card-header cdkDrag cdkDragRootElement=".cdk-overlay-pane" cdkDragHandle>
<mat-card-title>{{ data.title }}</mat-card-title>
</mat-card-header>
@ -28,101 +28,4 @@
Yes
</button>
</mat-card-actions>
</mat-card>
-->
<mat-card class="confirm-card mat-elevation-z setting-frame">
<mat-card-header cdkDrag cdkDragRootElement=".cdk-overlay-pane" cdkDragHandle>
<mat-card-title>설정</mat-card-title>
</mat-card-header>
<mat-card-content>
<div fxFlex class="setting-tab">
<mat-tab-group animationDuration="0ms" vertical>
<mat-tab>
<ng-template mat-tab-label>
<span class="mdi mdi-settings"></span>
일반
</ng-template>
<ucap-settings-general class="setting-category general"></ucap-settings-general>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<span class="mdi mdi-lock"></span>
개인정보취급방침
</ng-template>
<ucap-settings-privacy class="setting-category"></ucap-settings-privacy>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<span class="mdi mdi-bell"></span>
알림
</ng-template>
<ucap-settings-notification class="setting-category"></ucap-settings-notification>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<span class="mdi mdi-headset"></span>
장치
</ng-template>
<ucap-settings-device class="setting-category"></ucap-settings-device>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<span class="mdi mdi-view-grid-plus"></span>
사용권한
</ng-template>
<ucap-settings-permission class="setting-category"></ucap-settings-permission>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<span class="mdi mdi-phone"></span>
통화
</ng-template>
<ucap-settings-call class="setting-category"></ucap-settings-call>
</mat-tab>
</mat-tab-group>
<!-- <div class="left-side-tabs-body">
<div
#tabs
id="tabs-0"
class="left-side-tabs-contents"
style="display: block;"
>
ddddd
</div>
<div
#tabs
id="tabs-1"
class="left-side-tabs-contents"
style="display: none;"
>
dddagadsfgadsf
</div>
<div
#tabs
id="tabs-2"
class="left-side-tabs-contents"
style="display: none;"
>
fbkasfldsafkskdf
</div>
<div
#tabs
id="tabs-3"
class="left-side-tabs-contents"
style="display: none;"
>
rgkdsfgkdfglkdsflgs
</div>
</div> -->
</div>
</mat-card-content>
<mat-card-actions class="button-farm flex-row">
<button mat-stroked-button (click)="onClickChoice(false)" class="mat-primary">
No
</button>
<button mat-flat-button (click)="onClickChoice(true)" class="mat-primary">
Yes
</button>
</mat-card-actions>
</mat-card>

View File

@ -1,4 +1,4 @@
/*::ng-deep .mat-card-header-tex{
::ng-deep .mat-card-header-tex{
margin:0;
}
.confirm-card{
@ -23,108 +23,4 @@ form{
.mat-form-field{
width:100%;
}
}*/
::ng-deep .cdk-overlay-pane {
width: 600px;
max-height: 90%;
height:800px;
}
::ng-deep .setting-frame{
padding: 16px;
height:100%;
min-width: 500px;
position: relative;
.mat-dialog-container {
position: relative;
}
.mat-card-header {
position: relative;
width: 100%;
border-bottom:1px solid #dddddd;
margin-bottom: 12px;
}
.mat-card-content {
flex: 0 0 auto;
display: flex;
align-items: flex-start;
height: calc(100% - 100px);
border-bottom:1px solid #dddddd;
.setting-tab{
position: relative;
width:100%;
height:100%;
.mat-tab-body-wrapper{
border-left:1px solid #dddddd;
position: relative;
height:100%;
padding: 0 0 10px 10px;
}
}
}
.button-farm {
text-align: right;
position: absolute;
width: 100%;
bottom: 10px;
.mat-primary {
margin-left: 4px;
}
}
}
::ng-deep .setting-tab{
.mat-tab-group{
position: relative;
height:100%;
width:100%;
.mat-tab-header{
.mat-tab-label-container{
.mat-tab-list{
.mat-tab-labels{
border-bottom:0;
padding-right:10px;
.mat-tab-label{
padding:0 10px;
}
}
}
}
}
.mat-tab-body-wrapper{
.mat-tab-body{
.mat-tab-body-conten{
position:relative;
width:100%;
height:100%;
.mat-list-base{
position:relative;
.mat-list-option{
height:40px;
}
}
}
}
}
}
}
::ng-deep .setting-category{
.mat-list-base{
position:relative;
.mat-list-item{
font-size:15px;
}
.mat-divider{
}
}
}

View File

@ -4,7 +4,7 @@
</div>
<div class="app-layout-native-title-bar-title">UCAP M Messenger</div>
<div class="app-layout-native-title-bar-spacer"></div>
<div class="app-layout-native-title-bar-link">
<div *ngIf="!!loginRes" class="app-layout-native-title-bar-link">
<button
mat-icon-button
class="button app-layout-native-title-bar-setting"

View File

@ -4,12 +4,16 @@ import {
NativeService,
WindowState
} from '@ucap-webmessenger/native';
import { Observable } from 'rxjs';
import { Store } from '@ngrx/store';
import { Observable, Subscription } from 'rxjs';
import { Store, select } from '@ngrx/store';
import * as AppStore from '@app/store';
import * as AuthenticationStore from '@app/store/account/authentication';
import * as SettingsStore from '@app/store/messenger/settings';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { tap } from 'rxjs/operators';
@Component({
selector: 'app-layout-native-top-bar',
templateUrl: './top-bar.component.html',
@ -19,6 +23,8 @@ export class TopBarComponent implements OnInit, OnDestroy {
windowStateChanged$: Observable<WindowState>;
WindowState = WindowState;
loginRes: LoginResponse;
loginResSubscription: Subscription;
constructor(
private store: Store<any>,
@ -27,6 +33,15 @@ export class TopBarComponent implements OnInit, OnDestroy {
ngOnInit() {
this.windowStateChanged$ = this.nativeService.windowStateChanged();
this.loginResSubscription = this.store
.pipe(
select(AppStore.AccountSelector.AuthenticationSelector.loginRes),
tap(loginRes => {
this.loginRes = loginRes;
})
)
.subscribe();
}
ngOnDestroy(): void {}
@ -48,6 +63,6 @@ export class TopBarComponent implements OnInit, OnDestroy {
}
onClickLogout(): void {
this.store.dispatch(AuthenticationStore.logout());
this.store.dispatch(AuthenticationStore.logoutConfirmation());
}
}

View File

@ -8,6 +8,8 @@ import {
} from '@ucap-webmessenger/web-storage';
import { LocaleCode } from '@ucap-webmessenger/core';
import { LoginInfo, KEY_LOGIN_INFO } from '../types';
import { KEY_VER_INFO } from '@app/types/ver-info.type';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
@Injectable({
providedIn: 'root'
@ -44,6 +46,8 @@ export class AppAuthenticationService {
}
logout() {
this.sessionStorageService.remove(KEY_LOGIN_RES_INFO);
this.sessionStorageService.remove(KEY_VER_INFO);
this.sessionStorageService.remove(KEY_LOGIN_INFO);
}
}

View File

@ -18,7 +18,7 @@ export class AppNativeService {
subscribe(): void {
this.nativeService.logout().subscribe(() => {
this.store.dispatch(AuthenticationStore.logout());
this.store.dispatch(AuthenticationStore.logoutConfirmation());
});
this.nativeService.changeStatus().subscribe(statusCode => {});
this.nativeService.showSetting().subscribe(() => {

View File

@ -53,7 +53,11 @@ import {
ServiceProtocolService,
UserPasswordSetResponse
} from '@ucap-webmessenger/protocol-service';
import { AuthenticationProtocolService } from '@ucap-webmessenger/protocol-authentication';
import {
AuthenticationProtocolService,
LoginResponse
} from '@ucap-webmessenger/protocol-authentication';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
@Injectable()
export class Effects {
@ -157,19 +161,26 @@ export class Effects {
this.actions$.pipe(
ofType(logoutConfirmation),
exhaustMap(async () => {
const result = await this.dialogService.open<
ConfirmDialogComponent,
ConfirmDialogData,
ConfirmDialogResult
>(ConfirmDialogComponent, {
width: '220px',
data: {
title: 'Logout',
message: 'Logout ?'
}
});
const loginRes = this.sessionStorageService.get<LoginResponse>(
KEY_LOGIN_RES_INFO
);
return result.choice;
if (!!loginRes && loginRes.userSeq) {
const result = await this.dialogService.open<
ConfirmDialogComponent,
ConfirmDialogData,
ConfirmDialogResult
>(ConfirmDialogComponent, {
data: {
title: 'Logout',
message: '로그아웃 하시겠습니까?'
}
});
return result.choice;
} else {
return false;
}
}),
map(result => (result ? logout() : logoutConfirmationDismiss()))
)

View File

@ -15,6 +15,9 @@ import {
MessengerSettingsDialogData,
MessengerSettingsDialogResult
} from '@app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
@Injectable()
export class Effects {
@ -23,18 +26,24 @@ export class Effects {
this.actions$.pipe(
ofType(showDialog),
tap(async () => {
const result = await this.dialogService.open<
MessengerSettingsDialogComponent,
MessengerSettingsDialogData,
MessengerSettingsDialogResult
>(MessengerSettingsDialogComponent, {
width: '800px',
maxWidth: '800px',
height: '800px',
minHeight: '800px',
disableClose: false,
data: {}
});
const loginRes = this.sessionStorageService.get<LoginResponse>(
KEY_LOGIN_RES_INFO
);
if (!!loginRes && loginRes.userSeq) {
const result = await this.dialogService.open<
MessengerSettingsDialogComponent,
MessengerSettingsDialogData,
MessengerSettingsDialogResult
>(MessengerSettingsDialogComponent, {
width: '800px',
maxWidth: '800px',
height: '800px',
minHeight: '800px',
disableClose: false,
data: {}
});
}
})
),
{ dispatch: false }
@ -44,6 +53,7 @@ export class Effects {
private actions$: Actions,
private store: Store<any>,
private dialogService: DialogService,
private logger: NGXLogger
private logger: NGXLogger,
private sessionStorageService: SessionStorageService
) {}
}