refactor: added params to filters, and removed manual mutation (#480)
* refractor: added params to fetch key * feat: create views directly from views list page fix: selected filter not showing up in multi-level dropdown, refactor: arranged imports * refactor: added params to filters, and removed manual mutation
This commit is contained in:
parent
505b14e3a6
commit
53df658b60
2 changed files with 10 additions and 40 deletions
|
|
@ -1,16 +1,19 @@
|
|||
const paramsToKey = (params: any) => {
|
||||
const { state, priority, assignees } = params;
|
||||
|
||||
let stateKey = state ? state.split(",").join(" ") : "";
|
||||
let priorityKey = priority ? priority.split(",").join(" ") : "";
|
||||
let assigneesKey = assignees ? assignees.split(",").join(" ") : "";
|
||||
let stateKey = state ? state.split(",") : [];
|
||||
let priorityKey = priority ? priority.split(",") : [];
|
||||
let assigneesKey = assignees ? assignees.split(",") : [];
|
||||
const type = params.type ? params.type.toUpperCase() : "NULL";
|
||||
const groupBy = params.group_by ? params.group_by.toUpperCase() : "NULL";
|
||||
const orderBy = params.order_by ? params.order_by.toUpperCase() : "NULL";
|
||||
|
||||
// sorting each keys in ascending order
|
||||
stateKey = stateKey.split(" ").sort().join("");
|
||||
priorityKey = priorityKey.split(" ").sort().join("");
|
||||
assigneesKey = assigneesKey.split(" ").sort().join("");
|
||||
stateKey = stateKey.sort().join("_");
|
||||
priorityKey = priorityKey.sort().join("_");
|
||||
assigneesKey = assigneesKey.sort().join("_");
|
||||
|
||||
return `${stateKey}_${priorityKey}_${assigneesKey}`;
|
||||
return `${stateKey}_${priorityKey}_${assigneesKey}_${type}_${groupBy}_${orderBy}`;
|
||||
};
|
||||
|
||||
export const CURRENT_USER = "CURRENT_USER";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue