Skip to content
Snippets Groups Projects
Verified Commit 6806ff8f authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat: Add support for array-list filter serialization in Datatable

Summary of changes
- Implemented a new filter type "array-list" for handling string arrays.
- Added functionality to parse string values and encode them for search queries.

Changes
- Created a new method within the `collectSearchQueries` function to serialize "array-list" format.
- This allows for better handling and representation of multiple filter values as encoded strings in the query, enhancing the search capabilities.

The changes were made to increase the flexibility of the filtering options in the Datatable component. Without these changes, users would struggle with properly formatting and managing multiple selections.
parent 11dc645b
No related branches found
No related tags found
No related merge requests found
......@@ -1231,6 +1231,25 @@ function collectSearchQueries() {
.join(",")
);
},
"array-list": (value, key) => {
if (isString(value)) {
value = value.split(",");
}
if (!isArray(value)) {
return "";
}
return (
key +
"=" +
value
.map((v) => {
return `"${encodeURIComponent(v)}"`;
})
.join(",")
);
},
"date-range": (value, key) => {
const query = parseDateInput(value, key);
if (!query || query === "false") {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment