dts-backoffice-util 15.3.0 → 15.3.2

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.
@@ -266,18 +266,32 @@ class MenuDatasulService {
266
266
  parent.postMessage({ notification }, '*');
267
267
  }
268
268
  openPath(programName, params, parent = true) {
269
- const datasulPath = document.referrer.indexOf('totvs-menu') > 0 ? 'totvs-menu' : 'menu-html';
270
- let baseUrl = `/${datasulPath}/#/${datasulPath}/program-html/${programName}/#`;
271
- this.openHTMLProgram(baseUrl, params, parent);
269
+ this.openHTMLProgram('THF2', programName, params, parent);
272
270
  }
273
271
  openTHF(externalName, params, parent = true) {
274
- const datasulPath = document.referrer.indexOf('totvs-menu') > 0 ? 'totvs-menu' : 'menu-html';
275
- let baseUrl = `/${datasulPath}/#/${externalName}/#`;
276
- this.openHTMLProgram(baseUrl, params, parent);
272
+ this.openHTMLProgram('THF1', externalName, params, parent);
277
273
  }
278
- openHTMLProgram(baseUrl, params, parent) {
274
+ openHTMLProgram(type, HTMLProgram, params, parent) {
275
+ const datasulPath = document.referrer.indexOf('totvs-menu') > 0 ? 'totvs-menu' : 'menu-html';
276
+ HTMLProgram = HTMLProgram.replace(/\\/g, '/');
277
+ if (HTMLProgram.charAt(0) === '/') {
278
+ HTMLProgram = HTMLProgram.slice(1);
279
+ }
280
+ if (HTMLProgram.charAt(HTMLProgram.length - 1) === '/') {
281
+ HTMLProgram = HTMLProgram.slice(0, -1);
282
+ }
283
+ let baseUrl = `/${datasulPath}/#/`;
284
+ if (type === 'THF2') {
285
+ baseUrl = `${baseUrl}${datasulPath}/program-html/${HTMLProgram}/`;
286
+ }
287
+ else {
288
+ baseUrl = `${baseUrl}${HTMLProgram}`;
289
+ }
279
290
  if (params) {
280
- baseUrl = `${baseUrl}/${params}`;
291
+ if (baseUrl.charAt(baseUrl.length - 1) === '/') {
292
+ baseUrl = baseUrl.slice(0, -1);
293
+ }
294
+ baseUrl = `${baseUrl}/#/${params}`;
281
295
  }
282
296
  if (parent) {
283
297
  window.open(baseUrl, '_parent');
@@ -1978,6 +1992,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1978
1992
  /*
1979
1993
  * Public API Surface of dts-backoffice-util
1980
1994
  */
1995
+ // Services
1981
1996
  // Pipes
1982
1997
 
1983
1998
  /**