diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/file-profile-save.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/file-profile-save.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/file-profile-save.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/file-profile-save.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/file-talk-download.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-download.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/file-talk-download.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-download.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/file-talk-save.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-save.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/file-talk-save.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-save.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/file-talk-share.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-share.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/file-talk-share.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-share.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/mass-talk-download.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/mass-talk-download.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/mass-talk-download.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/mass-talk-download.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/mass-talk-save.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/mass-talk-save.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/mass-talk-save.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/mass-talk-save.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/trans-mass-talk-download.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/trans-mass-talk-download.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/trans-mass-talk-download.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/trans-mass-talk-download.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/trans-mass-talk-save.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/trans-mass-talk-save.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/trans-mass-talk-save.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/trans-mass-talk-save.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/translation-req.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/translation-req.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/translation-req.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/translation-req.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/models/translation-save.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/translation-save.ts similarity index 100% rename from projects/ucap-webmessenger-api-common/src/lib/models/translation-save.ts rename to projects/ucap-webmessenger-api-common/src/lib/apis/translation-save.ts diff --git a/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts b/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts index 6c7771a6..7e401ac2 100644 --- a/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts +++ b/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts @@ -11,59 +11,59 @@ import { FileProfileSaveResponse, encodeFileProfileSave, decodeFileProfileSave -} from '../models/file-profile-save'; +} from '../apis/file-profile-save'; import { FileTalkDownloadRequest, encodeFileTalkDownload -} from '../models/file-talk-download'; +} from '../apis/file-talk-download'; import { FileTalkSaveRequest, FileTalkSaveResponse, encodeFileTalkSave, decodeFileTalkSave -} from '../models/file-talk-save'; +} from '../apis/file-talk-save'; import { FileTalkShareRequest, FileTalkShareResponse, encodeFileTalkShare, decodeFileTalkShare -} from '../models/file-talk-share'; +} from '../apis/file-talk-share'; import { MassTalkDownloadRequest, MassTalkDownloadResponse, encodeMassTalkDownload, decodeMassTalkDownload -} from '../models/mass-talk-download'; +} from '../apis/mass-talk-download'; import { MassTalkSaveRequest, MassTalkSaveResponse, encodeMassTalkSave, decodeMassTalkSave -} from '../models/mass-talk-save'; +} from '../apis/mass-talk-save'; import { TransMassTalkDownloadRequest, TransMassTalkDownloadResponse, encodeTransMassTalkDownload, decodeTransMassTalkDownload -} from '../models/trans-mass-talk-download'; +} from '../apis/trans-mass-talk-download'; import { TransMassTalkSaveRequest, TransMassTalkSaveResponse, encodeTransMassTalkSave, decodeTransMassTalkSave -} from '../models/trans-mass-talk-save'; +} from '../apis/trans-mass-talk-save'; import { TranslationReqRequest, TranslationReqResponse, encodeTranslationReq, decodeTranslationReq -} from '../models/translation-req'; +} from '../apis/translation-req'; import { TranslationSaveRequest, TranslationSaveResponse, encodeTranslationSave, decodeTranslationSave -} from '../models/translation-save'; +} from '../apis/translation-save'; @Injectable({ providedIn: 'root' diff --git a/projects/ucap-webmessenger-api-common/src/public-api.ts b/projects/ucap-webmessenger-api-common/src/public-api.ts index 9398e8a3..e94b036b 100644 --- a/projects/ucap-webmessenger-api-common/src/public-api.ts +++ b/projects/ucap-webmessenger-api-common/src/public-api.ts @@ -4,16 +4,16 @@ export * from './lib/types/module-config'; -export * from './lib/models/file-profile-save'; -export * from './lib/models/file-talk-download'; -export * from './lib/models/file-talk-save'; -export * from './lib/models/file-talk-share'; -export * from './lib/models/mass-talk-download'; -export * from './lib/models/mass-talk-save'; -export * from './lib/models/trans-mass-talk-download'; -export * from './lib/models/trans-mass-talk-save'; -export * from './lib/models/translation-req'; -export * from './lib/models/translation-save'; +export * from './lib/apis/file-profile-save'; +export * from './lib/apis/file-talk-download'; +export * from './lib/apis/file-talk-save'; +export * from './lib/apis/file-talk-share'; +export * from './lib/apis/mass-talk-download'; +export * from './lib/apis/mass-talk-save'; +export * from './lib/apis/trans-mass-talk-download'; +export * from './lib/apis/trans-mass-talk-save'; +export * from './lib/apis/translation-req'; +export * from './lib/apis/translation-save'; export * from './lib/services/common-api.service'; diff --git a/projects/ucap-webmessenger-api-external/src/lib/models/check-user-info-ex.ts b/projects/ucap-webmessenger-api-external/src/lib/apis/check-user-info-ex.ts similarity index 100% rename from projects/ucap-webmessenger-api-external/src/lib/models/check-user-info-ex.ts rename to projects/ucap-webmessenger-api-external/src/lib/apis/check-user-info-ex.ts diff --git a/projects/ucap-webmessenger-api-external/src/lib/models/company-list.ts b/projects/ucap-webmessenger-api-external/src/lib/apis/company-list.ts similarity index 87% rename from projects/ucap-webmessenger-api-external/src/lib/models/company-list.ts rename to projects/ucap-webmessenger-api-external/src/lib/apis/company-list.ts index 441ea96a..03f47356 100644 --- a/projects/ucap-webmessenger-api-external/src/lib/models/company-list.ts +++ b/projects/ucap-webmessenger-api-external/src/lib/apis/company-list.ts @@ -5,6 +5,7 @@ import { APIEncoder, APIDecoder } from '@ucap-webmessenger/api'; +import { Company } from '../models/company'; export interface CompanyListRequest extends APIRequest { userSeq?: string; @@ -14,15 +15,6 @@ export interface CompanyListRequest extends APIRequest { companyGroupCode: string; } -export interface Company { - companyCode?: string; - companyName?: string; - companyDomain?: string; - companyConfAuthYn?: string; - ucapUseYn?: string; - companyTimerChatAuthYn?: string; -} - export interface CompanyListResponse extends APIResponse { companyList?: Company[]; } diff --git a/projects/ucap-webmessenger-api-external/src/lib/models/token-update.ts b/projects/ucap-webmessenger-api-external/src/lib/apis/token-update.ts similarity index 100% rename from projects/ucap-webmessenger-api-external/src/lib/models/token-update.ts rename to projects/ucap-webmessenger-api-external/src/lib/apis/token-update.ts diff --git a/projects/ucap-webmessenger-api-external/src/lib/models/url-info.ts b/projects/ucap-webmessenger-api-external/src/lib/apis/url-info.ts similarity index 100% rename from projects/ucap-webmessenger-api-external/src/lib/models/url-info.ts rename to projects/ucap-webmessenger-api-external/src/lib/apis/url-info.ts diff --git a/projects/ucap-webmessenger-api-external/src/lib/models/company.ts b/projects/ucap-webmessenger-api-external/src/lib/models/company.ts new file mode 100644 index 00000000..81c3d228 --- /dev/null +++ b/projects/ucap-webmessenger-api-external/src/lib/models/company.ts @@ -0,0 +1,8 @@ +export interface Company { + companyCode?: string; + companyName?: string; + companyDomain?: string; + companyConfAuthYn?: string; + ucapUseYn?: string; + companyTimerChatAuthYn?: string; +} diff --git a/projects/ucap-webmessenger-api-external/src/lib/services/external-api.service.ts b/projects/ucap-webmessenger-api-external/src/lib/services/external-api.service.ts index f8e41abd..a4730adf 100644 --- a/projects/ucap-webmessenger-api-external/src/lib/services/external-api.service.ts +++ b/projects/ucap-webmessenger-api-external/src/lib/services/external-api.service.ts @@ -11,25 +11,25 @@ import { CheckUserInfoExResponse, encodeCheckUserInfoEx, decodeCheckUserInfoEx -} from '../models/check-user-info-ex'; +} from '../apis/check-user-info-ex'; import { CompanyListRequest, CompanyListResponse, encodeCompanyList, decodeCompanyList -} from '../models/company-list'; +} from '../apis/company-list'; import { TokenUpdateRequest, TokenUpdateResponse, encodeTokenUpdate, decodeTokenUpdate -} from '../models/token-update'; +} from '../apis/token-update'; import { UrlInfoResponse, UrlInfoRequest, encodeUrlInfo, decodeUrlInfo -} from '../models/url-info'; +} from '../apis/url-info'; @Injectable({ providedIn: 'root' diff --git a/projects/ucap-webmessenger-api-external/src/public-api.ts b/projects/ucap-webmessenger-api-external/src/public-api.ts index 3398ff7c..b9a5d5ab 100644 --- a/projects/ucap-webmessenger-api-external/src/public-api.ts +++ b/projects/ucap-webmessenger-api-external/src/public-api.ts @@ -4,10 +4,12 @@ export * from './lib/types/module-config'; -export * from './lib/models/check-user-info-ex'; -export * from './lib/models/company-list'; -export * from './lib/models/token-update'; -export * from './lib/models/url-info'; +export * from './lib/models/company'; + +export * from './lib/apis/check-user-info-ex'; +export * from './lib/apis/company-list'; +export * from './lib/apis/token-update'; +export * from './lib/apis/url-info'; export * from './lib/services/external-api.service'; diff --git a/projects/ucap-webmessenger-api-public/src/lib/models/update-info.ts b/projects/ucap-webmessenger-api-public/src/lib/apis/update-info.ts similarity index 100% rename from projects/ucap-webmessenger-api-public/src/lib/models/update-info.ts rename to projects/ucap-webmessenger-api-public/src/lib/apis/update-info.ts diff --git a/projects/ucap-webmessenger-api-public/src/lib/models/version-info2.ts b/projects/ucap-webmessenger-api-public/src/lib/apis/version-info2.ts similarity index 100% rename from projects/ucap-webmessenger-api-public/src/lib/models/version-info2.ts rename to projects/ucap-webmessenger-api-public/src/lib/apis/version-info2.ts diff --git a/projects/ucap-webmessenger-api-public/src/lib/services/public-api.service.ts b/projects/ucap-webmessenger-api-public/src/lib/services/public-api.service.ts index 37a55a45..d3dd1f98 100644 --- a/projects/ucap-webmessenger-api-public/src/lib/services/public-api.service.ts +++ b/projects/ucap-webmessenger-api-public/src/lib/services/public-api.service.ts @@ -10,13 +10,13 @@ import { VersionInfo2Response, encodeVersionInfo2, decodeVersionInfo2 -} from '../models/version-info2'; +} from '../apis/version-info2'; import { UpdateInfoRequest, UpdateInfoResponse, encodeUpdateInfo, decodeUpdateInfo -} from '../models/update-info'; +} from '../apis/update-info'; import { ModuleConfig } from '../types/module-config'; @Injectable({ diff --git a/projects/ucap-webmessenger-api-public/src/public-api.ts b/projects/ucap-webmessenger-api-public/src/public-api.ts index 5ea84af3..eb7db5ee 100644 --- a/projects/ucap-webmessenger-api-public/src/public-api.ts +++ b/projects/ucap-webmessenger-api-public/src/public-api.ts @@ -2,8 +2,8 @@ * Public API Surface of ucap-webmessenger-api-public */ -export * from './lib/models/update-info'; -export * from './lib/models/version-info2'; +export * from './lib/apis/update-info'; +export * from './lib/apis/version-info2'; export * from './lib/services/public-api.service'; diff --git a/projects/ucap-webmessenger-api/src/lib/models/api.ts b/projects/ucap-webmessenger-api/src/lib/apis/api.ts similarity index 100% rename from projects/ucap-webmessenger-api/src/lib/models/api.ts rename to projects/ucap-webmessenger-api/src/lib/apis/api.ts diff --git a/projects/ucap-webmessenger-api/src/public-api.ts b/projects/ucap-webmessenger-api/src/public-api.ts index 7c3bbaf2..145c80d0 100644 --- a/projects/ucap-webmessenger-api/src/public-api.ts +++ b/projects/ucap-webmessenger-api/src/public-api.ts @@ -2,7 +2,7 @@ * Public API Surface of ucap-webmessenger-api */ -export * from './lib/models/api'; +export * from './lib/apis/api'; export * from './lib/types/status-code.type'; diff --git a/projects/ucap-webmessenger-app/src/app/app.module.ts b/projects/ucap-webmessenger-app/src/app/app.module.ts index 01018b73..ff01e3d5 100644 --- a/projects/ucap-webmessenger-app/src/app/app.module.ts +++ b/projects/ucap-webmessenger-app/src/app/app.module.ts @@ -15,6 +15,7 @@ import { UCapProtocolModule } from '@ucap-webmessenger/protocol'; import { UCapAuthenticationProtocolModule } from '@ucap-webmessenger/protocol-authentication'; import { UCapInnerProtocolModule } from '@ucap-webmessenger/protocol-inner'; import { UCapOptionProtocolModule } from '@ucap-webmessenger/protocol-option'; +import { UCapServiceProtocolModule } from '@ucap-webmessenger/protocol-service'; import { UCapSyncProtocolModule } from '@ucap-webmessenger/protocol-sync'; import { UCapUiModule } from '@ucap-webmessenger/ui'; @@ -36,6 +37,7 @@ import { AppTranslateModule } from './app-translate.module'; import { AppComponent } from './app.component'; import { GUARDS } from './guards'; +import { AppMessengerLayoutModule } from './layouts/messenger/messenger.layout.module'; @NgModule({ imports: [ @@ -67,6 +69,7 @@ import { GUARDS } from './guards'; UCapAuthenticationProtocolModule.forRoot(), UCapInnerProtocolModule.forRoot(), UCapOptionProtocolModule.forRoot(), + UCapServiceProtocolModule.forRoot(), UCapSyncProtocolModule.forRoot(), UCapUiModule.forRoot(), @@ -81,6 +84,8 @@ import { GUARDS } from './guards'; AppStoreModule, AppTranslateModule, + AppMessengerLayoutModule, + LoggerModule.forRoot({ level: NgxLoggerLevel.DEBUG }) 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 b18d9127..11d2743e 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 @@ -2,3 +2,16 @@ ::ng-deep .mat-tab-label-active { min-width: 0 !important; } + +::ng-deep .mat-tab-body-wrapper, +::ng-deep .mat-tab-body { + height: 100%; +} + +.container { + height: 100%; + + mat-tab-group { + height: 100%; + } +} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.html index eb05330a..441dbbf3 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.html @@ -1 +1,3 @@ -Chat +
+ {{ room.finalEventMessage }} +
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts index 3ed1c460..d67bd70f 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts @@ -1,5 +1,11 @@ import { Component, OnInit } from '@angular/core'; import { ucapAnimations } from '@ucap-webmessenger/ui'; +import { NGXLogger } from 'ngx-logger'; +import { Store, select } from '@ngrx/store'; +import { Observable } from 'rxjs'; +import { RoomInfo } from '@ucap-webmessenger/protocol-room'; +import * as AppStore from '@app/store'; +import * as ChatStore from '@app/store/messenger/chat'; @Component({ selector: 'app-layout-chat-left-sidenav-chat', @@ -8,7 +14,17 @@ import { ucapAnimations } from '@ucap-webmessenger/ui'; animations: ucapAnimations }) export class ChatComponent implements OnInit { - constructor() {} + roomList$: Observable; - ngOnInit() {} + constructor(private store: Store, private logger: NGXLogger) {} + + ngOnInit() { + this.roomList$ = this.store.pipe( + select(AppStore.MessengerSelector.SyncSelector.roomList) + ); + } + + onSelectedRoom(roomInfo: RoomInfo) { + this.store.dispatch(ChatStore.selectedRoom({ roomSeq: roomInfo.roomSeq })); + } } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html index ef28f944..70372913 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html @@ -1,4 +1,46 @@ - +
+
+ + + + + + + + + +
+
+ + +
+
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts index e08d39d2..7df6d991 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts @@ -1,16 +1,28 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; -import { Observable, combineLatest } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { Observable, combineLatest, Subscription } from 'rxjs'; +import { map, tap } from 'rxjs/operators'; import { Store, select } from '@ngrx/store'; -import { ucapAnimations } from '@ucap-webmessenger/ui'; +import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui'; import { UserInfo, GroupDetailData } from '@ucap-webmessenger/protocol-sync'; import * as AppStore from '@app/store'; import * as ChatStore from '@app/store/messenger/chat'; +import * as QueryStore from '@app/store/messenger/query'; import { NGXLogger } from 'ngx-logger'; +import { Company } from '@ucap-webmessenger/api-external'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { LoginInfo, KEY_LOGIN_INFO } from '@app/types'; +import { ExpansionPanelComponent as GroupExpansionPanelComponent } from '@ucap-webmessenger/ui-group'; +import { + CreateGroupDialogComponent, + CreateGroupDialogData, + CreateGroupDialogResult +} from '@app/layouts/messenger/dialogs/create-group.dialog.component'; +import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; +import { DeptSearchType } from '@ucap-webmessenger/protocol-query'; @Component({ selector: 'app-layout-chat-left-sidenav-group', @@ -19,13 +31,42 @@ import { NGXLogger } from 'ngx-logger'; animations: ucapAnimations }) export class GroupComponent implements OnInit { + @ViewChild('groupExpansionPanel', { static: true }) + groupExpansionPanel: GroupExpansionPanelComponent; + groupBuddyList$: Observable< { group: GroupDetailData; buddyList: UserInfo[] }[] >; + companyList$: Observable; + companyCode: string; - constructor(private store: Store, private logger: NGXLogger) {} + loginRes: LoginResponse; + loginResSubscription: Subscription; + + constructor( + private store: Store, + private sessionStorageService: SessionStorageService, + private dialogService: DialogService, + private logger: NGXLogger + ) {} ngOnInit() { + const loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); + this.companyCode = loginInfo.companyCode; + + this.loginResSubscription = this.store + .pipe( + select(AppStore.AccountSelector.AuthenticationSelector.loginRes), + tap(loginRes => { + this.loginRes = loginRes; + }) + ) + .subscribe(); + + this.companyList$ = this.store.pipe( + select(AppStore.SettingSelector.CompanySelector.companyList) + ); + this.groupBuddyList$ = this.store .pipe( select(AppStore.MessengerSelector.SyncSelector.groupListAndBuddyList) @@ -71,7 +112,61 @@ export class GroupComponent implements OnInit { ); } + async onClickGroupMenu(menuType: string) { + this.logger.debug('menuType', menuType); + switch (menuType) { + case 'GROUP_NEW': + { + const result = await this.dialogService.open< + CreateGroupDialogComponent, + CreateGroupDialogData, + CreateGroupDialogResult + >(CreateGroupDialogComponent, { + width: '220px', + data: { + title: 'Logout', + message: 'Logout ?' + } + }); + } + break; + case 'GROUP_EXPAND_MORE': + { + this.groupExpansionPanel.expandMore(); + } + break; + case 'GROUP_EXPAND_LESS': + { + this.groupExpansionPanel.expandLess(); + } + break; + case 'GROUP_SAVE': + break; + case 'GROUP_RESTORE': + break; + + default: + break; + } + } + onSelectBuddy(buddy: UserInfo) { - this.store.dispatch(ChatStore.selectedRoom({ roomSeq: buddy.seq })); + this.store.dispatch(ChatStore.selectedRoom({ roomSeq: String(buddy.seq) })); + } + + onKeyDownEnterOrganizationTenantSearch(params: { + companyCode: string; + searchWord: string; + }) { + this.store.dispatch( + QueryStore.deptUser({ + divCd: 'GRP', + companyCode: params.companyCode, + searchRange: DeptSearchType.All, + search: params.searchWord, + senderCompanyCode: params.companyCode, + senderEmployeeType: this.loginRes.userInfo.employeeType + }) + ); } } 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 ca34a27d..0d4974f8 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 @@ -1 +1,13 @@ - +
+
+ +
+
+
+ {{ userInfo.name }} +
+
+
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.scss index e69de29b..4928b943 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.scss +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/organization.component.scss @@ -0,0 +1,7 @@ +.oraganization-tab { + height: 100%; + + .oraganization-tab-tree { + overflow: scroll; + } +} 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 e22cd0d4..6d4da9ec 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 @@ -1,5 +1,21 @@ import { Component, OnInit } from '@angular/core'; import { ucapAnimations } from '@ucap-webmessenger/ui'; +import { Observable } from 'rxjs'; +import { + DeptInfo, + QueryProtocolService, + DeptSearchType, + UserInfoSS, + DeptUserResponse +} from '@ucap-webmessenger/protocol-query'; +import { Store, select } from '@ngrx/store'; +import { NGXLogger } from 'ngx-logger'; + +import * as AppStore from '@app/store'; +import * as QueryStore from '@app/store/messenger/query'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { LoginInfo, KEY_LOGIN_INFO } from '@app/types'; +import { take, map, switchMap } from 'rxjs/operators'; @Component({ selector: 'app-layout-chat-left-sidenav-organization', @@ -8,7 +24,52 @@ import { ucapAnimations } from '@ucap-webmessenger/ui'; animations: ucapAnimations }) export class OrganizationComponent implements OnInit { - constructor() {} + departmentInfoList$: Observable; + selectedDepartmentUserInfoList$: Observable; + selectedDepartmentStatus$: Observable; - ngOnInit() {} + constructor( + private store: Store, + private queryProtocolService: QueryProtocolService, + private sessionStorageService: SessionStorageService, + private logger: NGXLogger + ) {} + + ngOnInit() { + this.departmentInfoList$ = this.store.pipe( + select(AppStore.MessengerSelector.QuerySelector.departmentInfoList) + ); + this.selectedDepartmentUserInfoList$ = this.store.pipe( + select( + AppStore.MessengerSelector.QuerySelector.selectedDepartmentUserInfoList + ) + ); + this.selectedDepartmentStatus$ = this.store.pipe( + select(AppStore.MessengerSelector.QuerySelector.selectedDepartmentStatus) + ); + } + + onSelectedOrganization(deptInfo: DeptInfo) { + const loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); + + this.store + .pipe( + take(1), + select(AppStore.AccountSelector.AuthenticationSelector.loginRes), + map(loginRes => { + this.store.dispatch( + QueryStore.deptUser({ + divCd: 'ORG', + companyCode: loginInfo.companyCode, + seq: deptInfo.seq, + search: '', + searchRange: DeptSearchType.All, + senderCompanyCode: loginInfo.companyCode, + senderEmployeeType: loginRes.userInfo.employeeType + }) + ); + }) + ) + .subscribe(); + } } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html index 18ebf834..05be38b7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html @@ -34,11 +34,17 @@ - +
- +
@@ -46,7 +52,7 @@
- +
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index a387b36c..93170636 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -1,5 +1,17 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; import { ucapAnimations } from '@ucap-webmessenger/ui'; +import { Store, select } from '@ngrx/store'; +import { NGXLogger } from 'ngx-logger'; +import { Observable, Subscription } from 'rxjs'; +import { Info, EventType } from '@ucap-webmessenger/protocol-event'; + +import * as AppStore from '@app/store'; +import * as EventStore from '@app/store/messenger/event'; +import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { LoginInfo, KEY_LOGIN_INFO } from '@app/types'; +import { RoomInfo } from '@ucap-webmessenger/protocol-room'; +import { tap } from 'rxjs/operators'; @Component({ selector: 'app-layout-messenger-messages', @@ -7,10 +19,71 @@ import { ucapAnimations } from '@ucap-webmessenger/ui'; styleUrls: ['./messages.component.scss'], animations: ucapAnimations }) -export class MessagesComponent implements OnInit { - constructor() {} +export class MessagesComponent implements OnInit, OnDestroy { + loginRes: LoginResponse; + loginResSubscription: Subscription; + eventList$: Observable; + roomInfo: RoomInfo; + roomInfoSubscription: Subscription; + eventListProcessing$: Observable; - ngOnInit() {} + constructor( + private store: Store, + private sessionStorageService: SessionStorageService, + private logger: NGXLogger + ) {} + + ngOnInit() { + const loginInfo = this.sessionStorageService.get(KEY_LOGIN_INFO); + + this.loginResSubscription = this.store + .pipe( + select(AppStore.AccountSelector.AuthenticationSelector.loginRes), + tap(loginRes => { + this.loginRes = loginRes; + }) + ) + .subscribe(); + + this.roomInfoSubscription = this.store + .pipe( + select(AppStore.MessengerSelector.RoomSelector.roomInfo), + tap(roomInfo => { + this.roomInfo = roomInfo; + }) + ) + .subscribe(); + + this.eventListProcessing$ = this.store.pipe( + select(AppStore.MessengerSelector.EventSelector.infoListProcessing) + ); + + this.eventList$ = this.store.pipe( + select(AppStore.MessengerSelector.EventSelector.infoList) + ); + } + + ngOnDestroy(): void { + if (!!this.loginResSubscription) { + this.loginResSubscription.unsubscribe(); + } + if (!!this.roomInfoSubscription) { + this.roomInfoSubscription.unsubscribe(); + } + } selectContact() {} + + onSendMessage(message: string) { + this.store.dispatch( + EventStore.send({ + senderSeq: this.loginRes.userSeq, + req: { + roomSeq: this.roomInfo.roomSeq, + eventType: EventType.Character, + sentMessage: message + } + }) + ); + } } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.html new file mode 100644 index 00000000..09d25dfe --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.html @@ -0,0 +1,18 @@ + + + 새 그룹 추가 + + + + + + + diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/intro.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.scss similarity index 100% rename from projects/ucap-webmessenger-ui-chat/src/lib/components/intro.component.html rename to projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.scss diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.spec.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.spec.ts new file mode 100644 index 00000000..421bfc22 --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CreateGroupDialogComponent } from './create-group.dialog.component'; + +describe('app::layouts::messenger::CreateGroupDialogComponent', () => { + let component: CreateGroupDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [CreateGroupDialogComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CreateGroupDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.ts new file mode 100644 index 00000000..6ae5d6b1 --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +export interface CreateGroupDialogData { + title: string; + message?: string; +} + +export interface CreateGroupDialogResult { + choice: boolean; +} + +@Component({ + selector: 'app-layout-messenger-create-group', + templateUrl: './create-group.dialog.component.html', + styleUrls: ['./create-group.dialog.component.scss'] +}) +export class CreateGroupDialogComponent implements OnInit { + constructor( + public dialogRef: MatDialogRef< + CreateGroupDialogData, + CreateGroupDialogResult + >, + @Inject(MAT_DIALOG_DATA) public data: CreateGroupDialogData + ) {} + + ngOnInit(): void {} + + onClickChoice(choice: boolean): void { + this.dialogRef.close({ + choice + }); + } +} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/index.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/index.ts new file mode 100644 index 00000000..dc006a67 --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/index.ts @@ -0,0 +1,3 @@ +import { CreateGroupDialogComponent } from './create-group.dialog.component'; + +export const DIALOGS = [CreateGroupDialogComponent]; diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts index 52badfcc..7d77dee7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts @@ -3,31 +3,45 @@ import { CommonModule } from '@angular/common'; import { FlexLayoutModule } from '@angular/flex-layout'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatDialogModule } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatMenuModule } from '@angular/material/menu'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatTabsModule } from '@angular/material/tabs'; import { MatToolbarModule } from '@angular/material/toolbar'; +import { DragDropModule } from '@angular/cdk/drag-drop'; + +import { UCapUiModule } from '@ucap-webmessenger/ui'; import { UCapUiChatModule } from '@ucap-webmessenger/ui-chat'; import { UCapUiGroupModule } from '@ucap-webmessenger/ui-group'; import { UCapUiOrganizationModule } from '@ucap-webmessenger/ui-organization'; import { COMPONENTS } from './components'; +import { DIALOGS } from './dialogs'; @NgModule({ imports: [ CommonModule, FlexLayoutModule, + DragDropModule, + MatButtonModule, + MatCardModule, + MatDialogModule, MatIconModule, MatMenuModule, + MatProgressBarModule, MatTabsModule, MatToolbarModule, + UCapUiModule, UCapUiChatModule, UCapUiGroupModule, UCapUiOrganizationModule ], - exports: [...COMPONENTS], - declarations: [...COMPONENTS], - entryComponents: [] + exports: [...COMPONENTS, ...DIALOGS], + declarations: [...COMPONENTS, ...DIALOGS], + entryComponents: [...DIALOGS] }) export class AppMessengerLayoutModule {} diff --git a/projects/ucap-webmessenger-app/src/app/pages/account/account.page.module.ts b/projects/ucap-webmessenger-app/src/app/pages/account/account.page.module.ts index c787da7b..61c11843 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/account/account.page.module.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/account/account.page.module.ts @@ -3,6 +3,8 @@ import { CommonModule } from '@angular/common'; import { FlexLayoutModule } from '@angular/flex-layout'; +import { MatButtonModule } from '@angular/material/button'; + import { UCapUiAccountModule } from '@ucap-webmessenger/ui-account'; import { AppAccountRoutingPageModule } from './account-routing.page.module'; @@ -13,6 +15,7 @@ import { COMPONENTS } from './components'; imports: [ CommonModule, FlexLayoutModule, + MatButtonModule, UCapUiAccountModule, AppAccountRoutingPageModule ], diff --git a/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.html b/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.html index a3983ede..46111ea7 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.html +++ b/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.html @@ -1,6 +1,19 @@ diff --git a/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.ts index bf1775ba..832e8340 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/account/components/login.page.component.ts @@ -52,7 +52,7 @@ export class LoginPageComponent implements OnInit { ); } - onTemplate() { + onClickTemplate() { this.router.navigate(['/template']); } } 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 58615978..e1c2a904 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 @@ -2,14 +2,21 @@
-
- - -
+ +
+ + +
+ +

sidenav

+
+
+
diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.scss b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.scss index f07afd30..55e75745 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.scss +++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.scss @@ -10,6 +10,11 @@ float: left; width: calc(100% - 360px); height: 100%; + + .messages { + width: 100%; + height: 100%; + } } .right-side { float: left; diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts index 5582952b..ee73a40a 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts @@ -11,7 +11,7 @@ import { Observable } from 'rxjs'; styleUrls: ['./main.page.component.scss'] }) export class MainPageComponent implements OnInit { - selectedChat$: Observable; + selectedChat$: Observable; constructor(private store: Store) {} diff --git a/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.html b/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.html index 37fac5cd..2503b6e1 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.html +++ b/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.html @@ -1,11 +1,22 @@ -
+
+ +

User-list-item

+ > +
+

Organization

+
+
+
+ Tenant Search +
+
+ +
+
+
+

Chat::MessageBox

+
+
+
+ date splitter +
+
+ +
+
+
+
+ file +
+
+ +
+
+
+
+ image +
+
+ +
+
+
+
+ information +
+
+ +
+
+
+
+ mass-translation +
+
+ +
+
+
+
+ mass +
+
+ +
+
+
+
+ notice +
+
+ +
+
+
+
+ recall +
+
+ +
+
+
+
schedule
+
+ +
+
+
+
+ sticker +
+
+ +
+
+
+
+ text +
+
+ +
+
+
+
+ translation +
+
+ +
+
+
+
+ video +
+
+ +
+
+
+
+ video-conference +
+
+ +
+
+
diff --git a/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.ts index 190c8c00..b1738f70 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/template/components/template.page.component.ts @@ -8,6 +8,8 @@ import { TerminalStatusNumber } from '@ucap-webmessenger/protocol-status'; import { StatusCode } from '@ucap-webmessenger/core'; +import { Router } from '@angular/router'; +import { Company } from '@ucap-webmessenger/api-external'; @Component({ selector: 'app-template.page', @@ -21,9 +23,17 @@ export class TemplatePageComponent implements OnInit { presence: StatusBulkInfo = status; - constructor() {} + companyList: Company[] = companyList; + + companyCode: string = 'GUC006'; + + constructor(private router: Router) {} ngOnInit() {} + + onClickLogin() { + this.router.navigate(['/account/login']); + } } export const status: StatusBulkInfo = { @@ -79,3 +89,182 @@ export const buddyData: UserInfo = { employeeType: EmployeeType.Regular, nickName: '채책임(닉)' }; + +const companyList: Company[] = [ + { + companyCode: 'GUC002', + companyName: 'LG Electronics.', + companyDomain: 'lge.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC040', + companyName: 'LGE한국영업협력사', + companyDomain: 'lgepartner.com', + companyConfAuthYn: 'Y', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC021', + companyName: 'LG이노텍', + companyDomain: 'lginnotek.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC036', + companyName: '하이프라자', + companyDomain: 'hiplaza.co.kr', + companyConfAuthYn: 'Y', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC006', + companyName: 'LG CNS', + companyDomain: 'lgcns.com', + companyConfAuthYn: 'Y', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC041', + companyName: 'LGEIL', + companyDomain: 'lgeil.com', + companyConfAuthYn: 'Y', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC100', + companyName: 'LG UCAP', + companyDomain: 'lgucap.com', + companyConfAuthYn: 'Y', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUCIM', + companyName: '아메사용회사', + companyDomain: 'test.com', + companyConfAuthYn: 'N', + ucapUseYn: 'N', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC005', + companyName: 'LG화학', + companyDomain: 'lgchem.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GSGAL', + companyName: 'GS칼텍스', + companyDomain: 'gscaltex.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC001', + companyName: 'LG U+', + companyDomain: 'lguplus.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC007', + companyName: 'LG Display', + companyDomain: 'lgdisplay.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'N' + }, + { + companyCode: 'GUC011', + companyName: 'LG인화원', + companyDomain: 'lgacademy.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC013', + companyName: 'LG MMA', + companyDomain: 'lgmma.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC015', + companyName: '(주)LG', + companyDomain: 'lg.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC016', + companyName: 'LGERI', + companyDomain: 'lgeri.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC024', + companyName: 'LG Hausys', + companyDomain: 'lghausys.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC028', + companyName: 'LG상사', + companyDomain: 'lgi.co.kr', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC032', + companyName: '코리아일레콤', + companyDomain: 'koreaelecom.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC035', + companyName: 'HLDS', + companyDomain: 'hlds.co.kr', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC038', + companyName: 'BizTech Partners', + companyDomain: 'GUC018', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + }, + { + companyCode: 'GUC042', + companyName: 'Japan R&D Lab', + companyDomain: 'lgjlab.com', + companyConfAuthYn: 'N', + ucapUseYn: 'Y', + companyTimerChatAuthYn: 'Y' + } +]; diff --git a/projects/ucap-webmessenger-app/src/app/pages/template/template.page.module.ts b/projects/ucap-webmessenger-app/src/app/pages/template/template.page.module.ts index 65291d9e..3c543f3e 100644 --- a/projects/ucap-webmessenger-app/src/app/pages/template/template.page.module.ts +++ b/projects/ucap-webmessenger-app/src/app/pages/template/template.page.module.ts @@ -3,20 +3,27 @@ import { CommonModule } from '@angular/common'; import { FlexLayoutModule } from '@angular/flex-layout'; +import { MatButtonModule } from '@angular/material/button'; + +import { UCapUiChatModule } from '@ucap-webmessenger/ui-chat'; import { UCapUiGroupModule } from '@ucap-webmessenger/ui-group'; +import { UCapUiOrganizationModule } from '@ucap-webmessenger/ui-organization'; +import { UCapUiProfileModule } from '@ucap-webmessenger/ui-profile'; import { AppTemplateRoutingPageModule } from './template-routing.page.module'; import { COMPONENTS, MET_MODULES } from './components'; -import { UcapUiProfileModule } from '@ucap-webmessenger/ui-profile'; @NgModule({ imports: [ ...MET_MODULES, CommonModule, FlexLayoutModule, + MatButtonModule, + UCapUiChatModule, UCapUiGroupModule, - UcapUiProfileModule, + UCapUiOrganizationModule, + UCapUiProfileModule, AppTemplateRoutingPageModule ], declarations: [...COMPONENTS], diff --git a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts index 7652158b..d20fadb4 100644 --- a/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts +++ b/projects/ucap-webmessenger-app/src/app/resolvers/messenger.resolver.ts @@ -4,15 +4,12 @@ import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; -import { Observable, throwError, of, EMPTY, forkJoin } from 'rxjs'; +import { Observable, throwError, forkJoin } from 'rxjs'; import { map, tap, - mergeMap, catchError, take, - exhaustMap, - concatMap, switchMap, withLatestFrom } from 'rxjs/operators'; @@ -21,17 +18,14 @@ import { Store, select } from '@ngrx/store'; import { ProtocolService } from '@ucap-webmessenger/protocol'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; -import { - PublicApiService, - VersionInfo2Response -} from '@ucap-webmessenger/api-public'; +import { PublicApiService } from '@ucap-webmessenger/api-public'; import { LoginInfo, KEY_LOGIN_INFO, EnvironmentsInfo, KEY_ENVIRONMENTS_INFO -} from '../types'; +} from '@app/types'; import { InnerProtocolService } from '@ucap-webmessenger/protocol-inner'; import { AuthenticationProtocolService, @@ -40,16 +34,15 @@ import { } from '@ucap-webmessenger/protocol-authentication'; import * as AuthenticationStore from '@app/store/account/authentication'; -import { ConnResponse } from 'projects/ucap-webmessenger-protocol-inner/src/lib/models/conn'; -import { PiService } from '@ucap-webmessenger/pi'; import { NGXLogger } from 'ngx-logger'; import { QueryProtocolService } from '@ucap-webmessenger/protocol-query'; import { OptionProtocolService } from '@ucap-webmessenger/protocol-option'; import * as AppStore from '@app/store'; +import * as CompanyStore from '@app/store/setting/company'; import * as VersionInfoStore from '@app/store/setting/version-info'; -import * as OptionStore from '@app/store/setting/option'; -import * as QueryStore from '@app/store/setting/query'; +import * as OptionStore from '@app/store/messenger/option'; +import * as QueryStore from '@app/store/messenger/query'; import * as SyncStore from '@app/store/messenger/sync'; @Injectable() @@ -58,7 +51,6 @@ export class AppMessengerResolver implements Resolve { private store: Store, private sessionStorageService: SessionStorageService, private publicApiService: PublicApiService, - private piService: PiService, private protocolService: ProtocolService, private queryProtocolService: QueryProtocolService, private optionProtocolService: OptionProtocolService, @@ -72,8 +64,6 @@ export class AppMessengerResolver implements Resolve { routerStateSnapshot: RouterStateSnapshot ): void | Observable | Promise { return new Promise((resolve, reject) => { - let versionInfo2Res: VersionInfo2Response; - let connRres: ConnResponse; let loginRes: LoginResponse; const loginInfo = this.sessionStorageService.get( @@ -92,13 +82,14 @@ export class AppMessengerResolver implements Resolve { }) .pipe( take(1), + tap(res => { + this.store.dispatch(VersionInfoStore.versionInfo2Success({ res })); + }), switchMap(res => { - versionInfo2Res = res; - return this.protocolService.connect(versionInfo2Res.serverIp); + return this.protocolService.connect(res.serverIp); }), switchMap(() => this.innerProtocolService.conn({})), switchMap(res => { - connRres = res; return this.authenticationProtocolService.login({ loginId: loginInfo.loginId, loginPw: loginInfo.loginPw, @@ -119,19 +110,28 @@ export class AppMessengerResolver implements Resolve { productName: 'EZMessenger' }); }), - switchMap(res => - forkJoin([ + switchMap(res => { + loginRes = res; + return forkJoin([ this.queryProtocolService.auth({ deviceType: environmentsInfo.deviceType }), this.optionProtocolService.regView({}) - ]) - ), - tap(([authRes, regViewRes]) => { + ]); + }), + map(([authRes, regViewRes]) => { this.store.dispatch( OptionStore.regViewSuccess({ res: regViewRes }) ); this.store.dispatch(QueryStore.authSuccess({ res: authRes })); + + this.store.dispatch( + CompanyStore.companyList({ + companyGroupCode: 'LG' + }) + ); + + // this.store.dispatch(AuthenticationStore.postLogin({ loginRes })); }), withLatestFrom( this.store.pipe( @@ -139,11 +139,26 @@ export class AppMessengerResolver implements Resolve { ), this.store.pipe( select(AppStore.MessengerSelector.SyncSelector.group2SyncDate) + ), + this.store.pipe( + select(AppStore.MessengerSelector.SyncSelector.roomSyncDate) ) ), - map(([[], buddy2SyncDate, group2SyncDate]) => { + map(([_, buddy2SyncDate, group2SyncDate, roomSyncDate]) => { this.store.dispatch(SyncStore.buddy2({ syncDate: buddy2SyncDate })); this.store.dispatch(SyncStore.group2({ syncDate: group2SyncDate })); + this.store.dispatch( + SyncStore.room({ + syncDate: roomSyncDate, + localeCode: loginInfo.localeCode + }) + ); + this.store.dispatch( + QueryStore.dept({ + divCd: 'ORG', + companyCode: loginInfo.companyCode + }) + ); }), catchError(err => { return throwError(err); @@ -153,18 +168,13 @@ export class AppMessengerResolver implements Resolve { () => { this.store.dispatch( AuthenticationStore.loginSuccess({ - loginInfo: loginRes + loginRes }) ); - console.log('next'); resolve(); }, err => { - console.log('err', err); reject(err); - }, - () => { - console.log('complete'); } ); }); 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 ff31045b..474bbdb3 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -1,16 +1,15 @@ import { Injectable } from '@angular/core'; -import { filter, tap } from 'rxjs/operators'; +import { tap } from 'rxjs/operators'; import { Store } from '@ngrx/store'; -import { ProtocolService } from '@ucap-webmessenger/protocol'; import { - SVC_TYPE_LOGOUT, SSVC_TYPE_LOGOUT_RES, SSVC_TYPE_LOGOUT_REMOTE_NOTI, - decodeLogout, - decodeLogoutRemoteNotification + AuthenticationProtocolService, + LogoutResponse, + LogoutRemoteNotification } from '@ucap-webmessenger/protocol-authentication'; import * as AuthenticationStore from '../store/account/authentication'; @@ -19,36 +18,29 @@ import { NGXLogger } from 'ngx-logger'; @Injectable() export class AppNotificationService { constructor( - private protocolService: ProtocolService, + private authenticationProtocolService: AuthenticationProtocolService, private store: Store, private logger: NGXLogger ) {} public subscribe(): void { - this.protocolService.serverMessage + this.authenticationProtocolService.logoutNotification$ .pipe( - filter( - message => - message.serviceType === SVC_TYPE_LOGOUT && - message.subServiceType === SSVC_TYPE_LOGOUT_RES - ), - tap(message => { - const logoutRes = decodeLogout(message); - this.logger.debug('logoutRes', logoutRes); - this.store.dispatch(AuthenticationStore.logout()); - }) - ) - .subscribe(); - - this.protocolService.serverMessage - .pipe( - filter( - message => - message.serviceType === SVC_TYPE_LOGOUT && - message.subServiceType === SSVC_TYPE_LOGOUT_REMOTE_NOTI - ), - tap(message => { - const logoutRemoteNoti = decodeLogoutRemoteNotification(message); + tap(notiOrRes => { + switch (notiOrRes.Type) { + case SSVC_TYPE_LOGOUT_RES: + { + const res = notiOrRes as LogoutResponse; + } + break; + case SSVC_TYPE_LOGOUT_REMOTE_NOTI: + { + const noti = notiOrRes as LogoutRemoteNotification; + } + break; + default: + break; + } this.store.dispatch(AuthenticationStore.logout()); }) ) diff --git a/projects/ucap-webmessenger-app/src/app/store/account/authentication/actions.ts b/projects/ucap-webmessenger-app/src/app/store/account/authentication/actions.ts index 1e10669f..c87419be 100644 --- a/projects/ucap-webmessenger-app/src/app/store/account/authentication/actions.ts +++ b/projects/ucap-webmessenger-app/src/app/store/account/authentication/actions.ts @@ -3,7 +3,11 @@ import { createAction, props } from '@ngrx/store'; import { Login2Response } from '@ucap-webmessenger/pi'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; -import { LoginInfo } from '../../../types'; +import { LoginInfo } from '@app/types'; +import { + UserPasswordSetRequest, + UserPasswordSetResponse +} from '@ucap-webmessenger/protocol-service'; export const webLogin = createAction( '[Account::Authentication] Web Login', @@ -30,7 +34,7 @@ export const webLoginFailure = createAction( export const loginSuccess = createAction( '[Account::Authentication] Login Success', props<{ - loginInfo: LoginResponse; + loginRes: LoginResponse; }>() ); @@ -52,3 +56,47 @@ export const logoutConfirmation = createAction( export const logoutConfirmationDismiss = createAction( '[Account::Authentication] Logout Confirmation Dismiss' ); + +export const postLogin = createAction( + '[Account::Authentication] Post Login', + props<{ + loginRes: LoginResponse; + }>() +); + +export const privacyAgree = createAction( + '[Account::Authentication] Privacy Agree', + props<{ + loginRes: LoginResponse; + }>() +); + +export const privacyAgreeSuccess = createAction( + '[Account::Authentication] Privacy Agree Success' +); + +export const privacyAgreeFailure = createAction( + '[Account::Authentication] Privacy Agree Failure', + props<{ error: any }>() +); + +export const privacyDisagree = createAction( + '[Account::Authentication] Privacy Disagree' +); + +export const changePassword = createAction( + '[Account::Authentication] Change Password', + props<{ req: UserPasswordSetRequest }>() +); + +export const changePasswordSuccess = createAction( + '[Account::Authentication] Change Password Success', + props<{ + res: UserPasswordSetResponse; + }>() +); + +export const changePasswordFailure = createAction( + '[Account::Authentication] Change Password Failure', + props<{ error: any }>() +); diff --git a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts index a6095306..c0253fd8 100644 --- a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts @@ -6,7 +6,11 @@ import { catchError, exhaustMap, map, tap, switchMap } from 'rxjs/operators'; import { Actions, ofType, createEffect } from '@ngrx/effects'; -import { PiService, Login2Response } from '@ucap-webmessenger/pi'; +import { + PiService, + Login2Response, + UserTermsActionResponse +} from '@ucap-webmessenger/pi'; import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; import { DialogService, @@ -22,11 +26,30 @@ import { logoutConfirmationDismiss, webLogin, webLoginSuccess, - webLoginFailure + webLoginFailure, + postLogin, + privacyAgree, + privacyDisagree, + privacyAgreeFailure, + privacyAgreeSuccess, + changePassword, + changePasswordFailure, + changePasswordSuccess } from './actions'; -import { LoginInfo } from '../../../types'; -import { AppAuthenticationService } from '../../../services/authentication.service'; +import { + LoginInfo, + KEY_LOGIN_INFO, + EnvironmentsInfo, + KEY_ENVIRONMENTS_INFO +} from '@app/types'; +import { AppAuthenticationService } from '@app/services/authentication.service'; import { NGXLogger } from 'ngx-logger'; +import { Store } from '@ngrx/store'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { + ServiceProtocolService, + UserPasswordSetResponse +} from '@ucap-webmessenger/protocol-service'; @Injectable() export class Effects { @@ -125,11 +148,139 @@ export class Effects { ) ); + postLogin$ = createEffect( + () => + this.actions$.pipe( + ofType(postLogin), + map(action => action.loginRes), + tap(async loginRes => { + const loginInfo = this.sessionStorageService.get( + KEY_LOGIN_INFO + ); + const environmentsInfo = this.sessionStorageService.get< + EnvironmentsInfo + >(KEY_ENVIRONMENTS_INFO); + + if (!loginRes.privateInformationAgree) { + const privacyTotalUrl = this.piService.privacyTotalUrl({ + companyCode: loginInfo.companyCode, + userSeq: loginRes.userSeq, + token: loginRes.tokenString, + deviceType: environmentsInfo.deviceType, + localeCode: loginInfo.localeCode, + textOnly: 'true' + }); + + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + width: '100%', + height: '500px', + disableClose: true, + data: { + title: '개인정보 동의' + // html: `