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:
parent
1deffcedd9
commit
dfd956f236
2 changed files with 14 additions and 5 deletions
|
|
@ -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" })
|
||||
|
|
|
|||
|
|
@ -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 || [];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue