fix: allow same filter multiple times in workspace shortcut (#35133)

* fix: populate multiple filters of same type in URL

* test: increase wait time for jump to field
This commit is contained in:
Rahul Agrawal 2025-12-09 19:00:01 +05:30 committed by GitHub
parent 1deffcedd9
commit dfd956f236
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 5 deletions

View file

@ -3,7 +3,7 @@ const jump_to_field = (field_label) => {
.type("{esc}") // lose focus if any
.type("{ctrl+j}") // jump to field
.type(field_label)
.wait(500)
.wait(1000)
.type("{enter}")
.wait(200)
.findByRole("button", { name: "Go" })

View file

@ -1754,10 +1754,19 @@ Object.assign(frappe.utils, {
// don't remove unless patch is created to convert all existing filters from object to array
// backward compatibility
if (Array.isArray(filters_json)) {
let filter = {};
filters_json.forEach((arr) => {
filter[arr[1]] = [arr[2], arr[3]];
});
let filter = filters_json.reduce((acc, filter) => {
const field = filter[1];
const value = [filter[2], filter[3]];
// if we have multiple filters for the same field,
// we convert it into an array
if (acc[field]) {
acc[field].push(value);
} else {
acc[field] = [value];
}
return acc;
}, {});
return filter || [];
}
return filters_json || [];