@propmix/profet-common-header 1.0.1 → 1.0.3

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.
@@ -1,17 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injectable, Inject, Component, EventEmitter, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
2
+ import { inject, Injectable, Inject, EventEmitter, Component, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
3
3
  import { HttpClient, HttpClientModule } from '@angular/common/http';
4
4
  import { Observable } from 'rxjs';
5
5
  import { Router } from '@angular/router';
6
6
  import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
7
7
  import { Auth } from 'aws-amplify';
8
- import * as i2 from '@angular/common';
8
+ import * as i1 from '@angular/common';
9
9
  import { CommonModule } from '@angular/common';
10
- import * as i3 from '@angular/material/toolbar';
10
+ import * as i2 from '@angular/material/toolbar';
11
11
  import { MatToolbarModule } from '@angular/material/toolbar';
12
- import * as i4 from '@angular/material/button';
12
+ import * as i3 from '@angular/material/button';
13
13
  import { MatButtonModule } from '@angular/material/button';
14
- import * as i5 from '@angular/material/menu';
14
+ import * as i4 from '@angular/material/menu';
15
15
  import { MatMenuModule } from '@angular/material/menu';
16
16
  import { MatIconModule } from '@angular/material/icon';
17
17
  import { MatSidenavModule } from '@angular/material/sidenav';
@@ -101,13 +101,8 @@ class CommonHeaderService {
101
101
  this.config = config;
102
102
  this.baseUrl = '';
103
103
  this._apiGatewayService = inject(ApiGatewayService);
104
- console.log('version =>1.0.14');
105
104
  this.baseUrl = this.config.apiUrl;
106
105
  }
107
- // getUserInfo() {
108
- // let url = `${this.baseUrl}/api/users/fetchLoggedInUsers`;
109
- // return this._http.get(url);
110
- // }
111
106
  getApps() {
112
107
  let url = `${this.baseUrl + EndPoints.API_URLS.getAppsApi}`;
113
108
  return this._apiGatewayService.doGet(url);
@@ -139,56 +134,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
139
134
  }] }];
140
135
  } });
141
136
 
142
- class CommonHeaderComponent {
143
- }
144
- CommonHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
145
- CommonHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CommonHeaderComponent, selector: "lib-common-header", ngImport: i0, template: `
146
- <p>
147
- common-header works!
148
- </p>
149
- `, isInline: true });
150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderComponent, decorators: [{
151
- type: Component,
152
- args: [{ selector: 'lib-common-header', template: `
153
- <p>
154
- common-header works!
155
- </p>
156
- ` }]
157
- }] });
158
-
159
137
  class HeaderComponent {
160
- constructor(_ser) {
161
- this._ser = _ser;
138
+ constructor() {
139
+ this.username = '';
162
140
  this.menuEvent = new EventEmitter();
163
141
  this.appList = [];
164
142
  this.showSwitchCompanies = false;
165
143
  this._router = inject(Router);
166
144
  this._snackbar = inject(MatSnackBar);
145
+ this._ser = inject(CommonHeaderService);
146
+ // console.log('ver => 2.0.0')
167
147
  }
168
148
  ngOnInit() {
169
149
  this._ser.getApps().subscribe({
170
150
  next: (v) => {
171
151
  var _a;
172
- console.log('from lib', v);
173
152
  if (((_a = v === null || v === void 0 ? void 0 : v.data) === null || _a === void 0 ? void 0 : _a.applications) && v.data.applications.length > 0) {
174
153
  this.fetchCompanyData(v.data.applications);
175
154
  }
176
155
  },
177
156
  error: (e) => {
178
- console.log('from lib errrr', e);
157
+ console.log(e);
179
158
  }
180
159
  });
160
+ Auth.currentAuthenticatedUser().then(user => {
161
+ this.username = user.attributes.given_name;
162
+ })
163
+ .catch(() => console.log("User not logged in"));
181
164
  this.getUserCompany();
182
165
  }
183
166
  fetchCompanyData(allApps) {
184
167
  this._ser.getCompanyApplications().subscribe({
185
168
  next: (v) => {
186
- console.log("getCompanyApplications res :", v);
187
169
  if (v === null || v === void 0 ? void 0 : v.data.enabledApplications) {
188
170
  this.appList = [];
189
171
  let appInfo = [];
190
172
  let fetchedApplications = v.data.enabledApplications.split(',');
191
- console.log("fetchedapps", fetchedApplications);
192
173
  if (fetchedApplications.length > 0) {
193
174
  fetchedApplications.forEach((element) => {
194
175
  appInfo = allApps.filter(ele => ele.name == element);
@@ -202,7 +183,6 @@ class HeaderComponent {
202
183
  }
203
184
  }
204
185
  });
205
- console.log('apps>>', this.appList);
206
186
  }
207
187
  }
208
188
  }
@@ -264,12 +244,12 @@ class HeaderComponent {
264
244
  this.menuEvent.emit();
265
245
  }
266
246
  }
267
- HeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HeaderComponent, deps: [{ token: CommonHeaderService }], target: i0.ɵɵFactoryTarget.Component });
268
- HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: HeaderComponent, selector: "lib-header", inputs: { userInfo: "userInfo" }, outputs: { menuEvent: "menuEvent" }, ngImport: i0, template: "<!-- <mat-drawer-container autosize>\n <mat-drawer #menudrawer class=\"example-sidenav\" mode=\"over\" (click)=\"sidenav.close()\">\n <div class=\"sidenavPanel\">\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <ul class=\"navbarList\">\n <li><img src=\"../../../assets/images/ordersIcon.png\">Orders</li>\n <li><img src=\"../../../assets/images/panelIcon.png\">Panels</li>\n <li><img src=\"../../../assets/images/scheduleIcon.png\">Fee Schedule</li>\n <li><img src=\"../../../assets/images/settingIcon.png\">Settings</li>\n </ul>\n <span class=\"version\">Version: &nbsp;365b520 | 0.16.0</span>\n </div>\n </mat-drawer> -->\n\n\n\n <mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <button color=\"primary\" mat-stroked-button class=\"btnCreateOrder me-2\"><img class=\"me-2\" src=\"../assets/images/file_upload_icon.svg\" width=\"20px\">Create Order</button>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"userInfo && userInfo.name\" class=\"xsHiddenUsername mb-0\">{{userInfo.name}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"userInfo && userInfo.name\" class=\"xsShowUsername\">{{userInfo.name}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n\n\n <!-- <button mat-icon-button class=\"example-icon favorite-icon\" aria-label=\"Example icon-button with heart icon\">\n <mat-icon>favorite</mat-icon>\n </button>\n <button mat-icon-button class=\"example-icon\" aria-label=\"Example icon-button with share icon\">\n <mat-icon>share</mat-icon>\n </button> -->\n </mat-toolbar>\n<!-- </mat-drawer-container> -->", styles: ["@import\"~@angular/material/prebuilt-themes/indigo-pink.css\";.profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{width:40px}mat-toolbar.mat-toolbar.common_header.mat-primary.mat-toolbar-single-row{position:fixed;left:0;top:0;background-color:#fff;height:48px}button.switchButton,button.menuHamberger{padding:8px!important}.sidenavPanel{padding:20px 25px;height:100vh;position:relative}ul.navbarList{padding-left:0;list-style:none;margin-top:40px}ul.navbarList li{color:#666;font-weight:400;margin-bottom:25px;width:170px;cursor:pointer}.active{color:#4177d6!important}ul.navbarList li img{width:23px;margin-right:15px}.accounts_drpmenu{margin-top:.7em}.xsShowUsername{display:none;padding:0 16px;height:48px;line-height:48px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], encapsulation: i0.ViewEncapsulation.None });
247
+ HeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
248
+ HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: HeaderComponent, selector: "lib-header", inputs: { template: "template" }, outputs: { menuEvent: "menuEvent" }, ngImport: i0, template: "<mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <ng-container *ngIf=\"template\" [ngTemplateOutlet]=\"template\"></ng-container>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"username\" class=\"xsHiddenUsername mb-0\">{{username}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"username\" class=\"xsShowUsername\">{{username}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n</mat-toolbar>", styles: ["@import\"~@angular/material/prebuilt-themes/indigo-pink.css\";.profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{width:40px}mat-toolbar.mat-toolbar.common_header.mat-primary.mat-toolbar-single-row{position:fixed;left:0;top:0;background-color:#fff;height:48px}button.switchButton,button.menuHamberger{padding:8px!important}.sidenavPanel{padding:20px 25px;height:100vh;position:relative}ul.navbarList{padding-left:0;list-style:none;margin-top:40px}ul.navbarList li{color:#666;font-weight:400;margin-bottom:25px;width:170px;cursor:pointer}.active{color:#4177d6!important}ul.navbarList li img{width:23px;margin-right:15px}.accounts_drpmenu{margin-top:.7em}.xsShowUsername{display:none;padding:0 16px;height:48px;line-height:48px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], encapsulation: i0.ViewEncapsulation.None });
269
249
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HeaderComponent, decorators: [{
270
250
  type: Component,
271
- args: [{ selector: 'lib-header', encapsulation: ViewEncapsulation.None, template: "<!-- <mat-drawer-container autosize>\n <mat-drawer #menudrawer class=\"example-sidenav\" mode=\"over\" (click)=\"sidenav.close()\">\n <div class=\"sidenavPanel\">\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <ul class=\"navbarList\">\n <li><img src=\"../../../assets/images/ordersIcon.png\">Orders</li>\n <li><img src=\"../../../assets/images/panelIcon.png\">Panels</li>\n <li><img src=\"../../../assets/images/scheduleIcon.png\">Fee Schedule</li>\n <li><img src=\"../../../assets/images/settingIcon.png\">Settings</li>\n </ul>\n <span class=\"version\">Version: &nbsp;365b520 | 0.16.0</span>\n </div>\n </mat-drawer> -->\n\n\n\n <mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <button color=\"primary\" mat-stroked-button class=\"btnCreateOrder me-2\"><img class=\"me-2\" src=\"../assets/images/file_upload_icon.svg\" width=\"20px\">Create Order</button>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"userInfo && userInfo.name\" class=\"xsHiddenUsername mb-0\">{{userInfo.name}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"userInfo && userInfo.name\" class=\"xsShowUsername\">{{userInfo.name}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n\n\n <!-- <button mat-icon-button class=\"example-icon favorite-icon\" aria-label=\"Example icon-button with heart icon\">\n <mat-icon>favorite</mat-icon>\n </button>\n <button mat-icon-button class=\"example-icon\" aria-label=\"Example icon-button with share icon\">\n <mat-icon>share</mat-icon>\n </button> -->\n </mat-toolbar>\n<!-- </mat-drawer-container> -->", styles: ["@import\"~@angular/material/prebuilt-themes/indigo-pink.css\";.profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{width:40px}mat-toolbar.mat-toolbar.common_header.mat-primary.mat-toolbar-single-row{position:fixed;left:0;top:0;background-color:#fff;height:48px}button.switchButton,button.menuHamberger{padding:8px!important}.sidenavPanel{padding:20px 25px;height:100vh;position:relative}ul.navbarList{padding-left:0;list-style:none;margin-top:40px}ul.navbarList li{color:#666;font-weight:400;margin-bottom:25px;width:170px;cursor:pointer}.active{color:#4177d6!important}ul.navbarList li img{width:23px;margin-right:15px}.accounts_drpmenu{margin-top:.7em}.xsShowUsername{display:none;padding:0 16px;height:48px;line-height:48px}\n"] }]
272
- }], ctorParameters: function () { return [{ type: CommonHeaderService }]; }, propDecorators: { userInfo: [{
251
+ args: [{ selector: 'lib-header', encapsulation: ViewEncapsulation.None, template: "<mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <ng-container *ngIf=\"template\" [ngTemplateOutlet]=\"template\"></ng-container>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"username\" class=\"xsHiddenUsername mb-0\">{{username}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"username\" class=\"xsShowUsername\">{{username}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n</mat-toolbar>", styles: ["@import\"~@angular/material/prebuilt-themes/indigo-pink.css\";.profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{width:40px}mat-toolbar.mat-toolbar.common_header.mat-primary.mat-toolbar-single-row{position:fixed;left:0;top:0;background-color:#fff;height:48px}button.switchButton,button.menuHamberger{padding:8px!important}.sidenavPanel{padding:20px 25px;height:100vh;position:relative}ul.navbarList{padding-left:0;list-style:none;margin-top:40px}ul.navbarList li{color:#666;font-weight:400;margin-bottom:25px;width:170px;cursor:pointer}.active{color:#4177d6!important}ul.navbarList li img{width:23px;margin-right:15px}.accounts_drpmenu{margin-top:.7em}.xsShowUsername{display:none;padding:0 16px;height:48px;line-height:48px}\n"] }]
252
+ }], ctorParameters: function () { return []; }, propDecorators: { template: [{
273
253
  type: Input
274
254
  }], menuEvent: [{
275
255
  type: Output
@@ -278,16 +258,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
278
258
  class CommonHeaderModule {
279
259
  }
280
260
  CommonHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
281
- CommonHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderModule, declarations: [CommonHeaderComponent,
282
- HeaderComponent], imports: [CommonModule,
261
+ CommonHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderModule, declarations: [HeaderComponent], imports: [CommonModule,
283
262
  MatToolbarModule,
284
263
  MatIconModule,
285
264
  HttpClientModule,
286
265
  MatButtonModule,
287
266
  MatSidenavModule,
288
267
  MatMenuModule,
289
- MatSnackBarModule], exports: [CommonHeaderComponent,
290
- HeaderComponent] });
268
+ MatSnackBarModule], exports: [HeaderComponent] });
291
269
  CommonHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderModule, imports: [CommonModule,
292
270
  MatToolbarModule,
293
271
  MatIconModule,
@@ -300,7 +278,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
300
278
  type: NgModule,
301
279
  args: [{
302
280
  declarations: [
303
- CommonHeaderComponent,
304
281
  HeaderComponent
305
282
  ],
306
283
  imports: [
@@ -314,7 +291,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
314
291
  MatSnackBarModule
315
292
  ],
316
293
  exports: [
317
- CommonHeaderComponent,
318
294
  HeaderComponent
319
295
  ]
320
296
  }]
@@ -328,5 +304,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
328
304
  * Generated bundle index. Do not edit.
329
305
  */
330
306
 
331
- export { CommonHeaderComponent, CommonHeaderModule, CommonHeaderService, HeaderComponent, HeaderConfig };
307
+ export { CommonHeaderModule, CommonHeaderService, HeaderComponent, HeaderConfig };
332
308
  //# sourceMappingURL=propmix-profet-common-header.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"propmix-profet-common-header.mjs","sources":["../../../projects/common-header/src/lib/api-endpoints.def.ts","../../../projects/common-header/src/lib/api-gateway.service.ts","../../../projects/common-header/src/lib/utils/HeaderConfig.ts","../../../projects/common-header/src/lib/common-header.service.ts","../../../projects/common-header/src/lib/common-header.component.ts","../../../projects/common-header/src/lib/header/header.component.ts","../../../projects/common-header/src/lib/header/header.component.html","../../../projects/common-header/src/lib/common-header.module.ts","../../../projects/common-header/src/public-api.ts","../../../projects/common-header/src/propmix-profet-common-header.ts"],"sourcesContent":["export class EndPoints {\n public static API_URLS = {\n getAppsApi: '/api/company/getALlApplications',\n getCompanyApplications: '/api/company/getCompanyApplications',\n getUserCompanies: '/api/profile/getUserCompanies',\n updateUserCompany: '/api/company/updateUserCompany'\n }\n}","import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Observable } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiGatewayService {\n private _http = inject(HttpClient);\n \n doGet(url: string, config?: any): Observable<any> {\n return new Observable(observer => {\n if (!config) {\n config = {\n isLoaderHidden: false\n };\n };\n let headers:any;\n if(config.isUnauthorized){\n headers = {\n skip: \"true\"\n }\n }\n \n // this._loaderService.requestStarted(config);\n this._http\n .get(url,{headers: headers})\n .subscribe({\n next: (data) => {\n // this._loaderService.requestEnded();\n observer.next(data);\n observer.complete();\n },\n error: (error) => {\n // this.handleError(error, config, observer);\n }\n });\n })\n }\n doPost(url: string, req_body?: any): Observable<any> {\n return new Observable(observer => {\n let headers:any;\n this._http\n .post(url, req_body,{headers: headers})\n .subscribe({\n next: (data) => {\n if (data && data.hasOwnProperty('status')) {\n observer.next(data);\n observer.complete();\n } else {\n observer.next(data);\n observer.complete();\n }\n },\n error: (error:any) => {\n // this.handleError(error, config, observer);\n }\n })\n });\n }\n}\n","export class HeaderConfig {\n apiUrl: string = '';\n}","import { HttpClient } from '@angular/common/http';\nimport { Inject, Injectable, inject } from '@angular/core';\nimport { HeaderConfig } from './utils/HeaderConfig';\nimport { EndPoints } from './api-endpoints.def';\nimport { ApiGatewayService } from './api-gateway.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CommonHeaderService {\n private baseUrl: string = '';\n private _apiGatewayService = inject(ApiGatewayService);\n constructor(@Inject('headerConfig') private config: HeaderConfig) { \n console.log('version =>1.0.14')\n this.baseUrl = this.config.apiUrl;\n }\n\n // getUserInfo() {\n // let url = `${this.baseUrl}/api/users/fetchLoggedInUsers`;\n // return this._http.get(url);\n // }\n\n getApps() {\n let url = `${this.baseUrl + EndPoints.API_URLS.getAppsApi}`;\n return this._apiGatewayService.doGet(url);\n }\n getCompanyApplications() {\n let url = `${this.baseUrl + EndPoints.API_URLS.getCompanyApplications}`;\n return this._apiGatewayService.doGet(url);\n }\n getUserCompanies() {\n let url = `${this.baseUrl + EndPoints.API_URLS.getUserCompanies}`;\n return this._apiGatewayService.doGet(url);\n }\n updateUserCompany(reqBody: any) {\n let url = `${this.baseUrl + EndPoints.API_URLS.updateUserCompany}`;\n return this._apiGatewayService.doPost(url, reqBody);\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'lib-common-header',\n template: `\n <p>\n common-header works!\n </p>\n `,\n styles: [\n ]\n})\nexport class CommonHeaderComponent {\n\n}\n","import { Component, OnInit, inject, ViewChild, ViewEncapsulation, Input, Output, EventEmitter } from '@angular/core';\nimport { CommonHeaderService } from '../common-header.service';\nimport { MatSidenav } from '@angular/material/sidenav';\nimport { Router } from '@angular/router';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { UserDetails } from '../utils/UserDetails';\nimport { Auth } from 'aws-amplify';\n\n@Component({\n selector: 'lib-header',\n templateUrl: './header.component.html',\n styleUrls: ['./header.component.css'],\n encapsulation: ViewEncapsulation.None\n})\nexport class HeaderComponent implements OnInit{\n \n // @ViewChild('menudrawer')\n @Input() userInfo!: UserDetails;\n\n @Output() menuEvent = new EventEmitter<any>();\n sidenav!: MatSidenav;\n appList: Array<any> = [];\n userCompanies: any;\n showSwitchCompanies: boolean = false;\n private _router = inject(Router);\n private _snackbar = inject(MatSnackBar);\n\n constructor(private _ser: CommonHeaderService){}\n\n ngOnInit(): void {\n this._ser.getApps().subscribe({\n next: (v) => {\n console.log('from lib',v);\n if(v?.data?.applications && v.data.applications.length > 0){\n this.fetchCompanyData(v.data.applications);\n }\n },\n error: (e) => {\n console.log('from lib errrr',e)\n }\n });\n this.getUserCompany();\n }\n\n fetchCompanyData(allApps:Array<any>) {\n this._ser.getCompanyApplications().subscribe({\n next: (v) => {\n console.log(\"getCompanyApplications res :\", v);\n if (v?.data.enabledApplications) {\n this.appList = [];\n let appInfo = [];\n let fetchedApplications = v.data.enabledApplications.split(',');\n console.log(\"fetchedapps\", fetchedApplications);\n\n if (fetchedApplications.length > 0) {\n fetchedApplications.forEach((element:any) => {\n appInfo = allApps.filter(ele => ele.name == element);\n if (appInfo && appInfo.length > 0) {\n if(appInfo[0].name != 'mca'){\n this.appList.push({\n name: appInfo[0].displayName,\n value: element,\n appUrl: appInfo[0].appUrl\n });\n }\n }\n });\n console.log('apps>>',this.appList)\n }\n }\n\n }\n })\n }\n\n getUserCompany(){\n this._ser.getUserCompanies().subscribe({\n next: (userCompaniesData: any) => {\n if (userCompaniesData && userCompaniesData.data && userCompaniesData.data.companies) {\n this.userCompanies = userCompaniesData.data.companies;\n if (this.userCompanies.length > 1) {\n this.showSwitchCompanies = true;\n }\n }\n },\n error: (e) => {\n console.log(\"Error in fetching companies for the user\");\n }\n })\n }\n\n appRedirect(app:any) {\n // if (app.name != 'Order Management') {\n window.open(app.appUrl, \"_self\");\n // }\n }\n profile() {\n // this.fetchUserData();\n this._router.navigateByUrl('/app/profile');\n }\n onLogoutClick() {\n Auth.signOut({ global: true })\n .then(data => console.log(data))\n .catch(err => {\n console.log(err)\n Auth.signOut();\n });\n }\n switchCompany(company: any) {\n // switch the user to the selectec company\n let req = { companyKey: company.companyKey };\n this._ser.updateUserCompany(req).subscribe({\n next: (response: any) => {\n if (response && response.type && response.type == \"OK\") {\n // refresh the current page to reload the contents based on the current company\n window.location.reload();\n }\n else {\n // display a message to the user that the company could not be switched.\n this._snackbar.open('Company could not be switched. Please try again or contact support.', 'OK', { duration: 5000 })\n }\n },\n error: (e) => {\n // display a message to the user that the company could not be switched.\n this._snackbar.open('Company could not be switched. Please try again or contact support.', 'OK', { duration: 5000 })\n }\n })\n }\n menuAction(){\n this.menuEvent.emit();\n }\n}\n","<!-- <mat-drawer-container autosize>\n <mat-drawer #menudrawer class=\"example-sidenav\" mode=\"over\" (click)=\"sidenav.close()\">\n <div class=\"sidenavPanel\">\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <ul class=\"navbarList\">\n <li><img src=\"../../../assets/images/ordersIcon.png\">Orders</li>\n <li><img src=\"../../../assets/images/panelIcon.png\">Panels</li>\n <li><img src=\"../../../assets/images/scheduleIcon.png\">Fee Schedule</li>\n <li><img src=\"../../../assets/images/settingIcon.png\">Settings</li>\n </ul>\n <span class=\"version\">Version: &nbsp;365b520 | 0.16.0</span>\n </div>\n </mat-drawer> -->\n\n\n\n <mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <button color=\"primary\" mat-stroked-button class=\"btnCreateOrder me-2\"><img class=\"me-2\" src=\"../assets/images/file_upload_icon.svg\" width=\"20px\">Create Order</button>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"userInfo && userInfo.name\" class=\"xsHiddenUsername mb-0\">{{userInfo.name}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"userInfo && userInfo.name\" class=\"xsShowUsername\">{{userInfo.name}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n\n\n <!-- <button mat-icon-button class=\"example-icon favorite-icon\" aria-label=\"Example icon-button with heart icon\">\n <mat-icon>favorite</mat-icon>\n </button>\n <button mat-icon-button class=\"example-icon\" aria-label=\"Example icon-button with share icon\">\n <mat-icon>share</mat-icon>\n </button> -->\n </mat-toolbar>\n<!-- </mat-drawer-container> -->","import { NgModule } from '@angular/core';\nimport { CommonHeaderComponent } from './common-header.component';\nimport { HeaderComponent } from './header/header.component';\nimport {MatToolbarModule} from '@angular/material/toolbar';\nimport {MatIconModule} from '@angular/material/icon'\nimport { HttpClientModule } from '@angular/common/http';\nimport {MatButtonModule} from '@angular/material/button'\nimport {MatSidenavModule} from '@angular/material/sidenav';\nimport {MatMenuModule} from '@angular/material/menu';\nimport { CommonModule } from '@angular/common';\nimport { MatSnackBarModule } from \"@angular/material/snack-bar\";\n\n@NgModule({\n declarations: [\n CommonHeaderComponent,\n HeaderComponent\n ],\n imports: [\n CommonModule,\n MatToolbarModule,\n MatIconModule,\n HttpClientModule,\n MatButtonModule,\n MatSidenavModule,\n MatMenuModule,\n MatSnackBarModule\n ],\n exports: [\n CommonHeaderComponent,\n HeaderComponent\n ]\n})\nexport class CommonHeaderModule { }\n","/*\n * Public API Surface of common-header\n */\n\nexport * from './lib/common-header.service';\nexport * from './lib/common-header.component';\nexport * from './lib/common-header.module';\nexport * from './lib/header/header.component';\nexport * from './lib/utils/HeaderConfig';\nexport * from './lib/utils/UserDetails';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.CommonHeaderService"],"mappings":";;;;;;;;;;;;;;;;;;MAAa,SAAS,CAAA;;AACJ,SAAA,CAAA,QAAQ,GAAG;AACrB,IAAA,UAAU,EAAE,iCAAiC;AAC7C,IAAA,sBAAsB,EAAE,qCAAqC;AAC7D,IAAA,gBAAgB,EAAE,+BAA+B;AACjD,IAAA,iBAAiB,EAAE,gCAAgC;CACtD;;MCCQ,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;KAoDpC;IAlDC,KAAK,CAAC,GAAW,EAAE,MAAY,EAAA;AAC7B,QAAA,OAAO,IAAI,UAAU,CAAC,QAAQ,IAAG;Y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QAAA,iBAAiB,aAGjB,qBAAqB;QACrB,eAAe,CAAA,EAAA,CAAA,CAAA;AAGN,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAd3B,YAAY;QACZ,gBAAgB;QAChB,aAAa;QACb,gBAAgB;QAChB,eAAe;QACf,gBAAgB;QAChB,aAAa;QACb,iBAAiB,CAAA,EAAA,CAAA,CAAA;4FAOR,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBApB9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,qBAAqB;wBACrB,eAAe;AAChB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,gBAAgB;wBAChB,aAAa;wBACb,gBAAgB;wBAChB,eAAe;wBACf,gBAAgB;wBAChB,aAAa;wBACb,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,qBAAqB;wBACrB,eAAe;AAChB,qBAAA;iBACF,CAAA;;;AC/BD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"propmix-profet-common-header.mjs","sources":["../../../projects/common-header/src/lib/api-endpoints.def.ts","../../../projects/common-header/src/lib/api-gateway.service.ts","../../../projects/common-header/src/lib/utils/HeaderConfig.ts","../../../projects/common-header/src/lib/common-header.service.ts","../../../projects/common-header/src/lib/header/header.component.ts","../../../projects/common-header/src/lib/header/header.component.html","../../../projects/common-header/src/lib/common-header.module.ts","../../../projects/common-header/src/public-api.ts","../../../projects/common-header/src/propmix-profet-common-header.ts"],"sourcesContent":["export class EndPoints {\n public static API_URLS = {\n getAppsApi: '/api/company/getALlApplications',\n getCompanyApplications: '/api/company/getCompanyApplications',\n getUserCompanies: '/api/profile/getUserCompanies',\n updateUserCompany: '/api/company/updateUserCompany'\n }\n}","import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Observable } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiGatewayService {\n private _http = inject(HttpClient);\n \n doGet(url: string, config?: any): Observable<any> {\n return new Observable(observer => {\n if (!config) {\n config = {\n isLoaderHidden: false\n };\n };\n let headers:any;\n if(config.isUnauthorized){\n headers = {\n skip: \"true\"\n }\n }\n \n // this._loaderService.requestStarted(config);\n this._http\n .get(url,{headers: headers})\n .subscribe({\n next: (data) => {\n // this._loaderService.requestEnded();\n observer.next(data);\n observer.complete();\n },\n error: (error) => {\n // this.handleError(error, config, observer);\n }\n });\n })\n }\n doPost(url: string, req_body?: any): Observable<any> {\n return new Observable(observer => {\n let headers:any;\n this._http\n .post(url, req_body,{headers: headers})\n .subscribe({\n next: (data) => {\n if (data && data.hasOwnProperty('status')) {\n observer.next(data);\n observer.complete();\n } else {\n observer.next(data);\n observer.complete();\n }\n },\n error: (error:any) => {\n // this.handleError(error, config, observer);\n }\n })\n });\n }\n}\n","export class HeaderConfig {\n apiUrl: string = '';\n}","import { HttpClient } from '@angular/common/http';\nimport { Inject, Injectable, inject } from '@angular/core';\nimport { HeaderConfig } from './utils/HeaderConfig';\nimport { EndPoints } from './api-endpoints.def';\nimport { ApiGatewayService } from './api-gateway.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CommonHeaderService {\n private baseUrl: string = '';\n private _apiGatewayService = inject(ApiGatewayService);\n constructor(@Inject('headerConfig') private config: HeaderConfig) { \n this.baseUrl = this.config.apiUrl;\n }\n\n getApps() {\n let url = `${this.baseUrl + EndPoints.API_URLS.getAppsApi}`;\n return this._apiGatewayService.doGet(url);\n }\n getCompanyApplications() {\n let url = `${this.baseUrl + EndPoints.API_URLS.getCompanyApplications}`;\n return this._apiGatewayService.doGet(url);\n }\n getUserCompanies() {\n let url = `${this.baseUrl + EndPoints.API_URLS.getUserCompanies}`;\n return this._apiGatewayService.doGet(url);\n }\n updateUserCompany(reqBody: any) {\n let url = `${this.baseUrl + EndPoints.API_URLS.updateUserCompany}`;\n return this._apiGatewayService.doPost(url, reqBody);\n }\n}\n","import { Component, OnInit, inject, ViewChild, ViewEncapsulation, Input, Output, EventEmitter, TemplateRef } from '@angular/core';\nimport { CommonHeaderService } from '../common-header.service';\nimport { MatSidenav } from '@angular/material/sidenav';\nimport { Router } from '@angular/router';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { UserDetails } from '../utils/UserDetails';\nimport { Auth } from 'aws-amplify';\n\n@Component({\n selector: 'lib-header',\n templateUrl: './header.component.html',\n styleUrls: ['./header.component.css'],\n encapsulation: ViewEncapsulation.None\n})\nexport class HeaderComponent implements OnInit{\n \n username: string = '';\n @Input() template!: TemplateRef<any>;\n @Output() menuEvent = new EventEmitter<any>();\n sidenav!: MatSidenav;\n appList: Array<any> = [];\n userCompanies: any;\n showSwitchCompanies: boolean = false;\n private _router = inject(Router);\n private _snackbar = inject(MatSnackBar);\n private _ser = inject(CommonHeaderService);\n\n constructor(){\n // console.log('ver => 2.0.0')\n }\n\n ngOnInit(): void {\n this._ser.getApps().subscribe({\n next: (v) => {\n if(v?.data?.applications && v.data.applications.length > 0){\n this.fetchCompanyData(v.data.applications);\n }\n },\n error: (e) => {\n console.log(e)\n }\n });\n Auth.currentAuthenticatedUser().then(user => {\n this.username = user.attributes.given_name;\n })\n .catch(() => console.log(\"User not logged in\"));\n this.getUserCompany();\n }\n\n fetchCompanyData(allApps:Array<any>) {\n this._ser.getCompanyApplications().subscribe({\n next: (v) => {\n if (v?.data.enabledApplications) {\n this.appList = [];\n let appInfo = [];\n let fetchedApplications = v.data.enabledApplications.split(',');\n\n if (fetchedApplications.length > 0) {\n fetchedApplications.forEach((element:any) => {\n appInfo = allApps.filter(ele => ele.name == element);\n if (appInfo && appInfo.length > 0) {\n if(appInfo[0].name != 'mca'){\n this.appList.push({\n name: appInfo[0].displayName,\n value: element,\n appUrl: appInfo[0].appUrl\n });\n }\n }\n });\n }\n }\n\n }\n })\n }\n\n getUserCompany(){\n this._ser.getUserCompanies().subscribe({\n next: (userCompaniesData: any) => {\n if (userCompaniesData && userCompaniesData.data && userCompaniesData.data.companies) {\n this.userCompanies = userCompaniesData.data.companies;\n if (this.userCompanies.length > 1) {\n this.showSwitchCompanies = true;\n }\n }\n },\n error: (e) => {\n console.log(\"Error in fetching companies for the user\");\n }\n })\n }\n\n appRedirect(app:any) {\n // if (app.name != 'Order Management') {\n window.open(app.appUrl, \"_self\");\n // }\n }\n profile() {\n // this.fetchUserData();\n this._router.navigateByUrl('/app/profile');\n }\n onLogoutClick() {\n Auth.signOut({ global: true })\n .then(data => console.log(data))\n .catch(err => {\n console.log(err)\n Auth.signOut();\n });\n }\n switchCompany(company: any) {\n // switch the user to the selectec company\n let req = { companyKey: company.companyKey };\n this._ser.updateUserCompany(req).subscribe({\n next: (response: any) => {\n if (response && response.type && response.type == \"OK\") {\n // refresh the current page to reload the contents based on the current company\n window.location.reload();\n }\n else {\n // display a message to the user that the company could not be switched.\n this._snackbar.open('Company could not be switched. Please try again or contact support.', 'OK', { duration: 5000 })\n }\n },\n error: (e) => {\n // display a message to the user that the company could not be switched.\n this._snackbar.open('Company could not be switched. Please try again or contact support.', 'OK', { duration: 5000 })\n }\n })\n }\n menuAction(){\n this.menuEvent.emit();\n }\n}\n","<mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <ng-container *ngIf=\"template\" [ngTemplateOutlet]=\"template\"></ng-container>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"username\" class=\"xsHiddenUsername mb-0\">{{username}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"username\" class=\"xsShowUsername\">{{username}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n</mat-toolbar>","import { NgModule } from '@angular/core';\nimport { HeaderComponent } from './header/header.component';\nimport {MatToolbarModule} from '@angular/material/toolbar';\nimport {MatIconModule} from '@angular/material/icon'\nimport { HttpClientModule } from '@angular/common/http';\nimport {MatButtonModule} from '@angular/material/button'\nimport {MatSidenavModule} from '@angular/material/sidenav';\nimport {MatMenuModule} from '@angular/material/menu';\nimport { CommonModule } from '@angular/common';\nimport { MatSnackBarModule } from \"@angular/material/snack-bar\";\n\n@NgModule({\n declarations: [\n HeaderComponent\n ],\n imports: [\n CommonModule,\n MatToolbarModule,\n MatIconModule,\n HttpClientModule,\n MatButtonModule,\n MatSidenavModule,\n MatMenuModule,\n MatSnackBarModule\n ],\n exports: [\n HeaderComponent\n ]\n})\nexport class CommonHeaderModule { }\n","/*\n * Public API Surface of common-header\n */\n\nexport * from './lib/common-header.service';\nexport * from './lib/common-header.module';\nexport * from './lib/header/header.component';\nexport * from './lib/utils/HeaderConfig';\nexport * from './lib/utils/UserDetails';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;MAAa,SAAS,CAAA;;AACJ,SAAA,CAAA,QAAQ,GAAG;AACrB,IAAA,UAAU,EAAE,iCAAiC;AAC7C,IAAA,sBAAsB,EAAE,qCAAqC;AAC7D,IAAA,gBAAgB,EAAE,+BAA+B;AACjD,IAAA,iBAAiB,EAAE,gCAAgC;CACtD;;MCCQ,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;KAoDpC;IAlDC,KAAK,CAAC,GAAW,EAAE,MAAY,EAAA;AAC7B,QAAA,OAAO,IAAI,UAAU,CAAC,QAAQ,IAAG;YAC/B,IAAI,CAAC,MAAM,EAAE;AACX,gBAAA,MAAM,GAAG;AACP,oBAAA,cAAc,EAAE,KAAK;iBACtB,CAAC;AACH,aAAA;YAAA,CAAC;AACF,YAAA,IAAI,OAAW,CAAC;YAChB,IAAG,MAAM,CAAC,cAAc,EAAC;AACvB,gBAAA,OAAO,GAAG;AACR,oBAAA,IAAI,EAAE,MAAM;iBACb,CAAA;AACF,aAAA;;AAGD,YAAA,IAAI,CAAC,KAAK;iBACP,GAAG,CAAC,GAAG,EAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;AAC3B,iBAAA,SAAS,CAAC;AACT,gBAAA,IAAI,EAAE,CAAC,IAAI,KAAI;;AAEb,oBAAA,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACpB,QAAQ,CAAC,QAAQ,EAA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B;QAChB,aAAa;QACb,gBAAgB;QAChB,eAAe;QACf,gBAAgB;QAChB,aAAa;QACb,iBAAiB,aAGjB,eAAe,CAAA,EAAA,CAAA,CAAA;AAGN,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAb3B,YAAY;QACZ,gBAAgB;QAChB,aAAa;QACb,gBAAgB;QAChB,eAAe;QACf,gBAAgB;QAChB,aAAa;QACb,iBAAiB,CAAA,EAAA,CAAA,CAAA;4FAMR,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAlB9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,eAAe;AAChB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,gBAAgB;wBAChB,aAAa;wBACb,gBAAgB;wBAChB,eAAe;wBACf,gBAAgB;wBAChB,aAAa;wBACb,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,eAAe;AAChB,qBAAA;iBACF,CAAA;;;AC5BD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,17 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injectable, Inject, Component, EventEmitter, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
2
+ import { inject, Injectable, Inject, EventEmitter, Component, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
3
3
  import { HttpClient, HttpClientModule } from '@angular/common/http';
4
4
  import { Observable } from 'rxjs';
5
5
  import { Router } from '@angular/router';
6
6
  import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
7
7
  import { Auth } from 'aws-amplify';
8
- import * as i2 from '@angular/common';
8
+ import * as i1 from '@angular/common';
9
9
  import { CommonModule } from '@angular/common';
10
- import * as i3 from '@angular/material/toolbar';
10
+ import * as i2 from '@angular/material/toolbar';
11
11
  import { MatToolbarModule } from '@angular/material/toolbar';
12
- import * as i4 from '@angular/material/button';
12
+ import * as i3 from '@angular/material/button';
13
13
  import { MatButtonModule } from '@angular/material/button';
14
- import * as i5 from '@angular/material/menu';
14
+ import * as i4 from '@angular/material/menu';
15
15
  import { MatMenuModule } from '@angular/material/menu';
16
16
  import { MatIconModule } from '@angular/material/icon';
17
17
  import { MatSidenavModule } from '@angular/material/sidenav';
@@ -101,13 +101,8 @@ class CommonHeaderService {
101
101
  this.config = config;
102
102
  this.baseUrl = '';
103
103
  this._apiGatewayService = inject(ApiGatewayService);
104
- console.log('version =>1.0.14');
105
104
  this.baseUrl = this.config.apiUrl;
106
105
  }
107
- // getUserInfo() {
108
- // let url = `${this.baseUrl}/api/users/fetchLoggedInUsers`;
109
- // return this._http.get(url);
110
- // }
111
106
  getApps() {
112
107
  let url = `${this.baseUrl + EndPoints.API_URLS.getAppsApi}`;
113
108
  return this._apiGatewayService.doGet(url);
@@ -137,55 +132,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
137
132
  args: ['headerConfig']
138
133
  }] }]; } });
139
134
 
140
- class CommonHeaderComponent {
141
- }
142
- CommonHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
143
- CommonHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CommonHeaderComponent, selector: "lib-common-header", ngImport: i0, template: `
144
- <p>
145
- common-header works!
146
- </p>
147
- `, isInline: true });
148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderComponent, decorators: [{
149
- type: Component,
150
- args: [{ selector: 'lib-common-header', template: `
151
- <p>
152
- common-header works!
153
- </p>
154
- ` }]
155
- }] });
156
-
157
135
  class HeaderComponent {
158
- constructor(_ser) {
159
- this._ser = _ser;
136
+ constructor() {
137
+ this.username = '';
160
138
  this.menuEvent = new EventEmitter();
161
139
  this.appList = [];
162
140
  this.showSwitchCompanies = false;
163
141
  this._router = inject(Router);
164
142
  this._snackbar = inject(MatSnackBar);
143
+ this._ser = inject(CommonHeaderService);
144
+ // console.log('ver => 2.0.0')
165
145
  }
166
146
  ngOnInit() {
167
147
  this._ser.getApps().subscribe({
168
148
  next: (v) => {
169
- console.log('from lib', v);
170
149
  if (v?.data?.applications && v.data.applications.length > 0) {
171
150
  this.fetchCompanyData(v.data.applications);
172
151
  }
173
152
  },
174
153
  error: (e) => {
175
- console.log('from lib errrr', e);
154
+ console.log(e);
176
155
  }
177
156
  });
157
+ Auth.currentAuthenticatedUser().then(user => {
158
+ this.username = user.attributes.given_name;
159
+ })
160
+ .catch(() => console.log("User not logged in"));
178
161
  this.getUserCompany();
179
162
  }
180
163
  fetchCompanyData(allApps) {
181
164
  this._ser.getCompanyApplications().subscribe({
182
165
  next: (v) => {
183
- console.log("getCompanyApplications res :", v);
184
166
  if (v?.data.enabledApplications) {
185
167
  this.appList = [];
186
168
  let appInfo = [];
187
169
  let fetchedApplications = v.data.enabledApplications.split(',');
188
- console.log("fetchedapps", fetchedApplications);
189
170
  if (fetchedApplications.length > 0) {
190
171
  fetchedApplications.forEach((element) => {
191
172
  appInfo = allApps.filter(ele => ele.name == element);
@@ -199,7 +180,6 @@ class HeaderComponent {
199
180
  }
200
181
  }
201
182
  });
202
- console.log('apps>>', this.appList);
203
183
  }
204
184
  }
205
185
  }
@@ -261,12 +241,12 @@ class HeaderComponent {
261
241
  this.menuEvent.emit();
262
242
  }
263
243
  }
264
- HeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HeaderComponent, deps: [{ token: CommonHeaderService }], target: i0.ɵɵFactoryTarget.Component });
265
- HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: HeaderComponent, selector: "lib-header", inputs: { userInfo: "userInfo" }, outputs: { menuEvent: "menuEvent" }, ngImport: i0, template: "<!-- <mat-drawer-container autosize>\n <mat-drawer #menudrawer class=\"example-sidenav\" mode=\"over\" (click)=\"sidenav.close()\">\n <div class=\"sidenavPanel\">\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <ul class=\"navbarList\">\n <li><img src=\"../../../assets/images/ordersIcon.png\">Orders</li>\n <li><img src=\"../../../assets/images/panelIcon.png\">Panels</li>\n <li><img src=\"../../../assets/images/scheduleIcon.png\">Fee Schedule</li>\n <li><img src=\"../../../assets/images/settingIcon.png\">Settings</li>\n </ul>\n <span class=\"version\">Version: &nbsp;365b520 | 0.16.0</span>\n </div>\n </mat-drawer> -->\n\n\n\n <mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <button color=\"primary\" mat-stroked-button class=\"btnCreateOrder me-2\"><img class=\"me-2\" src=\"../assets/images/file_upload_icon.svg\" width=\"20px\">Create Order</button>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"userInfo && userInfo.name\" class=\"xsHiddenUsername mb-0\">{{userInfo.name}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"userInfo && userInfo.name\" class=\"xsShowUsername\">{{userInfo.name}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n\n\n <!-- <button mat-icon-button class=\"example-icon favorite-icon\" aria-label=\"Example icon-button with heart icon\">\n <mat-icon>favorite</mat-icon>\n </button>\n <button mat-icon-button class=\"example-icon\" aria-label=\"Example icon-button with share icon\">\n <mat-icon>share</mat-icon>\n </button> -->\n </mat-toolbar>\n<!-- </mat-drawer-container> -->", styles: ["@import\"~@angular/material/prebuilt-themes/indigo-pink.css\";.profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{width:40px}mat-toolbar.mat-toolbar.common_header.mat-primary.mat-toolbar-single-row{position:fixed;left:0;top:0;background-color:#fff;height:48px}button.switchButton,button.menuHamberger{padding:8px!important}.sidenavPanel{padding:20px 25px;height:100vh;position:relative}ul.navbarList{padding-left:0;list-style:none;margin-top:40px}ul.navbarList li{color:#666;font-weight:400;margin-bottom:25px;width:170px;cursor:pointer}.active{color:#4177d6!important}ul.navbarList li img{width:23px;margin-right:15px}.accounts_drpmenu{margin-top:.7em}.xsShowUsername{display:none;padding:0 16px;height:48px;line-height:48px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], encapsulation: i0.ViewEncapsulation.None });
244
+ HeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
245
+ HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: HeaderComponent, selector: "lib-header", inputs: { template: "template" }, outputs: { menuEvent: "menuEvent" }, ngImport: i0, template: "<mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <ng-container *ngIf=\"template\" [ngTemplateOutlet]=\"template\"></ng-container>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"username\" class=\"xsHiddenUsername mb-0\">{{username}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"username\" class=\"xsShowUsername\">{{username}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n</mat-toolbar>", styles: ["@import\"~@angular/material/prebuilt-themes/indigo-pink.css\";.profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{width:40px}mat-toolbar.mat-toolbar.common_header.mat-primary.mat-toolbar-single-row{position:fixed;left:0;top:0;background-color:#fff;height:48px}button.switchButton,button.menuHamberger{padding:8px!important}.sidenavPanel{padding:20px 25px;height:100vh;position:relative}ul.navbarList{padding-left:0;list-style:none;margin-top:40px}ul.navbarList li{color:#666;font-weight:400;margin-bottom:25px;width:170px;cursor:pointer}.active{color:#4177d6!important}ul.navbarList li img{width:23px;margin-right:15px}.accounts_drpmenu{margin-top:.7em}.xsShowUsername{display:none;padding:0 16px;height:48px;line-height:48px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], encapsulation: i0.ViewEncapsulation.None });
266
246
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HeaderComponent, decorators: [{
267
247
  type: Component,
268
- args: [{ selector: 'lib-header', encapsulation: ViewEncapsulation.None, template: "<!-- <mat-drawer-container autosize>\n <mat-drawer #menudrawer class=\"example-sidenav\" mode=\"over\" (click)=\"sidenav.close()\">\n <div class=\"sidenavPanel\">\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <ul class=\"navbarList\">\n <li><img src=\"../../../assets/images/ordersIcon.png\">Orders</li>\n <li><img src=\"../../../assets/images/panelIcon.png\">Panels</li>\n <li><img src=\"../../../assets/images/scheduleIcon.png\">Fee Schedule</li>\n <li><img src=\"../../../assets/images/settingIcon.png\">Settings</li>\n </ul>\n <span class=\"version\">Version: &nbsp;365b520 | 0.16.0</span>\n </div>\n </mat-drawer> -->\n\n\n\n <mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <button color=\"primary\" mat-stroked-button class=\"btnCreateOrder me-2\"><img class=\"me-2\" src=\"../assets/images/file_upload_icon.svg\" width=\"20px\">Create Order</button>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"userInfo && userInfo.name\" class=\"xsHiddenUsername mb-0\">{{userInfo.name}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"userInfo && userInfo.name\" class=\"xsShowUsername\">{{userInfo.name}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n\n\n <!-- <button mat-icon-button class=\"example-icon favorite-icon\" aria-label=\"Example icon-button with heart icon\">\n <mat-icon>favorite</mat-icon>\n </button>\n <button mat-icon-button class=\"example-icon\" aria-label=\"Example icon-button with share icon\">\n <mat-icon>share</mat-icon>\n </button> -->\n </mat-toolbar>\n<!-- </mat-drawer-container> -->", styles: ["@import\"~@angular/material/prebuilt-themes/indigo-pink.css\";.profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{width:40px}mat-toolbar.mat-toolbar.common_header.mat-primary.mat-toolbar-single-row{position:fixed;left:0;top:0;background-color:#fff;height:48px}button.switchButton,button.menuHamberger{padding:8px!important}.sidenavPanel{padding:20px 25px;height:100vh;position:relative}ul.navbarList{padding-left:0;list-style:none;margin-top:40px}ul.navbarList li{color:#666;font-weight:400;margin-bottom:25px;width:170px;cursor:pointer}.active{color:#4177d6!important}ul.navbarList li img{width:23px;margin-right:15px}.accounts_drpmenu{margin-top:.7em}.xsShowUsername{display:none;padding:0 16px;height:48px;line-height:48px}\n"] }]
269
- }], ctorParameters: function () { return [{ type: CommonHeaderService }]; }, propDecorators: { userInfo: [{
248
+ args: [{ selector: 'lib-header', encapsulation: ViewEncapsulation.None, template: "<mat-toolbar color=\"primary\" class=\"common_header shadow-sm\">\n <button mat-icon-button (click)=\"menuAction()\" aria-label=\"main menu\" tabindex=\"0\" class=\"menuHamberger me-4\">\n <img src=\"../assets/images/hamburger_menu.svg\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img src=\"assets/images/Profet_Logo.png\" alt=\"Logo\" style=\"width:140px;\">\n </a>\n <span class=\"example-spacer\"></span>\n <ng-container *ngIf=\"template\" [ngTemplateOutlet]=\"template\"></ng-container>\n <button *ngIf=\"appList.length > 0\" mat-icon-button class=\"me-3 switchButton\" [matMenuTriggerFor]=\"apps\">\n <img src=\"../assets/images/apps.png\" alt=\"apps icon\" style=\"width:20px;height: 20px;\">\n </button>\n <mat-menu #apps=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let app of appList\">\n <button mat-menu-item (click)=\"appRedirect(app)\">{{app.name}}</button>\n </div>\n </mat-menu>\n <div class=\"profile-name\">\n <p *ngIf=\"username\" class=\"xsHiddenUsername mb-0\">{{username}}</p>\n <!--<span class=\"xsHiddenUsername mb-0\" *ngFor=\"let role of userRole\">{{role | formatWord: true:'_'}}</span>-->\n </div>\n <button mat-button [matMenuTriggerFor]=\"menu\">\n <img class=\"avatarLogo\" src=\"../assets/images/dp.png\" alt=\"Avatar Logo\" class=\"avatarLogo rounded-pill\">\n </button>\n <mat-menu #menu=\"matMenu\" class=\"accounts_drpmenu\">\n <span *ngIf=\"username\" class=\"xsShowUsername\">{{username}}</span>\n <button mat-menu-item (click)=\"profile()\">Profile</button>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n <button *ngIf=\"showSwitchCompanies\" mat-menu-item [matMenuTriggerFor]=\"companies\">Switch Company</button>\n <mat-menu #companies=\"matMenu\" class=\"accounts_drpmenu\">\n <div *ngFor=\"let company of userCompanies\">\n <button mat-menu-item (click)=\"switchCompany(company)\">{{company.name}}</button>\n </div>\n </mat-menu>\n </mat-menu>\n</mat-toolbar>", styles: ["@import\"~@angular/material/prebuilt-themes/indigo-pink.css\";.profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{width:40px}mat-toolbar.mat-toolbar.common_header.mat-primary.mat-toolbar-single-row{position:fixed;left:0;top:0;background-color:#fff;height:48px}button.switchButton,button.menuHamberger{padding:8px!important}.sidenavPanel{padding:20px 25px;height:100vh;position:relative}ul.navbarList{padding-left:0;list-style:none;margin-top:40px}ul.navbarList li{color:#666;font-weight:400;margin-bottom:25px;width:170px;cursor:pointer}.active{color:#4177d6!important}ul.navbarList li img{width:23px;margin-right:15px}.accounts_drpmenu{margin-top:.7em}.xsShowUsername{display:none;padding:0 16px;height:48px;line-height:48px}\n"] }]
249
+ }], ctorParameters: function () { return []; }, propDecorators: { template: [{
270
250
  type: Input
271
251
  }], menuEvent: [{
272
252
  type: Output
@@ -275,16 +255,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
275
255
  class CommonHeaderModule {
276
256
  }
277
257
  CommonHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
278
- CommonHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderModule, declarations: [CommonHeaderComponent,
279
- HeaderComponent], imports: [CommonModule,
258
+ CommonHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderModule, declarations: [HeaderComponent], imports: [CommonModule,
280
259
  MatToolbarModule,
281
260
  MatIconModule,
282
261
  HttpClientModule,
283
262
  MatButtonModule,
284
263
  MatSidenavModule,
285
264
  MatMenuModule,
286
- MatSnackBarModule], exports: [CommonHeaderComponent,
287
- HeaderComponent] });
265
+ MatSnackBarModule], exports: [HeaderComponent] });
288
266
  CommonHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CommonHeaderModule, imports: [CommonModule,
289
267
  MatToolbarModule,
290
268
  MatIconModule,
@@ -297,7 +275,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
297
275
  type: NgModule,
298
276
  args: [{
299
277
  declarations: [
300
- CommonHeaderComponent,
301
278
  HeaderComponent
302
279
  ],
303
280
  imports: [
@@ -311,7 +288,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
311
288
  MatSnackBarModule
312
289
  ],
313
290
  exports: [
314
- CommonHeaderComponent,
315
291
  HeaderComponent
316
292
  ]
317
293
  }]
@@ -325,5 +301,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
325
301
  * Generated bundle index. Do not edit.
326
302
  */
327
303
 
328
- export { CommonHeaderComponent, CommonHeaderModule, CommonHeaderService, HeaderComponent, HeaderConfig };
304
+ export { CommonHeaderModule, CommonHeaderService, HeaderComponent, HeaderConfig };
329
305
  //# sourceMappingURL=propmix-profet-common-header.mjs.map