mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
ea3a0362b0
* fix global issues and views * remove separate layouts for specific views * add permissions to views * fix global issues filters --------- Co-authored-by: Rahul R <rahulr@Rahuls-MacBook-Pro.local>
17 lines
561 B
TypeScript
17 lines
561 B
TypeScript
// types
|
|
import { IIssueFilterOptions } from "@plane/types";
|
|
|
|
export const calculateTotalFilters = (filters: IIssueFilterOptions): number =>
|
|
filters && Object.keys(filters).length > 0
|
|
? Object.keys(filters)
|
|
.map((key) =>
|
|
filters[key as keyof IIssueFilterOptions] !== null
|
|
? isNaN((filters[key as keyof IIssueFilterOptions] as string[]).length)
|
|
? 0
|
|
: (filters[key as keyof IIssueFilterOptions] as string[]).length
|
|
: 0
|
|
)
|
|
.reduce((curr, prev) => curr + prev, 0)
|
|
: 0;
|
|
|