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

feat: Enhance query operation flexibility in filter component

Summary of changes
- Modified the `tags-in-list` and `list-in-tags` functions to include an optional `op` parameter for custom query operations.
- Updated the concatenation of query strings to use the provided operation, defaulting to "OR" if none is specified.
parent ebe52344
No related branches found
No related tags found
No related merge requests found
......@@ -1251,7 +1251,7 @@ function collectSearchQueries() {
encodeURIComponent(key)
);
},
"tags-in-list": (value, key) => {
"tags-in-list": (value, key, op) => {
if (isString(value)) {
value = value.split(",");
}
......@@ -1260,17 +1260,20 @@ function collectSearchQueries() {
return "";
}
if(!op || !isString(op)) op = "OR";
op = " "+op.toUpperCase().trim()+" ";
let query = "";
value.forEach((v) => {
if (query.length > 0) {
query += " OR ";
query += op;
}
query += `${encodeURIComponent(key)} IN "${encodeURIComponent(v)}"`;
});
return query;
},
"list-in-tags": (value, key) => {
"list-in-tags": (value, key, op) => {
if (isString(value)) {
value = value.split(",");
}
......@@ -1279,10 +1282,13 @@ function collectSearchQueries() {
return "";
}
if(!op || !isString(op)) op = "OR";
op = " "+op.toUpperCase().trim()+" ";
let query = "";
value.forEach((v) => {
if (query.length > 0) {
query += " OR ";
query += op;
}
query += `"${encodeURIComponent(v)}" IN ${encodeURIComponent(key)}`;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment