ngx-sp-auth 4.22.5 → 4.22.6

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.
@@ -1598,7 +1598,7 @@ class MenuServicesService {
1598
1598
  // #region NewImg Event
1599
1599
  // Implementação de lógica vista no link: https://hasangalakdinu.medium.com/how-to-call-a-function-in-another-component-angular-using-rxjs-3f2e85920705
1600
1600
  this._subject = new Subject();
1601
- this._BASE_URL = `${this._customEnvironmentService.SpInfra2ErpWS}`; // SpInfra2ErpWS
1601
+ this._BASE_URL = `${this._customEnvironmentService.Sp2LocalhostWS}`; // SpInfra2ErpWS
1602
1602
  this._BASE_URL = !this._customEnvironmentService.production ? this._BASE_URL : `${this._customEnvironmentService.SpInfra2ErpWS}`;
1603
1603
  this._BASE_URL_VERSION_INFRA = `${this._customEnvironmentService.SpInfra2AuthWS.replace('SpInfra2AuthWS', 'SpInfra2VersionWS')}`; // SpInfra2VersionWS
1604
1604
  this._BASE_URL_VERSION_INFRA = !this._customEnvironmentService.production ? this._BASE_URL_VERSION_INFRA : `${this._customEnvironmentService.SpInfra2AuthWS.replace('SpInfra2AuthWS', 'SpInfra2VersionWS')}`;
@@ -1819,6 +1819,13 @@ class MenuServicesService {
1819
1819
  }
1820
1820
  }));
1821
1821
  }
1822
+ /** Método executado para pegar o HostName de direcionamento para a V6. */
1823
+ GetHostServerV6() {
1824
+ const url = `${this._BASE_URL}/Menu/GetHostServerV6`;
1825
+ return this._httpClient.get(url, { headers: this._HTTP_HEADERS })
1826
+ .pipe(take(1), tap((response) => { if (response.Error)
1827
+ throw Error(response.ErrorMessage); }));
1828
+ }
1822
1829
  /**
1823
1830
  * **ESTE MÉTODO FOI DUPLICADO DO MÉTODO `GetHostServerOutSystems` PARA SER UTILIZADO DE FORMA ASSÍNCRONA, SEM *OBSERVABLE*, PARA EVITAR PROBLEMAS DE SINCRONIA NA CONSTRUÇÃO DO MENU DINÂMICO.**
1824
1831
  *
@@ -4760,20 +4767,32 @@ class SubMenuCardComponent {
4760
4767
  // #region ==========> PROPERTIES <==========
4761
4768
  // #region PUBLIC
4762
4769
  this.subMenuCards = [];
4763
- this.hostName = "";
4764
- this.getExternalUrl = (url, isOutroModulo) => { return (isOutroModulo ? `${this.hostName}/SisproErpCloud/${url}` : `${this.hostName == "" ? `https://${window.location.host}` : this.hostName}/${url}`); };
4770
+ this.hostnameOS = "";
4771
+ this.hostnameV6 = "";
4772
+ this.getOutroModuloUrl = (url) => { return !this.hostnameV6.startsWith('https://') ? `https://${this.hostnameV6}/SisproErpCloud/${url}` : `${this.hostnameV6}/SisproErpCloud/${url}`; };
4773
+ this.getOutsystemsUrl = (url, isOutroModulo) => { return (isOutroModulo ? `${this.hostnameOS}/SisproErpCloud/${url}` : `${this.hostnameOS == "" ? `https://${window.location.host}` : this.hostnameOS}/${url}`); };
4765
4774
  }
4766
4775
  ngOnInit() {
4767
- this.GetHostName();
4776
+ this.GetHostNameOS();
4777
+ this.GetHostNameV6();
4768
4778
  }
4769
4779
  // #region ==========> API METHODS <==========
4770
4780
  // #region GET
4771
- GetHostName() {
4781
+ GetHostNameOS() {
4772
4782
  // Validação adicionada para ignorar esta chamada caso o componente seja exibido na docs
4773
4783
  if (this._customEnv.product === "InfraCodeDocs")
4774
4784
  return;
4775
4785
  this._menuService.GetHostServerOutSystems().subscribe({
4776
- next: response => this.hostName = response.String,
4786
+ next: response => this.hostnameOS = response.String,
4787
+ error: error => this._authUtilService.showHttpError(error)
4788
+ });
4789
+ }
4790
+ GetHostNameV6() {
4791
+ // Validação adicionada para ignorar esta chamada caso o componente seja exibido na docs
4792
+ if (this._customEnv.product === "InfraCodeDocs")
4793
+ return;
4794
+ this._menuService.GetHostServerV6().subscribe({
4795
+ next: response => this.hostnameV6 = response.String,
4777
4796
  error: error => this._authUtilService.showHttpError(error)
4778
4797
  });
4779
4798
  }
@@ -4781,8 +4800,10 @@ class SubMenuCardComponent {
4781
4800
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: SubMenuCardComponent, isStandalone: true, selector: "sub-menu-card, lib-submenu-card", inputs: { subMenuCards: "subMenuCards" }, ngImport: i0, template: `
4782
4801
  <div class="max-card-menu row">
4783
4802
  @for(card of subMenuCards; track $index) {
4784
- @if (card.isExternal || card.is_OutroModulo) {
4785
- <a [href]="getExternalUrl(card.urlPath, card.is_OutroModulo)" target="_blank" class="card-link col-4">
4803
+
4804
+ <!-- VALIDAÇÃO DE 'IS_EXTERNAL' SIGNIFICA QUE A ROTA É OS -->
4805
+ @if (card.isExternal) {
4806
+ <a [href]="getOutsystemsUrl(card.urlPath, card.is_OutroModulo)" target="_blank" class="card-link col-4">
4786
4807
  <div class="card w-100 border-0 rounded text-center glb-cursor-pointer">
4787
4808
  <div class="card-icon">
4788
4809
  <div class="card-icon2">
@@ -4795,8 +4816,24 @@ class SubMenuCardComponent {
4795
4816
  </div>
4796
4817
  </a>
4797
4818
  }
4819
+ <!-- VALIDAÇÃO DE 'IS_OUTROMODULO' SIGNIFICA QUE A ROTA É V6 PORÉM DE OUTRO PROJETO FRONTEND -->
4820
+ @else if (card.is_OutroModulo) {
4821
+ <a [href]="getOutroModuloUrl(card.urlPath)" target="_blank" class="card-link col-4">
4822
+ <div class="card w-100 border-0 rounded text-center glb-cursor-pointer">
4823
+ <div class="card-icon">
4824
+ <div class="card-icon2">
4825
+ <lib-icon class="bold" [iconName]="card.icon ? card.icon : 'engrenagem'" iconColor="blue" [iconSize]="35" />
4826
+ </div>
4827
+ </div>
4828
+
4829
+ <h3 class="card-title">{{ card.titulo }}</h3>
4830
+ <p class="card-text" [title]="card.descricao"> {{ card.descricao }} </p>
4831
+ </div>
4832
+ </a>
4833
+ }
4834
+ <!-- CASO CONTRÁRIO DE TUDO SIGNIFICA QUE A ROTA É V6 E DENTRO DO MESMO MÓDULO -->
4798
4835
  @else {
4799
- <a [routerLink]="[ '/'+card.urlPath ]" class="card-link col-4">
4836
+ <a routerLink="/{{ card.urlPath }}" class="card-link col-4">
4800
4837
  <div class="card w-100 border-0 rounded text-center glb-cursor-pointer">
4801
4838
  <div class="card-icon">
4802
4839
  <div class="card-icon2">
@@ -4821,8 +4858,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
4821
4858
  ], template: `
4822
4859
  <div class="max-card-menu row">
4823
4860
  @for(card of subMenuCards; track $index) {
4824
- @if (card.isExternal || card.is_OutroModulo) {
4825
- <a [href]="getExternalUrl(card.urlPath, card.is_OutroModulo)" target="_blank" class="card-link col-4">
4861
+
4862
+ <!-- VALIDAÇÃO DE 'IS_EXTERNAL' SIGNIFICA QUE A ROTA É OS -->
4863
+ @if (card.isExternal) {
4864
+ <a [href]="getOutsystemsUrl(card.urlPath, card.is_OutroModulo)" target="_blank" class="card-link col-4">
4865
+ <div class="card w-100 border-0 rounded text-center glb-cursor-pointer">
4866
+ <div class="card-icon">
4867
+ <div class="card-icon2">
4868
+ <lib-icon class="bold" [iconName]="card.icon ? card.icon : 'engrenagem'" iconColor="blue" [iconSize]="35" />
4869
+ </div>
4870
+ </div>
4871
+
4872
+ <h3 class="card-title">{{ card.titulo }}</h3>
4873
+ <p class="card-text" [title]="card.descricao"> {{ card.descricao }} </p>
4874
+ </div>
4875
+ </a>
4876
+ }
4877
+ <!-- VALIDAÇÃO DE 'IS_OUTROMODULO' SIGNIFICA QUE A ROTA É V6 PORÉM DE OUTRO PROJETO FRONTEND -->
4878
+ @else if (card.is_OutroModulo) {
4879
+ <a [href]="getOutroModuloUrl(card.urlPath)" target="_blank" class="card-link col-4">
4826
4880
  <div class="card w-100 border-0 rounded text-center glb-cursor-pointer">
4827
4881
  <div class="card-icon">
4828
4882
  <div class="card-icon2">
@@ -4835,8 +4889,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
4835
4889
  </div>
4836
4890
  </a>
4837
4891
  }
4892
+ <!-- CASO CONTRÁRIO DE TUDO SIGNIFICA QUE A ROTA É V6 E DENTRO DO MESMO MÓDULO -->
4838
4893
  @else {
4839
- <a [routerLink]="[ '/'+card.urlPath ]" class="card-link col-4">
4894
+ <a routerLink="/{{ card.urlPath }}" class="card-link col-4">
4840
4895
  <div class="card w-100 border-0 rounded text-center glb-cursor-pointer">
4841
4896
  <div class="card-icon">
4842
4897
  <div class="card-icon2">