ngx-sp-auth 4.6.10 → 4.6.12

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.
@@ -1584,7 +1584,6 @@ class MenuServicesService {
1584
1584
  this._customEnvironmentService = _customEnvironmentService;
1585
1585
  this._BASE_URL = ""; // SpInfra2ErpWS
1586
1586
  this._BASE_URL_VERSION_INFRA = ""; // SpInfra2VersionCore
1587
- this._BASE_URL_VERSION_CORPORATIVO = ""; // SpCrp2Version
1588
1587
  this._HTTP_HEADERS = new HttpHeaders().set('Content-Type', 'application/json');
1589
1588
  // #endregion Menu Dinâmico
1590
1589
  // #endregion ==========> SERVICES <==========
@@ -1597,8 +1596,6 @@ class MenuServicesService {
1597
1596
  this._BASE_URL = !this._customEnvironmentService.production ? this._BASE_URL : `${this._customEnvironmentService.SpInfra2ErpWS}`;
1598
1597
  this._BASE_URL_VERSION_INFRA = `${this._customEnvironmentService.SpInfra2AuthWS.replace('SpInfra2AuthWS', 'SpInfra2VersionCoreWS')}`; // SpInfra2VersionCoreWS
1599
1598
  this._BASE_URL_VERSION_INFRA = !this._customEnvironmentService.production ? this._BASE_URL_VERSION_INFRA : `${this._customEnvironmentService.SpInfra2AuthWS.replace('SpInfra2AuthWS', 'SpInfra2VersionCoreWS')}`;
1600
- this._BASE_URL_VERSION_CORPORATIVO = `${this._customEnvironmentService.SpInfra2AuthWS.replace('/Infra', '/Corporativo').replace('SpInfra2AuthWS', 'SpCrp2VersionWS')}`; // SpCrp2VersionWS
1601
- this._BASE_URL_VERSION_CORPORATIVO = !this._customEnvironmentService.production ? this._BASE_URL_VERSION_CORPORATIVO : `${this._customEnvironmentService.SpInfra2AuthWS.replace('/Infra', '/Corporativo').replace('SpInfra2AuthWS', 'SpCrp2VersionWS')}`;
1602
1599
  }
1603
1600
  // #region ==========> SERVICES <==========
1604
1601
  // #region PREPARATION
@@ -1661,26 +1658,7 @@ class MenuServicesService {
1661
1658
  }
1662
1659
  // #endregion Get Usuario Email
1663
1660
  // #region Menu: Version
1664
- getVersionInfra() {
1665
- const url = `${this._BASE_URL_VERSION_INFRA}/Version/GetVersion`;
1666
- return this._httpClient
1667
- .get(url, { 'headers': this._HTTP_HEADERS })
1668
- .pipe(take(1), tap(response => {
1669
- if (response.Error) {
1670
- throw Error(response.ErrorMessage);
1671
- }
1672
- }));
1673
- }
1674
- getVersionCorporativo() {
1675
- const url = `${this._BASE_URL_VERSION_CORPORATIVO}/Version/GetVersion`;
1676
- return this._httpClient
1677
- .get(url, { 'headers': this._HTTP_HEADERS })
1678
- .pipe(take(1), tap(response => {
1679
- if (response.Error) {
1680
- throw Error(response.ErrorMessage);
1681
- }
1682
- }));
1683
- }
1661
+ /** Busca a versão base da Infra dentro do mesmo servidor. */
1684
1662
  getVersionBase() {
1685
1663
  const url = `${this._BASE_URL_VERSION_INFRA}/Version/base`;
1686
1664
  return this._httpClient.get(url, { 'headers': this._HTTP_HEADERS })
@@ -1690,6 +1668,7 @@ class MenuServicesService {
1690
1668
  }
1691
1669
  }));
1692
1670
  }
1671
+ /** Busca as versões dos módulos instalados e disponíveis dentro do mesmo servidor. */
1693
1672
  getVersionModulos() {
1694
1673
  const url = `${this._BASE_URL_VERSION_INFRA}/Version/modulos`;
1695
1674
  return this._httpClient.get(url, { 'headers': this._HTTP_HEADERS })
@@ -3360,30 +3339,29 @@ class VersoesModalComponent {
3360
3339
  next: response => this.versionBase = response.Data,
3361
3340
  error: error => this._authUtils.showHttpError(error)
3362
3341
  });
3363
- // Versão do Corporativo
3364
- // TODO: Excluir
3365
- this._menuService.getVersionCorporativo().subscribe({
3366
- next: response => this.versionCorporativo = response.Version,
3367
- error: error => this._authUtils.showHttpError(error)
3368
- });
3369
3342
  // Versão dos Módulos
3370
3343
  this._menuService.getVersionModulos().subscribe({
3371
3344
  next: response => {
3372
3345
  console.log(response);
3373
- this.versions = response.Data;
3346
+ // Deve formatar as versões que forem 0 converter para "Base"
3347
+ this.versions = response.Data?.map(e => {
3348
+ if (e.Versao === '0')
3349
+ return { Projeto: e.Projeto, Versao: "Base" };
3350
+ else
3351
+ return { Projeto: e.Projeto, Versao: e.Versao };
3352
+ });
3374
3353
  },
3375
3354
  error: error => this._authUtils.showHttpError(error)
3376
3355
  });
3377
3356
  }
3378
3357
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: VersoesModalComponent, deps: [{ token: MenuServicesService }, { token: AuthUtilService }], target: i0.ɵɵFactoryTarget.Component }); }
3379
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: VersoesModalComponent, isStandalone: true, selector: "versoes-modal", outputs: { onClose: "onClose" }, ngImport: i0, template: "<div class=\"main-container\">\n <div class=\"modal-header modal-style modal-dialog-centered modal-lg\">\n <h4 class=\"modal-title pull-left color-modal fw-bold\" style=\"font-size: 20px;\"> Vers\u00E3o atual: {{ versionBase }} </h4>\n <button (click)=\"closeSelf()\" type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <p>Patches dos m\u00F3dulos espec\u00EDficos:</p>\n\n <ul class=\"p-0\">\n @for (versao of versions; track versao.Projeto) {\n <li>\n <span class=\"fw-bold\">{{ versao.Projeto }} | <a type=\"button\" class=\"text-decoration-none text-primary fw-bold\" tooltip=\"Clique aqui para acessar o que mudou nesta vers\u00E3o\" [href]=\"releaseNotesUrl+'/versoes/'+versionBase+'/'+versao.Projeto\" target=\"_blank\" >{{ versionBase + '.' + versao.Versao }} <lib-icon iconName=\"acessoexterno\" iconSize=\"small\" /> </a></span>\n </li>\n }\n </ul>\n\n <p class=\"mb-0 mt-3\">Acesse as release notes de todas as vers\u00F5es do ERP <a [href]=\"releaseNotesUrl\" target=\"_blank\" class=\"fw-bold text-decoration-none text-primary\">clicando aqui</a> </p>\n </div>\n</div>", styles: ["ul{list-style-type:none!important}\n"], dependencies: [{ kind: "ngmodule", type: InfraModule }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }, { kind: "ngmodule", type: CommonModule }] }); }
3358
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: VersoesModalComponent, isStandalone: true, selector: "versoes-modal", outputs: { onClose: "onClose" }, ngImport: i0, template: "<div class=\"main-container\">\n <div class=\"modal-header modal-style modal-dialog-centered modal-lg\">\n <h4 class=\"modal-title pull-left color-modal fw-bold\" style=\"font-size: 20px;\"> Vers\u00E3o atual: {{ versionBase }} </h4>\n <button (click)=\"closeSelf()\" type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <p>Patches dos m\u00F3dulos espec\u00EDficos:</p>\n\n <ul class=\"p-0\">\n @for (versao of versions; track versao.Projeto) {\n <li>\n <span class=\"fw-bold\">{{ versao.Projeto }} | <a type=\"button\" class=\"text-decoration-none text-primary fw-bold\" tooltip=\"Clique aqui para acessar o que mudou nesta vers\u00E3o\" [href]=\"releaseNotesUrl+'/versoes/'+versionBase+'/'+versao.Projeto\" target=\"_blank\" >{{ versionBase + '.' + versao.Versao }} <lib-icon iconName=\"acessoexterno\" iconSize=\"small\" /> </a></span>\n </li>\n }\n </ul>\n\n <p class=\"mb-0 mt-3\">Acesse as release notes de todas as vers\u00F5es do ERP <a [href]=\"releaseNotesUrl\" target=\"_blank\" class=\"fw-bold text-decoration-none text-primary\">clicando aqui</a> </p>\n </div>\n</div>", styles: ["ul{list-style-type:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: InfraModule }, { kind: "component", type: i3.LibIconsComponent, selector: "lib-icon", inputs: ["iconName", "iconColor", "iconSize", "iconFill"] }] }); }
3380
3359
  }
3381
3360
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: VersoesModalComponent, decorators: [{
3382
3361
  type: Component,
3383
3362
  args: [{ selector: 'versoes-modal', imports: [
3384
- InfraModule,
3385
- RouterLink,
3386
3363
  CommonModule,
3364
+ InfraModule,
3387
3365
  ], template: "<div class=\"main-container\">\n <div class=\"modal-header modal-style modal-dialog-centered modal-lg\">\n <h4 class=\"modal-title pull-left color-modal fw-bold\" style=\"font-size: 20px;\"> Vers\u00E3o atual: {{ versionBase }} </h4>\n <button (click)=\"closeSelf()\" type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <p>Patches dos m\u00F3dulos espec\u00EDficos:</p>\n\n <ul class=\"p-0\">\n @for (versao of versions; track versao.Projeto) {\n <li>\n <span class=\"fw-bold\">{{ versao.Projeto }} | <a type=\"button\" class=\"text-decoration-none text-primary fw-bold\" tooltip=\"Clique aqui para acessar o que mudou nesta vers\u00E3o\" [href]=\"releaseNotesUrl+'/versoes/'+versionBase+'/'+versao.Projeto\" target=\"_blank\" >{{ versionBase + '.' + versao.Versao }} <lib-icon iconName=\"acessoexterno\" iconSize=\"small\" /> </a></span>\n </li>\n }\n </ul>\n\n <p class=\"mb-0 mt-3\">Acesse as release notes de todas as vers\u00F5es do ERP <a [href]=\"releaseNotesUrl\" target=\"_blank\" class=\"fw-bold text-decoration-none text-primary\">clicando aqui</a> </p>\n </div>\n</div>", styles: ["ul{list-style-type:none!important}\n"] }]
3388
3366
  }], ctorParameters: () => [{ type: MenuServicesService }, { type: AuthUtilService }], propDecorators: { onClose: [{
3389
3367
  type: Output