reneco-hierarchized-picker 0.4.0-beta.3 → 0.4.0-beta.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.
@@ -18068,11 +18068,31 @@ class RawDataManager {
18068
18068
  }
18069
18069
  // Fetch data from classification
18070
18070
  async getFromClassification(endpoint, options, loader) {
18071
- console.log("getFromClassification", options);
18072
18071
  const urlParams = new URLSearchParams(options);
18073
- await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18072
+ //------------
18073
+ let pathSegment = '';
18074
+ let keyToRemove = '';
18075
+ for (const [key, value] of urlParams.entries()) {
18076
+ const lowerKey = key.toLowerCase();
18077
+ if (lowerKey === 'startnode' || lowerKey === 'startnodeid') {
18078
+ pathSegment = value;
18079
+ keyToRemove = key;
18080
+ break;
18081
+ }
18082
+ }
18083
+ if (keyToRemove) {
18084
+ urlParams.delete(keyToRemove);
18085
+ }
18086
+ //------------
18087
+ const newUrl = pathSegment
18088
+ ? `${endpoint}/${pathSegment}?${urlParams.toString()}`
18089
+ : `${endpoint}/?${urlParams.toString()}`;
18090
+ await this.makeRequest('GET', newUrl, null, loader).then((data) => {
18074
18091
  this.loadData(data);
18075
18092
  });
18093
+ // await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18094
+ // this.loadData(data);
18095
+ // });
18076
18096
  return;
18077
18097
  }
18078
18098
  // Fetch data from a generic source
@@ -18970,7 +18990,7 @@ const HierarchizedPickerComponent = class {
18970
18990
  if (this.theOptions.source == 'webservice') {
18971
18991
  if (this.theOptions.origin == 'classification') {
18972
18992
  // WS Call
18973
- console.log("FLAG 01");
18993
+ console.log("FLAG 01", this.theOptions);
18974
18994
  this.rawDataManager.getFromClassification(this.getApiSearchURL(), {
18975
18995
  search: {
18976
18996
  StartNodeID: this.theOptions.options.startNode,
@@ -19320,7 +19340,7 @@ const HierarchizedPickerComponent = class {
19320
19340
  loadDataForTree(init, loader) {
19321
19341
  if (this.optionsManager.getOptions().source == 'webservice') {
19322
19342
  if (this.optionsManager.getOptions().origin == 'classification') {
19323
- console.log("FLAG 02", this.optionsManager.getOptions().options);
19343
+ console.log("FLAG 02", this.optionsManager.getOptions());
19324
19344
  this.rawDataManager.getFromClassification(this.optionsManager.getOptions().url, this.optionsManager.getOptions().options, loader);
19325
19345
  }
19326
19346
  else {
@@ -468,7 +468,7 @@ export class HierarchizedPickerComponent {
468
468
  if (this.theOptions.source == 'webservice') {
469
469
  if (this.theOptions.origin == 'classification') {
470
470
  // WS Call
471
- console.log("FLAG 01");
471
+ console.log("FLAG 01", this.theOptions);
472
472
  this.rawDataManager.getFromClassification(this.getApiSearchURL(), {
473
473
  search: {
474
474
  StartNodeID: this.theOptions.options.startNode,
@@ -818,7 +818,7 @@ export class HierarchizedPickerComponent {
818
818
  loadDataForTree(init, loader) {
819
819
  if (this.optionsManager.getOptions().source == 'webservice') {
820
820
  if (this.optionsManager.getOptions().origin == 'classification') {
821
- console.log("FLAG 02", this.optionsManager.getOptions().options);
821
+ console.log("FLAG 02", this.optionsManager.getOptions());
822
822
  this.rawDataManager.getFromClassification(this.optionsManager.getOptions().url, this.optionsManager.getOptions().options, loader);
823
823
  }
824
824
  else {
@@ -42,11 +42,31 @@ export class RawDataManager {
42
42
  }
43
43
  // Fetch data from classification
44
44
  async getFromClassification(endpoint, options, loader) {
45
- console.log("getFromClassification", options);
46
45
  const urlParams = new URLSearchParams(options);
47
- await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
46
+ //------------
47
+ let pathSegment = '';
48
+ let keyToRemove = '';
49
+ for (const [key, value] of urlParams.entries()) {
50
+ const lowerKey = key.toLowerCase();
51
+ if (lowerKey === 'startnode' || lowerKey === 'startnodeid') {
52
+ pathSegment = value;
53
+ keyToRemove = key;
54
+ break;
55
+ }
56
+ }
57
+ if (keyToRemove) {
58
+ urlParams.delete(keyToRemove);
59
+ }
60
+ //------------
61
+ const newUrl = pathSegment
62
+ ? `${endpoint}/${pathSegment}?${urlParams.toString()}`
63
+ : `${endpoint}/?${urlParams.toString()}`;
64
+ await this.makeRequest('GET', newUrl, null, loader).then((data) => {
48
65
  this.loadData(data);
49
66
  });
67
+ // await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
68
+ // this.loadData(data);
69
+ // });
50
70
  return;
51
71
  }
52
72
  // Fetch data from a generic source
@@ -18065,11 +18065,31 @@ class RawDataManager {
18065
18065
  }
18066
18066
  // Fetch data from classification
18067
18067
  async getFromClassification(endpoint, options, loader) {
18068
- console.log("getFromClassification", options);
18069
18068
  const urlParams = new URLSearchParams(options);
18070
- await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18069
+ //------------
18070
+ let pathSegment = '';
18071
+ let keyToRemove = '';
18072
+ for (const [key, value] of urlParams.entries()) {
18073
+ const lowerKey = key.toLowerCase();
18074
+ if (lowerKey === 'startnode' || lowerKey === 'startnodeid') {
18075
+ pathSegment = value;
18076
+ keyToRemove = key;
18077
+ break;
18078
+ }
18079
+ }
18080
+ if (keyToRemove) {
18081
+ urlParams.delete(keyToRemove);
18082
+ }
18083
+ //------------
18084
+ const newUrl = pathSegment
18085
+ ? `${endpoint}/${pathSegment}?${urlParams.toString()}`
18086
+ : `${endpoint}/?${urlParams.toString()}`;
18087
+ await this.makeRequest('GET', newUrl, null, loader).then((data) => {
18071
18088
  this.loadData(data);
18072
18089
  });
18090
+ // await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18091
+ // this.loadData(data);
18092
+ // });
18073
18093
  return;
18074
18094
  }
18075
18095
  // Fetch data from a generic source
@@ -18968,7 +18988,7 @@ const HierarchizedPickerComponent = class extends HTMLElement {
18968
18988
  if (this.theOptions.source == 'webservice') {
18969
18989
  if (this.theOptions.origin == 'classification') {
18970
18990
  // WS Call
18971
- console.log("FLAG 01");
18991
+ console.log("FLAG 01", this.theOptions);
18972
18992
  this.rawDataManager.getFromClassification(this.getApiSearchURL(), {
18973
18993
  search: {
18974
18994
  StartNodeID: this.theOptions.options.startNode,
@@ -19318,7 +19338,7 @@ const HierarchizedPickerComponent = class extends HTMLElement {
19318
19338
  loadDataForTree(init, loader) {
19319
19339
  if (this.optionsManager.getOptions().source == 'webservice') {
19320
19340
  if (this.optionsManager.getOptions().origin == 'classification') {
19321
- console.log("FLAG 02", this.optionsManager.getOptions().options);
19341
+ console.log("FLAG 02", this.optionsManager.getOptions());
19322
19342
  this.rawDataManager.getFromClassification(this.optionsManager.getOptions().url, this.optionsManager.getOptions().options, loader);
19323
19343
  }
19324
19344
  else {
@@ -18064,11 +18064,31 @@ class RawDataManager {
18064
18064
  }
18065
18065
  // Fetch data from classification
18066
18066
  async getFromClassification(endpoint, options, loader) {
18067
- console.log("getFromClassification", options);
18068
18067
  const urlParams = new URLSearchParams(options);
18069
- await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18068
+ //------------
18069
+ let pathSegment = '';
18070
+ let keyToRemove = '';
18071
+ for (const [key, value] of urlParams.entries()) {
18072
+ const lowerKey = key.toLowerCase();
18073
+ if (lowerKey === 'startnode' || lowerKey === 'startnodeid') {
18074
+ pathSegment = value;
18075
+ keyToRemove = key;
18076
+ break;
18077
+ }
18078
+ }
18079
+ if (keyToRemove) {
18080
+ urlParams.delete(keyToRemove);
18081
+ }
18082
+ //------------
18083
+ const newUrl = pathSegment
18084
+ ? `${endpoint}/${pathSegment}?${urlParams.toString()}`
18085
+ : `${endpoint}/?${urlParams.toString()}`;
18086
+ await this.makeRequest('GET', newUrl, null, loader).then((data) => {
18070
18087
  this.loadData(data);
18071
18088
  });
18089
+ // await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18090
+ // this.loadData(data);
18091
+ // });
18072
18092
  return;
18073
18093
  }
18074
18094
  // Fetch data from a generic source
@@ -18966,7 +18986,7 @@ const HierarchizedPickerComponent = class {
18966
18986
  if (this.theOptions.source == 'webservice') {
18967
18987
  if (this.theOptions.origin == 'classification') {
18968
18988
  // WS Call
18969
- console.log("FLAG 01");
18989
+ console.log("FLAG 01", this.theOptions);
18970
18990
  this.rawDataManager.getFromClassification(this.getApiSearchURL(), {
18971
18991
  search: {
18972
18992
  StartNodeID: this.theOptions.options.startNode,
@@ -19316,7 +19336,7 @@ const HierarchizedPickerComponent = class {
19316
19336
  loadDataForTree(init, loader) {
19317
19337
  if (this.optionsManager.getOptions().source == 'webservice') {
19318
19338
  if (this.optionsManager.getOptions().origin == 'classification') {
19319
- console.log("FLAG 02", this.optionsManager.getOptions().options);
19339
+ console.log("FLAG 02", this.optionsManager.getOptions());
19320
19340
  this.rawDataManager.getFromClassification(this.optionsManager.getOptions().url, this.optionsManager.getOptions().options, loader);
19321
19341
  }
19322
19342
  else {