@propmix/profet-common-header 2.0.3-beta-unstable → 2.0.4-beta-unstable

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,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, Injectable, Inject, EventEmitter, Component, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
3
- import { HttpClient, HttpClientModule } from '@angular/common/http';
4
3
  import { Observable, reduce, forkJoin } from 'rxjs';
4
+ import { HttpClient, HttpClientModule } from '@angular/common/http';
5
5
  import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
6
6
  import { DomSanitizer } from '@angular/platform-browser';
7
7
  import { Router } from '@angular/router';
@@ -138,6 +138,7 @@ class HeaderConfig {
138
138
  constructor() {
139
139
  this.apiUrl = '';
140
140
  this.portalFrontendUrl = '';
141
+ this.signOutUrl = '';
141
142
  }
142
143
  }
143
144
 
@@ -145,9 +146,11 @@ class CommonHeaderService {
145
146
  constructor(config) {
146
147
  this.config = config;
147
148
  this.baseUrl = '';
149
+ this.signOutUrl = '';
148
150
  this._apiGatewayService = inject(ApiGatewayService);
149
151
  this.baseUrl = this.config.apiUrl;
150
152
  this.portalFrontendUrl = config.portalFrontendUrl;
153
+ this.signOutUrl = config.signOutUrl;
151
154
  }
152
155
  obtainDataByUrl(url) {
153
156
  return this._apiGatewayService.doGet(url);
@@ -362,11 +365,11 @@ class HeaderComponent {
362
365
  }
363
366
  }
364
367
  onLogoutClick() {
365
- signOut({ global: true, oauth: { preferredSignOutUrl: this.signOutUrl } })
368
+ signOut({ global: true, oauth: { preferredSignOutUrl: this._ser.signOutUrl } })
366
369
  .then(data => console.log(data))
367
370
  .catch(err => {
368
371
  console.log(err);
369
- signOut({ global: true, oauth: { preferredSignOutUrl: this.signOutUrl } });
372
+ signOut({ global: true, oauth: { preferredSignOutUrl: this._ser.signOutUrl } });
370
373
  });
371
374
  }
372
375
  switchCompany(company) {
@@ -399,14 +402,12 @@ class HeaderComponent {
399
402
  }
400
403
  }
401
404
  HeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
402
- HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: HeaderComponent, selector: "lib-header", inputs: { template: "template", signOutUrl: "signOutUrl" }, outputs: { menuEvent: "menuEvent", infoEvent: "infoEvent" }, 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]=\"sanitizeUrl(imageDataUrls.hamburgerMenu)\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img *ngIf=\"companyProfile\" [src]=\"companyProfile.logo\" alt=\"Logo\" style=\"height: 30px;\">\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]=\"sanitizeUrl(imageDataUrls.appsIcon)\" 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)\">\n {{app.name}}\n <img *ngIf=\"app.active\" [src]=\"sanitizeUrl(imageDataUrls.checkIcon)\" alt=\"done icon\"\n style=\"width:18px;height: 18px;margin-left: 5px;\">\n </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]=\"userImageLink?userImageLink:sanitizeUrl(imageDataUrls.defaultUserImage)\"\n 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 *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)\">\n {{company.name}}\n <img *ngIf=\"company.activeNow\" [src]=\"sanitizeUrl(imageDataUrls.checkIcon)\" alt=\"done icon\"\n style=\"width:18px;height: 18px;margin-left: 5px;\">\n </button>\n </div>\n </mat-menu>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n </mat-menu>\n</mat-toolbar>", styles: [".profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{max-width:30px}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 });
405
+ HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: HeaderComponent, selector: "lib-header", inputs: { template: "template" }, outputs: { menuEvent: "menuEvent", infoEvent: "infoEvent" }, 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]=\"sanitizeUrl(imageDataUrls.hamburgerMenu)\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img *ngIf=\"companyProfile\" [src]=\"companyProfile.logo\" alt=\"Logo\" style=\"height: 30px;\">\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]=\"sanitizeUrl(imageDataUrls.appsIcon)\" 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)\">\n {{app.name}}\n <img *ngIf=\"app.active\" [src]=\"sanitizeUrl(imageDataUrls.checkIcon)\" alt=\"done icon\"\n style=\"width:18px;height: 18px;margin-left: 5px;\">\n </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]=\"userImageLink?userImageLink:sanitizeUrl(imageDataUrls.defaultUserImage)\"\n 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 *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)\">\n {{company.name}}\n <img *ngIf=\"company.activeNow\" [src]=\"sanitizeUrl(imageDataUrls.checkIcon)\" alt=\"done icon\"\n style=\"width:18px;height: 18px;margin-left: 5px;\">\n </button>\n </div>\n </mat-menu>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n </mat-menu>\n</mat-toolbar>", styles: [".profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{max-width:30px}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 });
403
406
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HeaderComponent, decorators: [{
404
407
  type: Component,
405
408
  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]=\"sanitizeUrl(imageDataUrls.hamburgerMenu)\" style=\"width: 20px;height: 20px;\">\n </button>\n <a class=\"navbar-brand me-auto\" href=\"#\">\n <img *ngIf=\"companyProfile\" [src]=\"companyProfile.logo\" alt=\"Logo\" style=\"height: 30px;\">\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]=\"sanitizeUrl(imageDataUrls.appsIcon)\" 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)\">\n {{app.name}}\n <img *ngIf=\"app.active\" [src]=\"sanitizeUrl(imageDataUrls.checkIcon)\" alt=\"done icon\"\n style=\"width:18px;height: 18px;margin-left: 5px;\">\n </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]=\"userImageLink?userImageLink:sanitizeUrl(imageDataUrls.defaultUserImage)\"\n 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 *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)\">\n {{company.name}}\n <img *ngIf=\"company.activeNow\" [src]=\"sanitizeUrl(imageDataUrls.checkIcon)\" alt=\"done icon\"\n style=\"width:18px;height: 18px;margin-left: 5px;\">\n </button>\n </div>\n </mat-menu>\n <button mat-menu-item (click)=\"onLogoutClick()\">Logout</button>\n </mat-menu>\n</mat-toolbar>", styles: [".profile-name{text-align:end;color:#000}.profile-name span{font-size:12px;color:#9e9e9ede}.avatarLogo{max-width:30px}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"] }]
406
409
  }], ctorParameters: function () { return []; }, propDecorators: { template: [{
407
410
  type: Input
408
- }], signOutUrl: [{
409
- type: Input
410
411
  }], menuEvent: [{
411
412
  type: Output
412
413
  }], infoEvent: [{