commons-shared-web-ui 0.0.74 → 0.0.75
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.
|
@@ -14906,7 +14906,8 @@ class FilterTableSelectorComponent {
|
|
|
14906
14906
|
// ── Internal state ──────────────────────────────────────────────────────────
|
|
14907
14907
|
/** A deep-copy of tableConfig with the current filter params baked-in. */
|
|
14908
14908
|
resolvedTableConfig;
|
|
14909
|
-
/** Current active filter params (merged from form submission).
|
|
14909
|
+
/** Current active filter params (merged from form submission). Array values become repeated
|
|
14910
|
+
* query-param keys (e.g. roleCodes=1&roleCodes=2), not comma-joined. */
|
|
14910
14911
|
activeFilterParams = {};
|
|
14911
14912
|
/** The base API URL without any filter query params. */
|
|
14912
14913
|
baseApiUrl = '';
|
|
@@ -15039,8 +15040,8 @@ class FilterTableSelectorComponent {
|
|
|
15039
15040
|
}
|
|
15040
15041
|
else {
|
|
15041
15042
|
const paramString = Object.entries(this.activeFilterParams)
|
|
15042
|
-
.filter(([, v]) => v !== null && v !== undefined && v !== '')
|
|
15043
|
-
.
|
|
15043
|
+
.filter(([, v]) => v !== null && v !== undefined && v !== '' && !(Array.isArray(v) && v.length === 0))
|
|
15044
|
+
.flatMap(([k, v]) => (Array.isArray(v) ? v : [v]).map(val => `${encodeURIComponent(k)}=${encodeURIComponent(val)}`))
|
|
15044
15045
|
.join('&');
|
|
15045
15046
|
const separator = this.baseApiUrl.includes('?') ? '&' : '?';
|
|
15046
15047
|
newUrl = paramString
|
|
@@ -15073,9 +15074,10 @@ class FilterTableSelectorComponent {
|
|
|
15073
15074
|
mapping.forEach((map) => {
|
|
15074
15075
|
const rawVal = formValues[map.formFieldName];
|
|
15075
15076
|
if (rawVal !== null && rawVal !== undefined && rawVal !== '') {
|
|
15076
|
-
//
|
|
15077
|
-
|
|
15078
|
-
params
|
|
15077
|
+
// Multiselect fields become repeated query-param keys (roleCodes=1&roleCodes=2),
|
|
15078
|
+
// not a single comma-joined value — matches how the search-service filter API
|
|
15079
|
+
// (and most other backend filter endpoints) expect multi-value params.
|
|
15080
|
+
params[map.apiParamKey] = Array.isArray(rawVal) ? rawVal.map(String) : String(rawVal);
|
|
15079
15081
|
}
|
|
15080
15082
|
});
|
|
15081
15083
|
return params;
|