ngx-sp-infra 6.5.2 → 6.5.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.
@@ -9739,12 +9739,17 @@ class SearchInputComponent {
9739
9739
  this._router.navigate([route]).then(() => this.close());
9740
9740
  }
9741
9741
  redirect(item) {
9742
+ const hostname = window.location.host.includes("localhost") ? "siscandesv6.sispro.com.br" : window.location.host;
9743
+ const baseURL = `https://${hostname}/SisproErpCloud`;
9742
9744
  if (item.RotaV6 && item.RotaV6 !== '') {
9743
- this._router.navigate([item.RotaV6]).then(() => this.close());
9745
+ let isCorporativo = item.RotaV6.split('/')[0] != item.Projeto;
9746
+ console.log('item:', item);
9747
+ console.log('isCorporativo:', isCorporativo);
9748
+ const targetRoute = `${baseURL}/${isCorporativo ? 'Corporativo/' : ''}${item.RotaV6}`;
9749
+ console.log('targetRoute:', targetRoute);
9750
+ window.location.replace(targetRoute);
9744
9751
  }
9745
9752
  else {
9746
- const hostname = window.location.host.includes("localhost") ? "siscandesv6.sispro.com.br" : window.location.host;
9747
- const baseURL = `https://${hostname}/SisproErpCloud`;
9748
9753
  // Se a RotaOS começar com '/', não adiciona outra '/'
9749
9754
  const targetRoute = `${baseURL}${item.RotaOS[0] === '/' ? '' : '/'}${item.RotaOS}`;
9750
9755
  window.location.replace(targetRoute);