ngx-sp-auth 4.6.3 → 4.6.5

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.
@@ -1583,7 +1583,7 @@ class MenuServicesService {
1583
1583
  this._httpClient = _httpClient;
1584
1584
  this._customEnvironmentService = _customEnvironmentService;
1585
1585
  this._BASE_URL = ""; // SpInfra2ErpWS
1586
- this._BASE_URL_VERSION_INFRA = ""; // SpInfra2Version
1586
+ this._BASE_URL_VERSION_INFRA = ""; // SpInfra2VersionCore
1587
1587
  this._BASE_URL_VERSION_CORPORATIVO = ""; // SpCrp2Version
1588
1588
  this._HTTP_HEADERS = new HttpHeaders().set('Content-Type', 'application/json');
1589
1589
  // #endregion Menu Dinâmico
@@ -1595,8 +1595,8 @@ class MenuServicesService {
1595
1595
  this._subject = new Subject();
1596
1596
  this._BASE_URL = `${this._customEnvironmentService.SpInfra2ErpWS}`; // SpInfra2ErpWS
1597
1597
  this._BASE_URL = !this._customEnvironmentService.production ? this._BASE_URL : `${this._customEnvironmentService.SpInfra2ErpWS}`;
1598
- this._BASE_URL_VERSION_INFRA = `${this._customEnvironmentService.SpInfra2AuthWS.replace('SpInfra2AuthWS', 'SpInfra2VersionWS')}`; // SpInfra2VersionWS
1599
- this._BASE_URL_VERSION_INFRA = !this._customEnvironmentService.production ? this._BASE_URL_VERSION_INFRA : `${this._customEnvironmentService.SpInfra2AuthWS.replace('SpInfra2AuthWS', 'SpInfra2VersionWS')}`;
1598
+ this._BASE_URL_VERSION_INFRA = `${this._customEnvironmentService.SpInfra2AuthWS.replace('SpInfra2AuthWS', 'SpInfra2VersionCoreWS')}`; // SpInfra2VersionCoreWS
1599
+ this._BASE_URL_VERSION_INFRA = !this._customEnvironmentService.production ? this._BASE_URL_VERSION_INFRA : `${this._customEnvironmentService.SpInfra2AuthWS.replace('SpInfra2AuthWS', 'SpInfra2VersionCoreWS')}`;
1600
1600
  this._BASE_URL_VERSION_CORPORATIVO = `${this._customEnvironmentService.SpInfra2AuthWS.replace('/Infra', '/Corporativo').replace('SpInfra2AuthWS', 'SpCrp2VersionWS')}`; // SpCrp2VersionWS
1601
1601
  this._BASE_URL_VERSION_CORPORATIVO = !this._customEnvironmentService.production ? this._BASE_URL_VERSION_CORPORATIVO : `${this._customEnvironmentService.SpInfra2AuthWS.replace('/Infra', '/Corporativo').replace('SpInfra2AuthWS', 'SpCrp2VersionWS')}`;
1602
1602
  }
@@ -1609,11 +1609,9 @@ class MenuServicesService {
1609
1609
  getEstabelecimentosModalList(usuarioID, pesquisa) {
1610
1610
  const params = new HttpParams()
1611
1611
  .set('pesquisa', pesquisa);
1612
- const headers = new HttpHeaders()
1613
- .set('Content-Type', 'application/json');
1614
1612
  const url = `${this._BASE_URL}/InfraEstabelecimento/GetEstabelecimentosModal`;
1615
1613
  return this._httpClient
1616
- .get(url, { 'params': params, 'headers': headers })
1614
+ .get(url, { 'params': params, 'headers': this._HTTP_HEADERS })
1617
1615
  .pipe(take(1), tap(response => {
1618
1616
  if (response.Error) {
1619
1617
  throw Error(response.ErrorMessage);
@@ -1683,17 +1681,33 @@ class MenuServicesService {
1683
1681
  }
1684
1682
  }));
1685
1683
  }
1684
+ getVersionBase() {
1685
+ const url = `${this._BASE_URL_VERSION_INFRA}/Version/base`;
1686
+ return this._httpClient.get(url, { 'headers': this._HTTP_HEADERS })
1687
+ .pipe(take(1), tap(response => {
1688
+ if (response.Error) {
1689
+ throw Error(response.ErrorMessage);
1690
+ }
1691
+ }));
1692
+ }
1693
+ getVersionModulos() {
1694
+ const url = `${this._BASE_URL_VERSION_INFRA}/Version/modulos`;
1695
+ return this._httpClient.get(url, { 'headers': this._HTTP_HEADERS })
1696
+ .pipe(take(1), tap(response => {
1697
+ if (response.Error) {
1698
+ throw Error(response.ErrorMessage);
1699
+ }
1700
+ }));
1701
+ }
1686
1702
  // #endregion Menu: Version
1687
1703
  // #region Menu: IsMenuAllowed
1688
- /** Método executado para validar a permissão de acesso a uma opção do menu
1689
- */
1704
+ /** Método executado para validar a permissão de acesso a uma opção do menu. */
1690
1705
  isMenuAllowed(route) {
1691
1706
  const params = new HttpParams()
1692
1707
  .set('route', route);
1693
- const headers = new HttpHeaders().set("Content-Type", "application/json");
1694
1708
  const url = `${this._BASE_URL}/Menu/IsMenuAllowed`;
1695
1709
  return this._httpClient
1696
- .get(url, { 'params': params, headers: headers })
1710
+ .get(url, { 'params': params, headers: this._HTTP_HEADERS })
1697
1711
  .pipe(take(1), tap((response) => {
1698
1712
  if (response.Error) {
1699
1713
  throw Error(response.ErrorMessage);
@@ -1735,73 +1749,63 @@ class MenuServicesService {
1735
1749
  // #endregion UPDATE
1736
1750
  // #region Menu Dinâmico
1737
1751
  /** Método executado para pegar o Menu lateral levando em conta as permissões do usuário, grupo e o tenant ativo
1738
- * Executado caso o getter do boolean Menu Dynamic seja true
1752
+ * Executado caso o getter do boolean Menu Dynamic seja true
1739
1753
  */
1740
1754
  getMenuLateral(projetoId) {
1741
- const headers = new HttpHeaders().set("Content-Type", "application/json");
1742
1755
  const url = `${this._BASE_URL}/Menu/GetMenuLateral`;
1743
1756
  const params = new HttpParams()
1744
1757
  .set('projetoId', projetoId);
1745
1758
  return this._httpClient
1746
- .get(url, { params: params, headers: headers })
1759
+ .get(url, { 'params': params, 'headers': this._HTTP_HEADERS })
1747
1760
  .pipe(take(1), tap((response) => {
1748
1761
  if (response.Error) {
1749
1762
  throw Error(response.ErrorMessage);
1750
1763
  }
1751
1764
  }));
1752
1765
  }
1753
- /** Método executado para montar estrutura de título, submenu e telas de acordo com os modelos presentes na ngx-sp-infra
1754
- * envia-se o título deste grupo de submenus, ícone e enum daqueles submenus que
1755
- * ficarão alocados no grupo de determinado título enviado
1766
+ /** Método executado para montar estrutura de título, submenu e telas de acordo com os modelos presentes na **ngx-sp-infra**
1767
+ * envia-se o título deste grupo de submenus, ícone e enum daqueles submenus que
1768
+ * ficarão alocados no grupo de determinado título enviado
1756
1769
  */
1757
1770
  getTelaSubmenus(NavSubmenuSearchItems) {
1758
- const headers = new HttpHeaders()
1759
- .set('Content-Type', 'application/json');
1760
1771
  const url = `${this._BASE_URL}/Menu/GetTelaSubmenus`;
1761
1772
  return this._httpClient
1762
- .post(url, JSON.stringify(NavSubmenuSearchItems), { 'headers': headers })
1773
+ .post(url, JSON.stringify(NavSubmenuSearchItems), { 'headers': this._HTTP_HEADERS })
1763
1774
  .pipe(take(1), tap(response => {
1764
1775
  if (response.Error) {
1765
1776
  throw Error(response.ErrorMessage);
1766
1777
  }
1767
1778
  }));
1768
1779
  }
1769
- /** Método executado para montar estrutura da tela de submenu com os cards baseado no IdUnico do menu acessado em específico
1770
- */
1780
+ /** Método executado para montar estrutura da tela de submenu com os cards baseado no IdUnico do menu acessado em específico. */
1771
1781
  getTelaSubmenusWithCards(MenuIdUnico) {
1772
- const headers = new HttpHeaders()
1773
- .set('Content-Type', 'application/json');
1774
1782
  const url = `${this._BASE_URL}/Menu/GetTelaSubmenusWithCards`;
1775
1783
  const params = new HttpParams()
1776
1784
  .set('MenuIdUnico', MenuIdUnico);
1777
1785
  return this._httpClient
1778
- .get(url, { 'params': params, 'headers': headers })
1786
+ .get(url, { 'params': params, 'headers': this._HTTP_HEADERS })
1779
1787
  .pipe(take(1), tap(response => {
1780
1788
  if (response.Error) {
1781
1789
  throw Error(response.ErrorMessage);
1782
1790
  }
1783
1791
  }));
1784
1792
  }
1785
- /** Método executado para pegar os produtos para monta o MenuDropdown
1786
- */
1793
+ /** Método executado para pegar os produtos para monta o MenuDropdown. */
1787
1794
  getProjects() {
1788
- const headers = new HttpHeaders().set("Content-Type", "application/json");
1789
1795
  const url = `${this._BASE_URL}/Menu/GetProjects`;
1790
1796
  return this._httpClient
1791
- .get(url, { headers: headers })
1797
+ .get(url, { headers: this._HTTP_HEADERS })
1792
1798
  .pipe(take(1), tap((response) => {
1793
1799
  if (response.Error) {
1794
1800
  throw Error(response.ErrorMessage);
1795
1801
  }
1796
1802
  }));
1797
1803
  }
1798
- /** Método executado para pegar o HostName de direcionamento para OS
1799
- */
1804
+ /** Método executado para pegar o HostName de direcionamento para OS. */
1800
1805
  GetHostServerOutSystems() {
1801
- const headers = new HttpHeaders().set("Content-Type", "application/json");
1802
1806
  const url = `${this._BASE_URL}/Menu/GetHostServerOutSystems`;
1803
1807
  return this._httpClient
1804
- .get(url, { headers: headers })
1808
+ .get(url, { headers: this._HTTP_HEADERS })
1805
1809
  .pipe(take(1), tap((response) => {
1806
1810
  if (response.Error) {
1807
1811
  throw Error(response.ErrorMessage);
@@ -1822,12 +1826,8 @@ class MenuServicesService {
1822
1826
  saveImageToStorage(footerImgSrc, footerImgName) {
1823
1827
  this.setMenuFooterImg({ USUARIOID: this._authStorageService.infraUsuarioId, FILENAME: footerImgName, FILE: footerImgSrc });
1824
1828
  }
1825
- newUserImageEvent(value) {
1826
- this._subject.next(value);
1827
- }
1828
- getNewUserImageEvent() {
1829
- return this._subject.asObservable();
1830
- }
1829
+ newUserImageEvent(value) { this._subject.next(value); }
1830
+ getNewUserImageEvent() { return this._subject.asObservable(); }
1831
1831
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MenuServicesService, deps: [{ token: AuthStorageService }, { token: i1.HttpClient }, { token: LibCustomEnvironmentService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1832
1832
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MenuServicesService, providedIn: 'root' }); }
1833
1833
  }
@@ -3326,14 +3326,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
3326
3326
  }] } });
3327
3327
 
3328
3328
  class VersoesModalComponent {
3329
- constructor(_menuServicesService, _authUtilService) {
3330
- this._menuServicesService = _menuServicesService;
3331
- this._authUtilService = _authUtilService;
3329
+ constructor(_menuService, _authUtils) {
3330
+ this._menuService = _menuService;
3331
+ this._authUtils = _authUtils;
3332
3332
  // #region ==========> PROPERTIES <==========
3333
3333
  // #region PUBLIC
3334
3334
  this.onClose = new EventEmitter();
3335
- this.versionInfra = '';
3335
+ this.versionBase = '';
3336
3336
  this.versionCorporativo = '';
3337
+ this.closeSelf = () => { this.onClose.emit(); };
3337
3338
  }
3338
3339
  ngOnInit() {
3339
3340
  this.getVersions();
@@ -3341,50 +3342,49 @@ class VersoesModalComponent {
3341
3342
  get releaseNotesUrl() {
3342
3343
  let url = '';
3343
3344
  if (window.location.host === 'localhost:4200')
3344
- url = "https://siscandesinfra.sispro.com.br/SisproErpCloud/V6ReleaseNotes/home";
3345
+ url = "https://siscandesinfra.sispro.com.br/SisproErpCloud/V6ReleaseNotes";
3345
3346
  else
3346
- url = `https://${window.location.host}/SisproErpCloud/V6ReleaseNotes/home`;
3347
+ url = `https://${window.location.host}/SisproErpCloud/V6ReleaseNotes`;
3347
3348
  return url;
3348
3349
  }
3349
3350
  // #endregion PUBLIC
3350
3351
  // #endregion ==========> PROPERTIES <==========
3351
3352
  // #region ==========> SERVICES <==========
3352
3353
  // #region PREPARATION
3354
+ /** Obtém Versão instalada da Infra e dos outros produtos.
3355
+ *
3356
+ * Este método receberá no futuro uma lista de Versões de produtos cadastrados e listados em ordem.
3357
+ */
3353
3358
  getVersions() {
3354
- // Obtém Versão da Infra
3355
- this._menuServicesService.getVersionInfra().subscribe({
3356
- next: response => {
3357
- this.versionInfra = response.Version;
3358
- },
3359
- error: error => {
3360
- this._authUtilService.showHttpError(error);
3361
- }
3359
+ this._menuService.getVersionBase().subscribe({
3360
+ next: response => this.versionBase = response.Version,
3361
+ error: error => this._authUtils.showHttpError(error)
3362
+ });
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)
3362
3368
  });
3363
- // Obtém Versão do Corporativo
3364
- this._menuServicesService.getVersionCorporativo().subscribe({
3369
+ // Versão dos Módulos
3370
+ this._menuService.getVersionModulos().subscribe({
3365
3371
  next: response => {
3366
- this.versionCorporativo = response.Version;
3372
+ console.log(response);
3373
+ this.versions = response.Data;
3367
3374
  },
3368
- error: error => {
3369
- this._authUtilService.showHttpError(error);
3370
- }
3375
+ error: error => this._authUtils.showHttpError(error)
3371
3376
  });
3372
3377
  }
3373
- // #endregion PREPARATION
3374
- // #endregion ==========> SERVICES <==========
3375
- // #region ==========> MODALS <==========
3376
- closeSelf() {
3377
- this.onClose.emit();
3378
- }
3379
3378
  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 }); }
3380
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.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\u00F5es desta instala\u00E7\u00E3o </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 <div class=\"row\">\n <div class=\"col\">\n <span><strong>Vers\u00E3o Infra:</strong> {{ versionInfra }}</span>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col\">\n <span><strong>Vers\u00E3o Corporativo:</strong> {{ versionCorporativo }}</span>\n </div>\n </div>\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: [""], dependencies: [{ kind: "ngmodule", type: InfraModule }, { kind: "ngmodule", type: CommonModule }] }); }
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\" [routerLink]=\"[ releaseNotesUrl, versionBase, versao.Projeto ]\" >{{ 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: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: CommonModule }] }); }
3381
3380
  }
3382
3381
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: VersoesModalComponent, decorators: [{
3383
3382
  type: Component,
3384
3383
  args: [{ selector: 'versoes-modal', imports: [
3385
3384
  InfraModule,
3386
- CommonModule
3387
- ], 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\u00F5es desta instala\u00E7\u00E3o </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 <div class=\"row\">\n <div class=\"col\">\n <span><strong>Vers\u00E3o Infra:</strong> {{ versionInfra }}</span>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col\">\n <span><strong>Vers\u00E3o Corporativo:</strong> {{ versionCorporativo }}</span>\n </div>\n </div>\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>" }]
3385
+ RouterLink,
3386
+ CommonModule,
3387
+ ], 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\" [routerLink]=\"[ releaseNotesUrl, versionBase, versao.Projeto ]\" >{{ 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
3388
  }], ctorParameters: () => [{ type: MenuServicesService }, { type: AuthUtilService }], propDecorators: { onClose: [{
3389
3389
  type: Output
3390
3390
  }] } });