diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts
index 892aba33..9827b11e 100644
--- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts
+++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.ts
@@ -10,7 +10,13 @@ import {
ChangeDetectorRef
} from '@angular/core';
import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui';
-import { Observable, Subscription, of, BehaviorSubject } from 'rxjs';
+import {
+ Observable,
+ Subscription,
+ of,
+ BehaviorSubject,
+ combineLatest
+} from 'rxjs';
import {
DeptInfo,
QueryProtocolService,
@@ -155,10 +161,10 @@ export class OrganizationComponent
isShowSearch = false;
searchUserInfos: UserInfoSS[] = [];
- gnbMenuChangedSubject: BehaviorSubject
= new BehaviorSubject<
+ organizationTreeActivatedSubject: BehaviorSubject<
boolean
- >(false);
- gnbMenuChangedSubscription: Subscription;
+ > = new BehaviorSubject(false);
+ organizationTreeActivatedSubscription: Subscription;
/** 부서원 리스트에 virture scroll의 size 가 체킹되지 않아 강제 수행. 1번만. */
isInitList = false;
@@ -263,11 +269,20 @@ export class OrganizationComponent
}
});
- this.gnbMenuChangedSubscription = this.store
- .pipe(select(AppStore.MessengerSelector.SettingsSelector.gnbMenuIndex))
- .subscribe(menu => {
- this.gnbMenuChangedSubject.next(menu === MainMenu.Organization);
- });
+ this.organizationTreeActivatedSubscription = combineLatest([
+ this.store.pipe(
+ select(AppStore.MessengerSelector.SettingsSelector.gnbMenuIndex)
+ ),
+ this.store.pipe(
+ select(
+ AppStore.MessengerSelector.SettingsSelector.organizationTreeActivated
+ )
+ )
+ ]).subscribe(([menu, activate]) => {
+ this.organizationTreeActivatedSubject.next(
+ menu === MainMenu.Organization || activate
+ );
+ });
}
ngAfterViewChecked(): void {
@@ -289,8 +304,8 @@ export class OrganizationComponent
if (!!this.myDepartmentUserInfoListSubscription) {
this.myDepartmentUserInfoListSubscription.unsubscribe();
}
- if (!!this.gnbMenuChangedSubscription) {
- this.gnbMenuChangedSubscription.unsubscribe();
+ if (!!this.organizationTreeActivatedSubscription) {
+ this.organizationTreeActivatedSubscription.unsubscribe();
}
}
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 a51cb7be..e2d6a751 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
@@ -25,6 +25,7 @@ import { map, tap, catchError, take } from 'rxjs/operators';
import { Store, select } from '@ngrx/store';
import * as AppStore from '@app/store';
import * as StatusStore from '@app/store/messenger/status';
+import * as SettingsStore from '@app/store/messenger/settings';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { Company } from '@ucap-webmessenger/api-external';
@@ -64,7 +65,6 @@ import {
} from '@ucap-webmessenger/ui';
import { TranslateService, TranslateParser } from '@ngx-translate/core';
import { environment } from '../../../../../environments/environment';
-import { StringUtil } from '@ucap-webmessenger/core';
export interface CreateChatDialogData {
type?: string;
@@ -397,11 +397,17 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
onSelectedTabChange(tabChangeEvent: MatTabChangeEvent): void {
this.currentTabIndex = tabChangeEvent.index;
- if (tabChangeEvent.index === 2) {
+ if (2 === tabChangeEvent.index) {
this.selectedUserList = [];
} else {
this.selectedRoom = null;
}
+
+ this.store.dispatch(
+ SettingsStore.organizationTreeActivated({
+ activate: 1 === tabChangeEvent.index
+ })
+ );
}
/** 유저검색 */
diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/settings/actions.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/settings/actions.ts
index 39bfea96..c14c6a76 100644
--- a/projects/ucap-webmessenger-app/src/app/store/messenger/settings/actions.ts
+++ b/projects/ucap-webmessenger-app/src/app/store/messenger/settings/actions.ts
@@ -7,3 +7,8 @@ export const selectedGnbMenuIndex = createAction(
'[Messenger::Settings] select Gnb MenuIndex',
props<{ menuIndex: MainMenu }>()
);
+
+export const organizationTreeActivated = createAction(
+ '[Messenger::Settings] Organization Tree Activated',
+ props<{ activate: boolean }>()
+);
diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/settings/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/settings/reducers.ts
index f522d410..ef3b2b30 100644
--- a/projects/ucap-webmessenger-app/src/app/store/messenger/settings/reducers.ts
+++ b/projects/ucap-webmessenger-app/src/app/store/messenger/settings/reducers.ts
@@ -1,6 +1,6 @@
import { createReducer, on } from '@ngrx/store';
import { initialState } from './state';
-import { selectedGnbMenuIndex } from './actions';
+import { selectedGnbMenuIndex, organizationTreeActivated } from './actions';
import * as AuthenticationStore from '@app/store/account/authentication';
@@ -12,6 +12,12 @@ export const reducer = createReducer(
gnbMenuIndex: action.menuIndex
};
}),
+ on(organizationTreeActivated, (state, action) => {
+ return {
+ ...state,
+ organizationTreeActivated: action.activate
+ };
+ }),
on(AuthenticationStore.logoutInitialize, (state, action) => {
return {
diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/settings/state.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/settings/state.ts
index 76c20e33..400f1e01 100644
--- a/projects/ucap-webmessenger-app/src/app/store/messenger/settings/state.ts
+++ b/projects/ucap-webmessenger-app/src/app/store/messenger/settings/state.ts
@@ -5,14 +5,23 @@ import { MainMenu } from '@app/types';
export interface State {
gnbMenuIndex: MainMenu;
+ organizationTreeActivated: boolean;
}
export const initialState: State = {
- gnbMenuIndex: MainMenu.Group
+ gnbMenuIndex: MainMenu.Group,
+ organizationTreeActivated: false
};
export function selectors(selector: Selector) {
return {
- gnbMenuIndex: createSelector(selector, (state: State) => state.gnbMenuIndex)
+ gnbMenuIndex: createSelector(
+ selector,
+ (state: State) => state.gnbMenuIndex
+ ),
+ organizationTreeActivated: createSelector(
+ selector,
+ (state: State) => state.organizationTreeActivated
+ )
};
}