reneco-hierarchized-picker 0.4.0-beta.5 → 0.4.0-beta.6

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,31 +18068,27 @@ class RawDataManager {
18068
18068
  }
18069
18069
  // Fetch data from classification
18070
18070
  async getFromClassification(endpoint, options, loader) {
18071
- const urlParams = new URLSearchParams(options);
18072
- //------------
18073
18071
  let pathSegment = '';
18074
- let keyToRemove = '';
18075
- for (const [key, value] of urlParams.entries()) {
18072
+ const queryParams = [];
18073
+ for (const key in options) {
18074
+ if (!options.hasOwnProperty(key))
18075
+ continue;
18076
+ const value = options[key];
18076
18077
  const lowerKey = key.toLowerCase();
18077
- if (lowerKey === 'startnode' || lowerKey === 'startnodeid') {
18078
- pathSegment = value;
18079
- keyToRemove = key;
18080
- break;
18078
+ if ((lowerKey === 'startnode' || lowerKey === 'startnodeid') && !pathSegment) {
18079
+ pathSegment = encodeURIComponent(value);
18080
+ continue; // Skip adding this to the query string
18081
18081
  }
18082
+ // Add other keys to query string
18083
+ queryParams.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
18082
18084
  }
18083
- if (keyToRemove) {
18084
- urlParams.delete(keyToRemove);
18085
- }
18086
- //------------
18085
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
18087
18086
  const newUrl = pathSegment
18088
- ? `${endpoint}/${pathSegment}?${urlParams.toString()}`
18089
- : `${endpoint}/?${urlParams.toString()}`;
18087
+ ? `${endpoint}/${pathSegment}/${queryString}`
18088
+ : `${endpoint}/${queryString}`;
18090
18089
  await this.makeRequest('GET', newUrl, null, loader).then((data) => {
18091
18090
  this.loadData(data);
18092
18091
  });
18093
- // await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18094
- // this.loadData(data);
18095
- // });
18096
18092
  return;
18097
18093
  }
18098
18094
  // Fetch data from a generic source
@@ -42,31 +42,27 @@ export class RawDataManager {
42
42
  }
43
43
  // Fetch data from classification
44
44
  async getFromClassification(endpoint, options, loader) {
45
- const urlParams = new URLSearchParams(options);
46
- //------------
47
45
  let pathSegment = '';
48
- let keyToRemove = '';
49
- for (const [key, value] of urlParams.entries()) {
46
+ const queryParams = [];
47
+ for (const key in options) {
48
+ if (!options.hasOwnProperty(key))
49
+ continue;
50
+ const value = options[key];
50
51
  const lowerKey = key.toLowerCase();
51
- if (lowerKey === 'startnode' || lowerKey === 'startnodeid') {
52
- pathSegment = value;
53
- keyToRemove = key;
54
- break;
52
+ if ((lowerKey === 'startnode' || lowerKey === 'startnodeid') && !pathSegment) {
53
+ pathSegment = encodeURIComponent(value);
54
+ continue; // Skip adding this to the query string
55
55
  }
56
+ // Add other keys to query string
57
+ queryParams.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
56
58
  }
57
- if (keyToRemove) {
58
- urlParams.delete(keyToRemove);
59
- }
60
- //------------
59
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
61
60
  const newUrl = pathSegment
62
- ? `${endpoint}/${pathSegment}?${urlParams.toString()}`
63
- : `${endpoint}/?${urlParams.toString()}`;
61
+ ? `${endpoint}/${pathSegment}/${queryString}`
62
+ : `${endpoint}/${queryString}`;
64
63
  await this.makeRequest('GET', newUrl, null, loader).then((data) => {
65
64
  this.loadData(data);
66
65
  });
67
- // await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
68
- // this.loadData(data);
69
- // });
70
66
  return;
71
67
  }
72
68
  // Fetch data from a generic source
@@ -18065,31 +18065,27 @@ class RawDataManager {
18065
18065
  }
18066
18066
  // Fetch data from classification
18067
18067
  async getFromClassification(endpoint, options, loader) {
18068
- const urlParams = new URLSearchParams(options);
18069
- //------------
18070
18068
  let pathSegment = '';
18071
- let keyToRemove = '';
18072
- for (const [key, value] of urlParams.entries()) {
18069
+ const queryParams = [];
18070
+ for (const key in options) {
18071
+ if (!options.hasOwnProperty(key))
18072
+ continue;
18073
+ const value = options[key];
18073
18074
  const lowerKey = key.toLowerCase();
18074
- if (lowerKey === 'startnode' || lowerKey === 'startnodeid') {
18075
- pathSegment = value;
18076
- keyToRemove = key;
18077
- break;
18075
+ if ((lowerKey === 'startnode' || lowerKey === 'startnodeid') && !pathSegment) {
18076
+ pathSegment = encodeURIComponent(value);
18077
+ continue; // Skip adding this to the query string
18078
18078
  }
18079
+ // Add other keys to query string
18080
+ queryParams.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
18079
18081
  }
18080
- if (keyToRemove) {
18081
- urlParams.delete(keyToRemove);
18082
- }
18083
- //------------
18082
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
18084
18083
  const newUrl = pathSegment
18085
- ? `${endpoint}/${pathSegment}?${urlParams.toString()}`
18086
- : `${endpoint}/?${urlParams.toString()}`;
18084
+ ? `${endpoint}/${pathSegment}/${queryString}`
18085
+ : `${endpoint}/${queryString}`;
18087
18086
  await this.makeRequest('GET', newUrl, null, loader).then((data) => {
18088
18087
  this.loadData(data);
18089
18088
  });
18090
- // await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18091
- // this.loadData(data);
18092
- // });
18093
18089
  return;
18094
18090
  }
18095
18091
  // Fetch data from a generic source
@@ -18064,31 +18064,27 @@ class RawDataManager {
18064
18064
  }
18065
18065
  // Fetch data from classification
18066
18066
  async getFromClassification(endpoint, options, loader) {
18067
- const urlParams = new URLSearchParams(options);
18068
- //------------
18069
18067
  let pathSegment = '';
18070
- let keyToRemove = '';
18071
- for (const [key, value] of urlParams.entries()) {
18068
+ const queryParams = [];
18069
+ for (const key in options) {
18070
+ if (!options.hasOwnProperty(key))
18071
+ continue;
18072
+ const value = options[key];
18072
18073
  const lowerKey = key.toLowerCase();
18073
- if (lowerKey === 'startnode' || lowerKey === 'startnodeid') {
18074
- pathSegment = value;
18075
- keyToRemove = key;
18076
- break;
18074
+ if ((lowerKey === 'startnode' || lowerKey === 'startnodeid') && !pathSegment) {
18075
+ pathSegment = encodeURIComponent(value);
18076
+ continue; // Skip adding this to the query string
18077
18077
  }
18078
+ // Add other keys to query string
18079
+ queryParams.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
18078
18080
  }
18079
- if (keyToRemove) {
18080
- urlParams.delete(keyToRemove);
18081
- }
18082
- //------------
18081
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
18083
18082
  const newUrl = pathSegment
18084
- ? `${endpoint}/${pathSegment}?${urlParams.toString()}`
18085
- : `${endpoint}/?${urlParams.toString()}`;
18083
+ ? `${endpoint}/${pathSegment}/${queryString}`
18084
+ : `${endpoint}/${queryString}`;
18086
18085
  await this.makeRequest('GET', newUrl, null, loader).then((data) => {
18087
18086
  this.loadData(data);
18088
18087
  });
18089
- // await this.makeRequest('GET', `${endpoint}/?${urlParams.toString()}`, null, loader).then((data) => {
18090
- // this.loadData(data);
18091
- // });
18092
18088
  return;
18093
18089
  }
18094
18090
  // Fetch data from a generic source