@propmix/profet-common-header 2.3.2 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +25 -54
  2. package/esm2020/lib/api-endpoints.def.mjs +5 -2
  3. package/esm2020/lib/common-header.interface.mjs +2 -0
  4. package/esm2020/lib/common-header.module.mjs +31 -5
  5. package/esm2020/lib/common-header.service.mjs +39 -9
  6. package/esm2020/lib/company-switch-warning/company-switch-warning.component.mjs +20 -0
  7. package/esm2020/lib/config/app.config.mjs +21 -0
  8. package/esm2020/lib/header/header.component.mjs +183 -197
  9. package/esm2020/lib/pipes/active-route.pipe.mjs +24 -0
  10. package/esm2020/lib/utils/app.constants.mjs +2 -2
  11. package/esm2020/lib/utils/image.dataurl.mjs +4 -1
  12. package/esm2020/public-api.mjs +2 -3
  13. package/fesm2015/propmix-profet-common-header.mjs +319 -223
  14. package/fesm2015/propmix-profet-common-header.mjs.map +1 -1
  15. package/fesm2020/propmix-profet-common-header.mjs +313 -219
  16. package/fesm2020/propmix-profet-common-header.mjs.map +1 -1
  17. package/lib/api-endpoints.def.d.ts +3 -0
  18. package/lib/common-header.interface.d.ts +32 -0
  19. package/lib/common-header.module.d.ts +18 -10
  20. package/lib/common-header.service.d.ts +11 -3
  21. package/lib/company-switch-warning/company-switch-warning.component.d.ts +7 -0
  22. package/lib/config/app.config.d.ts +4 -0
  23. package/lib/header/header.component.d.ts +35 -27
  24. package/lib/pipes/active-route.pipe.d.ts +12 -0
  25. package/lib/utils/image.dataurl.d.ts +1 -0
  26. package/package.json +1 -1
  27. package/public-api.d.ts +1 -2
  28. package/esm2020/lib/utils/HeaderConfig.mjs +0 -8
  29. package/esm2020/lib/utils/UserDetails.mjs +0 -2
  30. package/lib/utils/HeaderConfig.d.ts +0 -5
  31. package/lib/utils/UserDetails.d.ts +0 -4
@@ -6,5 +6,8 @@ export declare class EndPoints {
6
6
  updateUserCompany: string;
7
7
  fetchCompanyProfile: string;
8
8
  findByEmail: string;
9
+ getCompanyList: string;
10
+ getAppMenu: string;
11
+ updateLastAccessedApplication: string;
9
12
  };
10
13
  }
@@ -0,0 +1,32 @@
1
+ import { PROFET_APPS } from "./utils/apps.enum";
2
+ export interface AppMenu {
3
+ appType: PROFET_APPS;
4
+ menuName: string;
5
+ icon?: string;
6
+ path: string;
7
+ groupBy?: string;
8
+ }
9
+ export type ApplicationConfig = {
10
+ [key in PROFET_APPS]: {
11
+ appName: string;
12
+ appLogoUri: string;
13
+ };
14
+ };
15
+ export interface HeaderConfig {
16
+ apiUrl: string;
17
+ portalFrontendUrl?: string;
18
+ signOutUrl: string;
19
+ appType: PROFET_APPS;
20
+ }
21
+ export interface Company {
22
+ companyKey: string;
23
+ name: string;
24
+ logo?: string;
25
+ isActive: boolean;
26
+ baseUrls: {
27
+ profet_portal?: string;
28
+ appraisal_management?: string;
29
+ appraisal_review?: string;
30
+ appraisal_valuation?: string;
31
+ };
32
+ }
@@ -1,16 +1,24 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./header/header.component";
3
- import * as i2 from "@angular/common";
4
- import * as i3 from "@angular/material/toolbar";
5
- import * as i4 from "@angular/material/icon";
6
- import * as i5 from "@angular/common/http";
7
- import * as i6 from "@angular/material/button";
8
- import * as i7 from "@angular/material/sidenav";
9
- import * as i8 from "@angular/material/menu";
10
- import * as i9 from "@angular/material/snack-bar";
11
- import * as i10 from "@angular/material/tooltip";
3
+ import * as i2 from "./company-switch-warning/company-switch-warning.component";
4
+ import * as i3 from "./pipes/active-route.pipe";
5
+ import * as i4 from "@angular/common";
6
+ import * as i5 from "@angular/material/toolbar";
7
+ import * as i6 from "@angular/material/icon";
8
+ import * as i7 from "@angular/common/http";
9
+ import * as i8 from "@angular/material/button";
10
+ import * as i9 from "@angular/material/sidenav";
11
+ import * as i10 from "@angular/material/menu";
12
+ import * as i11 from "@angular/material/snack-bar";
13
+ import * as i12 from "@angular/material/tooltip";
14
+ import * as i13 from "@angular/material/divider";
15
+ import * as i14 from "@angular/material/list";
16
+ import * as i15 from "@angular/material/form-field";
17
+ import * as i16 from "@angular/material/select";
18
+ import * as i17 from "@angular/forms";
19
+ import * as i18 from "@angular/material/dialog";
12
20
  export declare class CommonHeaderModule {
13
21
  static ɵfac: i0.ɵɵFactoryDeclaration<CommonHeaderModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<CommonHeaderModule, [typeof i1.HeaderComponent], [typeof i2.CommonModule, typeof i3.MatToolbarModule, typeof i4.MatIconModule, typeof i5.HttpClientModule, typeof i6.MatButtonModule, typeof i7.MatSidenavModule, typeof i8.MatMenuModule, typeof i9.MatSnackBarModule, typeof i10.MatTooltipModule], [typeof i1.HeaderComponent]>;
22
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CommonHeaderModule, [typeof i1.HeaderComponent, typeof i2.CompanySwitchWarningComponent, typeof i3.ActiveRoutePipe], [typeof i4.CommonModule, typeof i5.MatToolbarModule, typeof i6.MatIconModule, typeof i7.HttpClientModule, typeof i8.MatButtonModule, typeof i9.MatSidenavModule, typeof i10.MatMenuModule, typeof i11.MatSnackBarModule, typeof i12.MatTooltipModule, typeof i13.MatDividerModule, typeof i14.MatListModule, typeof i15.MatFormFieldModule, typeof i16.MatSelectModule, typeof i17.ReactiveFormsModule, typeof i18.MatDialogModule], [typeof i1.HeaderComponent]>;
15
23
  static ɵinj: i0.ɵɵInjectorDeclaration<CommonHeaderModule>;
16
24
  }
@@ -1,12 +1,17 @@
1
- import { HeaderConfig } from './utils/HeaderConfig';
1
+ import { AppMenu, Company, HeaderConfig } from './common-header.interface';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class CommonHeaderService {
4
4
  private config;
5
5
  private baseUrl;
6
- portalFrontendUrl: string;
7
- signOutUrl: string;
6
+ headerConfig: HeaderConfig;
8
7
  private _apiGatewayService;
8
+ private menuStateSubject;
9
+ activeMenuList$: import("rxjs").Observable<AppMenu[] | null>;
10
+ private companyListSubject;
11
+ companyList$: import("rxjs").Observable<Company[] | null>;
9
12
  constructor(config: HeaderConfig);
13
+ setMenuState(data: AppMenu[]): void;
14
+ setCompanyList(data: Company[]): void;
10
15
  obtainDataByUrl(url: string): import("rxjs").Observable<any>;
11
16
  getDomainInfo(): {
12
17
  domain: string;
@@ -18,6 +23,9 @@ export declare class CommonHeaderService {
18
23
  updateUserCompany(reqBody: any): import("rxjs").Observable<any>;
19
24
  fetchCompanyProfile(reqBody: any): import("rxjs").Observable<{}>;
20
25
  getUserDetailsByEmail(reqBody: any): import("rxjs").Observable<any>;
26
+ getCompanyList(): import("rxjs").Observable<{}>;
27
+ getMenuList(): import("rxjs").Observable<{}>;
28
+ updateLastAccessedApplication(reqBody: any): import("rxjs").Observable<any>;
21
29
  static ɵfac: i0.ɵɵFactoryDeclaration<CommonHeaderService, never>;
22
30
  static ɵprov: i0.ɵɵInjectableDeclaration<CommonHeaderService>;
23
31
  }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class CompanySwitchWarningComponent {
3
+ comInfo: any;
4
+ constructor(comInfo: any);
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<CompanySwitchWarningComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<CompanySwitchWarningComponent, "lib-company-switch-warning", never, {}, {}, never, never, false, never>;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { ApplicationConfig } from "../common-header.interface";
2
+ export declare class AppConfig {
3
+ static readonly appConfig: ApplicationConfig;
4
+ }
@@ -1,29 +1,24 @@
1
1
  import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
2
+ import { FormControl } from '@angular/forms';
2
3
  import { MatSidenav } from '@angular/material/sidenav';
3
- import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
4
+ import { DomSanitizer } from '@angular/platform-browser';
5
+ import { Router } from '@angular/router';
6
+ import { AppMenu, Company } from '../common-header.interface';
7
+ import { CommonHeaderService } from '../common-header.service';
4
8
  import { PROFET_APPS } from '../utils/apps.enum';
5
9
  import * as i0 from "@angular/core";
6
10
  export declare class HeaderComponent implements OnInit {
7
11
  username: string;
8
12
  template: TemplateRef<any>;
9
- appName: PROFET_APPS;
10
- menuEvent: EventEmitter<any>;
11
13
  infoEvent: EventEmitter<any>;
12
- sidenav: MatSidenav;
13
- appList: Array<any>;
14
- userCompanies: any;
15
14
  companyProfile: any;
16
15
  portalUrl: string;
17
16
  userAuthData: any;
18
17
  userImageLink: any;
19
- headerClass: string;
20
- currentApp: any;
21
- currentAppLogo: SafeUrl;
22
- currentCompany: any;
23
18
  userCompanyLogo: any;
24
- enabledApplications: Array<any>;
25
19
  imageDataUrls: {
26
20
  defaultUserImage: string;
21
+ profetLogo: string;
27
22
  hamburgerMenu: string;
28
23
  logoThumbnail: string;
29
24
  profetOrdersLogo: string;
@@ -37,29 +32,42 @@ export declare class HeaderComponent implements OnInit {
37
32
  aloftAppraisalLogo: string;
38
33
  profetLogoWhite: string;
39
34
  };
40
- isAppsMenuOpen: boolean;
41
- isProfileMenuOpen: boolean;
42
- private _router;
35
+ _router: Router;
43
36
  private _snackbar;
44
- private _ser;
37
+ _headerSer: CommonHeaderService;
45
38
  _domSanitizer: DomSanitizer;
46
- private _titleCasepipe;
47
- private _lowerCasePipe;
39
+ private _dialog;
40
+ companyControl: FormControl<any>;
41
+ appConfig: any;
42
+ menuList: AppMenu[];
43
+ companyList: Company[];
44
+ sidenav: MatSidenav;
45
+ menuInfo: {
46
+ [key: string]: AppMenu[];
47
+ };
48
+ activeCompany: Company | undefined;
49
+ groupedMenu: {
50
+ appType: PROFET_APPS;
51
+ groups: {
52
+ groupBy?: string;
53
+ items: AppMenu[];
54
+ }[];
55
+ }[];
48
56
  constructor();
49
57
  ngOnInit(): Promise<void>;
50
- menuAction(): void;
58
+ groupMenu(): void;
59
+ selectCurrentCompany(): void;
60
+ patchCurrentCompanyInfo(): void;
61
+ sideMenuToggle(): void;
62
+ menuSelection(menu: AppMenu): void;
63
+ getCompanyList(): void;
64
+ getMenuList(): void;
51
65
  fetchCompanyProfile(): void;
52
- fetchCompanyData(allApps: Array<any>): void;
53
- sanitizeUrl(url: string): SafeUrl;
54
66
  getUserProfile(): void;
55
- appRedirect(app: any): void;
56
67
  profile(): void;
57
- loadUserMessages(): void;
58
68
  onLogoutClick(): void;
59
- switchCompany(company: any): void;
60
- getCurrentCompanyInfo(): any;
61
- setCurrentAppLogo(): void;
62
- toggleMenu(menu: string): void;
69
+ updateLastAppInfo(): void;
70
+ switchCompany(info: any): void;
63
71
  static ɵfac: i0.ɵɵFactoryDeclaration<HeaderComponent, never>;
64
- static ɵcmp: i0.ɵɵComponentDeclaration<HeaderComponent, "lib-header", never, { "template": "template"; "appName": "appName"; }, { "menuEvent": "menuEvent"; "infoEvent": "infoEvent"; }, never, never, false, never>;
72
+ static ɵcmp: i0.ɵɵComponentDeclaration<HeaderComponent, "lib-header", never, { "template": "template"; }, { "infoEvent": "infoEvent"; }, never, ["*"], false, never>;
65
73
  }
@@ -0,0 +1,12 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { Router } from '@angular/router';
3
+ import { AppMenu } from '../common-header.interface';
4
+ import { PROFET_APPS } from '../utils/apps.enum';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ActiveRoutePipe implements PipeTransform {
7
+ private _router;
8
+ constructor(_router: Router);
9
+ transform(menu: AppMenu, url: string, app?: PROFET_APPS): boolean;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<ActiveRoutePipe, never>;
11
+ static ɵpipe: i0.ɵɵPipeDeclaration<ActiveRoutePipe, "activeRoute", false>;
12
+ }
@@ -1,5 +1,6 @@
1
1
  export declare const imageDataUrl: {
2
2
  defaultUserImage: string;
3
+ profetLogo: string;
3
4
  hamburgerMenu: string;
4
5
  logoThumbnail: string;
5
6
  profetOrdersLogo: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propmix/profet-common-header",
3
- "version": "2.3.2",
3
+ "version": "2.4.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=15.2.0",
6
6
  "@angular/core": ">=15.2.0",
package/public-api.d.ts CHANGED
@@ -1,7 +1,6 @@
1
+ export * from './lib/common-header.interface';
1
2
  export * from './lib/common-header.module';
2
3
  export * from './lib/common-header.service';
3
4
  export * from './lib/header/header.component';
4
5
  export * from './lib/utils/app.constants';
5
6
  export * from './lib/utils/apps.enum';
6
- export * from './lib/utils/HeaderConfig';
7
- export * from './lib/utils/UserDetails';
@@ -1,8 +0,0 @@
1
- export class HeaderConfig {
2
- constructor() {
3
- this.apiUrl = '';
4
- this.portalFrontendUrl = '';
5
- this.signOutUrl = '';
6
- }
7
- }
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSGVhZGVyQ29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29tbW9uLWhlYWRlci9zcmMvbGliL3V0aWxzL0hlYWRlckNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLE9BQU8sWUFBWTtJQUF6QjtRQUNJLFdBQU0sR0FBVyxFQUFFLENBQUM7UUFDcEIsc0JBQWlCLEdBQVksRUFBRSxDQUFDO1FBQ2hDLGVBQVUsR0FBVyxFQUFFLENBQUM7SUFDNUIsQ0FBQztDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNsYXNzIEhlYWRlckNvbmZpZyB7XG4gICAgYXBpVXJsOiBzdHJpbmcgPSAnJztcbiAgICBwb3J0YWxGcm9udGVuZFVybD86IHN0cmluZyA9ICcnO1xuICAgIHNpZ25PdXRVcmw6IHN0cmluZyA9ICcnO1xufSJdfQ==
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXNlckRldGFpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb21tb24taGVhZGVyL3NyYy9saWIvdXRpbHMvVXNlckRldGFpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgVXNlckRldGFpbHMge1xuICAgIG5hbWU6IHN0cmluZztcbiAgICBkZXRhaWxzOiBhbnk7XG59Il19
@@ -1,5 +0,0 @@
1
- export declare class HeaderConfig {
2
- apiUrl: string;
3
- portalFrontendUrl?: string;
4
- signOutUrl: string;
5
- }
@@ -1,4 +0,0 @@
1
- export interface UserDetails {
2
- name: string;
3
- details: any;
4
- }