tenent search component is added

This commit is contained in:
병준 박 2019-10-07 16:29:38 +09:00
parent ebb8093a3f
commit 33d8e733d1
17 changed files with 447 additions and 11 deletions

View File

@ -1,4 +1,16 @@
<ucap-group-expansion-panel
[groupBuddyList]="groupBuddyList$ | async"
(selectBuddy)="onSelectBuddy($event)"
></ucap-group-expansion-panel>
<div>
<div>
<ucap-organization-tenant-search
[companyList]="companyList$ | async"
[companyCode]="companyCode"
(keyDownEnter)="onKeyDownEnterOrganizationTenantSearch($event)"
></ucap-organization-tenant-search>
</div>
<div>
<ucap-group-expansion-panel
[groupBuddyList]="groupBuddyList$ | async"
(selectBuddy)="onSelectBuddy($event)"
>
</ucap-group-expansion-panel>
</div>
</div>

View File

@ -11,6 +11,9 @@ import { UserInfo, GroupDetailData } from '@ucap-webmessenger/protocol-sync';
import * as AppStore from '@app/store';
import * as ChatStore from '@app/store/messenger/chat';
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';
@Component({
selector: 'app-layout-chat-left-sidenav-group',
@ -22,10 +25,27 @@ export class GroupComponent implements OnInit {
groupBuddyList$: Observable<
{ group: GroupDetailData; buddyList: UserInfo[] }[]
>;
companyList$: Observable<Company[]>;
companyCode: string;
constructor(private store: Store<any>, private logger: NGXLogger) {}
constructor(
private store: Store<any>,
private sessionStorageService: SessionStorageService,
private logger: NGXLogger
) {}
ngOnInit() {
const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
this.companyCode = loginInfo.companyCode;
this.companyList$ = this.store.pipe(
select(AppStore.SettingSelector.CompanySelector.companyList),
map(list => {
this.logger.debug('list', list);
return list;
})
);
this.groupBuddyList$ = this.store
.pipe(
select(AppStore.MessengerSelector.SyncSelector.groupListAndBuddyList)
@ -74,4 +94,11 @@ export class GroupComponent implements OnInit {
onSelectBuddy(buddy: UserInfo) {
this.store.dispatch(ChatStore.selectedRoom({ roomSeq: buddy.seq }));
}
onKeyDownEnterOrganizationTenantSearch(params: {
companyCode: string;
searchWord: string;
}) {
this.logger.debug('params', params);
}
}

View File

@ -0,0 +1,23 @@
<mat-card class="confirm-card">
<mat-card-header cdkDrag cdkDragRootElement=".cdk-overlay-pane" cdkDragHandle>
<mat-card-title>{{ data.title }}</mat-card-title>
<!-- <mat-card-subtitle>Confirm</mat-card-subtitle> -->
</mat-card-header>
<mat-card-content>
<div #messageContainer class="notice">
{{ data.message }}
</div>
</mat-card-content>
<mat-card-actions *ngIf="!hideAction" 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

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ConfirmDialogComponent } from './confirm.dialog.component';
describe('ui::ConfirmDialogComponent', () => {
let component: ConfirmDialogComponent;
let fixture: ComponentFixture<ConfirmDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ConfirmDialogComponent]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ConfirmDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,51 @@
import {
Component,
OnInit,
Inject,
ViewChild,
ElementRef
} from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
export interface ConfirmDialogData {
title: string;
message?: string;
html?: string;
hideAction?: boolean;
}
export interface ConfirmDialogResult {
choice: boolean;
}
@Component({
selector: 'ucap-ui-confirm-dialog',
templateUrl: './confirm.dialog.component.html',
styleUrls: ['./confirm.dialog.component.scss']
})
export class ConfirmDialogComponent implements OnInit {
@ViewChild('messageContainer', { static: true })
messageContainer: ElementRef;
hideAction = false;
constructor(
public dialogRef: MatDialogRef<ConfirmDialogComponent, ConfirmDialogResult>,
@Inject(MAT_DIALOG_DATA) public data: ConfirmDialogData
) {}
ngOnInit(): void {
if (!!this.data.html) {
this.messageContainer.nativeElement.innerHTML = this.data.html;
}
if (!!this.data.hideAction) {
this.hideAction = this.data.hideAction;
}
}
onClickChoice(choice: boolean): void {
this.dialogRef.close({
choice
});
}
}

View File

@ -29,6 +29,20 @@
>
</ucap-profile-user-list-item>
</div>
<h3>Organization</h3>
<div>
<div>
<div>
Tenant Search
</div>
<div>
<ucap-organization-tenant-search
[companyList]="companyList"
[companyCode]="companyCode"
></ucap-organization-tenant-search>
</div>
</div>
</div>
<h3>Chat::MessageBox</h3>
<div>
<div>

View File

@ -9,6 +9,7 @@ import {
} 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',
@ -22,6 +23,10 @@ export class TemplatePageComponent implements OnInit {
presence: StatusBulkInfo = status;
companyList: Company[] = companyList;
companyCode: string = 'GUC006';
constructor(private router: Router) {}
ngOnInit() {}
@ -84,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'
}
];

View File

@ -7,7 +7,8 @@ import { MatButtonModule } from '@angular/material/button';
import { UCapUiChatModule } from '@ucap-webmessenger/ui-chat';
import { UCapUiGroupModule } from '@ucap-webmessenger/ui-group';
import { UcapUiProfileModule } from '@ucap-webmessenger/ui-profile';
import { UCapUiOrganizationModule } from '@ucap-webmessenger/ui-organization';
import { UCapUiProfileModule } from '@ucap-webmessenger/ui-profile';
import { AppTemplateRoutingPageModule } from './template-routing.page.module';
@ -21,7 +22,8 @@ import { COMPONENTS, MET_MODULES } from './components';
MatButtonModule,
UCapUiChatModule,
UCapUiGroupModule,
UcapUiProfileModule,
UCapUiOrganizationModule,
UCapUiProfileModule,
AppTemplateRoutingPageModule
],
declarations: [...COMPONENTS],

View File

@ -39,6 +39,7 @@ 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/messenger/option';
import * as QueryStore from '@app/store/messenger/query';
@ -124,6 +125,12 @@ export class AppMessengerResolver implements Resolve<void> {
);
this.store.dispatch(QueryStore.authSuccess({ res: authRes }));
this.store.dispatch(
CompanyStore.companyList({
companyGroupCode: 'LG'
})
);
// this.store.dispatch(AuthenticationStore.postLogin({ loginRes }));
}),
withLatestFrom(

View File

@ -0,0 +1,20 @@
<div>
<div>
<mat-select [(value)]="companyCode">
<mat-option
*ngFor="let company of companyList"
[value]="company.companyCode"
>
{{ company.companyName }}
</mat-option>
</mat-select>
</div>
<div>
<input
matInput
#searchWordInput
placeholder="name"
(keydown.enter)="onKeyDownEnter(searchWordInput.value)"
/>
</div>
</div>

View File

@ -0,0 +1,12 @@
.organization-tree {
ul,
li {
margin-top: 0;
margin-bottom: 0;
list-style-type: none;
}
.organization-tree-node-invisible {
display: none;
}
}

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TenantSearchComponent } from './tenant-search.component';
describe('Organization::TenantSearchComponent', () => {
let component: TenantSearchComponent;
let fixture: ComponentFixture<TenantSearchComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [TenantSearchComponent]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TenantSearchComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,30 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { NGXLogger } from 'ngx-logger';
import { Company } from '@ucap-webmessenger/api-external';
@Component({
selector: 'ucap-organization-tenant-search',
templateUrl: './tenant-search.component.html',
styleUrls: ['./tenant-search.component.scss']
})
export class TenantSearchComponent implements OnInit {
@Input()
companyList: Company[];
@Input()
companyCode: string;
@Output()
keyDownEnter = new EventEmitter<{
companyCode: string;
searchWord: string;
}>();
constructor(private logger: NGXLogger) {}
ngOnInit() {}
onKeyDownEnter(searchWord: string) {
this.keyDownEnter.emit({ companyCode: this.companyCode, searchWord });
}
}

View File

@ -4,11 +4,14 @@ import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { MatTreeModule } from '@angular/material/tree';
import { TenantSearchComponent } from './components/tenant-search.component';
import { TreeComponent } from './components/tree.component';
const COMPONENTS = [TreeComponent];
const COMPONENTS = [TenantSearchComponent, TreeComponent];
const SERVICES = [];
@NgModule({
@ -17,6 +20,8 @@ const SERVICES = [];
ReactiveFormsModule,
MatButtonModule,
MatIconModule,
MatInputModule,
MatSelectModule,
MatTreeModule
],
exports: [...COMPONENTS],

View File

@ -1,6 +1,7 @@
/*
* Public API Surface of ucap-webmessenger-ui-organization
*/
export * from './lib/components/tenant-search.component';
export * from './lib/components/tree.component';
export * from './lib/ucap-ui-organization.module';

View File

@ -26,10 +26,10 @@ const SERVICES = [];
exports: [...COMPONENTS],
declarations: [...COMPONENTS]
})
export class UcapUiProfileModule {
public static forRoot(): ModuleWithProviders<UcapUiProfileModule> {
export class UCapUiProfileModule {
public static forRoot(): ModuleWithProviders<UCapUiProfileModule> {
return {
ngModule: UcapUiProfileModule,
ngModule: UCapUiProfileModule,
providers: [...SERVICES]
};
}