From 81f5faf0b88970f9dbb71ec65ff16daa6720679c Mon Sep 17 00:00:00 2001 From: Richard Park Date: Tue, 21 Jan 2020 14:41:28 +0900 Subject: [PATCH 1/3] config of electron builder is changed --- electron-builder.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/electron-builder.json b/electron-builder.json index c82450f2..920e350c 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -38,7 +38,7 @@ }, "publish": { "provider": "generic", - "url": "http://localhost:8099/client-updates/" + "url": "https://messenger.daesang.com/AppDist/pc" }, "mac": { "target": ["default"], @@ -74,7 +74,6 @@ "include": "./config/build/win/nsis/installer.nsh" }, "nsisWeb": { - "appPackageUrl": "https://messenger.daesang.com/AppDist/pc/", "oneClick": true, "allowToChangeInstallationDirectory": false, "perMachine": false, From 6952b84edb0523367f6da74cfe64b96d208e6717 Mon Sep 17 00:00:00 2001 From: Richard Park Date: Tue, 21 Jan 2020 15:08:15 +0900 Subject: [PATCH 2/3] left side drawer is added --- .../components/left-side.component.html | 8 +++-- .../components/left-side.component.scss | 7 +++- .../components/left-side.component.ts | 33 ++++++++++++++++++- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html index a308f7b7..e7308559 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html @@ -1,5 +1,5 @@ -
-
+
+
+ + diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.scss index aa0c0b02..760cb2e5 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.scss +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.scss @@ -25,7 +25,7 @@ .container { display: flex; - width: 250px; + width: 300px; height: 100%; } @@ -124,3 +124,8 @@ height: 100%; } } + +.left-drawer-toggle { + position: absolute; + top: 0px; +} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts index 4031c616..4c36499a 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts @@ -8,7 +8,8 @@ import { QueryList, ElementRef, OnDestroy, - ViewChild + ViewChild, + HostListener } from '@angular/core'; import { NGXLogger } from 'ngx-logger'; import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui'; @@ -75,6 +76,9 @@ export class LeftSideComponent implements OnInit, OnDestroy { @ViewChild('messageBoxComponent', { static: false }) messageBoxComponent: MessageBoxComponent; + @ViewChild('leftSideContainer', { static: false }) + leftSideContainer: ElementRef; + onLangChangeSubscription: Subscription; badgeChatUnReadCount: number; @@ -96,6 +100,8 @@ export class LeftSideComponent implements OnInit, OnDestroy { loginRes: LoginResponse; loginResSubscription: Subscription; + showLeftDrawerToggle = false; + constructor( private store: Store, private dialogService: DialogService, @@ -181,6 +187,31 @@ export class LeftSideComponent implements OnInit, OnDestroy { this.logger.debug('-----------------------LeftSideComponent ngOnDestroy'); } + @HostListener('mouseenter', ['$event']) + mouseOver(event: MouseEvent) { + const rect = this.leftSideContainer.nativeElement.getBoundingClientRect(); + + const minX = rect.left + rect.width - 5; + const maxX = rect.left + rect.width; + const minY = rect.top; + const maxY = rect.top + rect.height; + + if ( + event.pageX >= minX && + event.pageX <= maxX && + event.pageY >= minY && + event.pageY <= maxY + ) { + this.logger.debug('mouseOver edge of container'); + this.showLeftDrawerToggle = true; + } + } + + @HostListener('mouseleave', ['$event']) + mouseLeave(event: MouseEvent) { + this.showLeftDrawerToggle = false; + } + async onClickNewChat(type: string = 'NORMAL') { const result = await this.dialogService.open< CreateChatDialogComponent, From 0f51d458e059279c818437236e45107645579ce1 Mon Sep 17 00:00:00 2001 From: Richard Park Date: Tue, 21 Jan 2020 15:29:59 +0900 Subject: [PATCH 3/3] left side drawer is implemented --- .../components/left-side.component.html | 7 ++++++- .../components/left-side.component.ts | 4 ++++ .../components/main.page.component.html | 2 +- .../components/main.page.component.ts | 18 ++++++++++++++++++ .../src/app/store/messenger/chat/actions.ts | 4 ++++ .../src/app/store/messenger/chat/reducers.ts | 9 ++++++++- .../src/app/store/messenger/chat/state.ts | 8 +++++++- 7 files changed, 48 insertions(+), 4 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html index e7308559..0dfd4d00 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html @@ -65,6 +65,11 @@ >
- diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts index 4c36499a..87983add 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.ts @@ -212,6 +212,10 @@ export class LeftSideComponent implements OnInit, OnDestroy { this.showLeftDrawerToggle = false; } + onClickLeftDrawerToggle() { + this.store.dispatch(ChatStore.toggleLeftSideDrawer()); + } + async onClickNewChat(type: string = 'NORMAL') { const result = await this.dialogService.open< CreateChatDialogComponent, diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html index 9e46be73..8544e4eb 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html +++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.html @@ -4,7 +4,7 @@
- + { + if (leftSideDrawer) { + this.leftSideDrawer.open(); + } else { + this.leftSideDrawer.close(); + } + }); + this.idleStateChangedSubscription = this.nativeService .idleStateChanged() .subscribe(action => { @@ -218,6 +232,10 @@ export class MainPageComponent implements OnInit, OnDestroy { this.myIdleCheckTimeSubscription.unsubscribe(); } + if (!!this.leftSideDrawerSubscription) { + this.leftSideDrawerSubscription.unsubscribe(); + } + this.logger.debug('-----------------------MainPageComponent ngOnDestroy'); } diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/chat/actions.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/chat/actions.ts index cc3f7e8e..0954354a 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/chat/actions.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/chat/actions.ts @@ -53,3 +53,7 @@ export const clearRightDrawer = createAction( '[Messenger::Chat] Clear Right Drawer', props() ); + +export const toggleLeftSideDrawer = createAction( + '[Messenger::Chat] Toggle Left Side Drawer' +); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/chat/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/chat/reducers.ts index 4e2d4aab..b7c52629 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/chat/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/chat/reducers.ts @@ -8,7 +8,8 @@ import { massTalkDownloadSuccess, clearSelectedRoom, selectedRightDrawer, - clearRightDrawer + clearRightDrawer, + toggleLeftSideDrawer } from './actions'; import * as AuthenticationStore from '@app/store/account/authentication'; @@ -61,6 +62,12 @@ export const reducer = createReducer( selectedRightDrawer: action.req }; }), + on(toggleLeftSideDrawer, (state, action) => { + return { + ...state, + leftSideDrawer: !state.leftSideDrawer + }; + }), on(clearRightDrawer, (state, action) => { return { ...state, diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/chat/state.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/chat/state.ts index aefa6492..446d00ff 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/chat/state.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/chat/state.ts @@ -7,13 +7,15 @@ export interface State { massDetailProcessing: boolean; selectedRightDrawer: string | null; + leftSideDrawer: boolean; } export const initialState: State = { selectedRoom: null, selectedMassDetail: null, massDetailProcessing: false, - selectedRightDrawer: '' + selectedRightDrawer: '', + leftSideDrawer: true }; export function selectors(selector: Selector) { @@ -29,6 +31,10 @@ export function selectors(selector: Selector) { selectedRightDrawer: createSelector( selector, (state: State) => state.selectedRightDrawer + ), + selectLeftSideDrawer: createSelector( + selector, + (state: State) => state.leftSideDrawer ) }; }