plane/web/helpers/filter.helper.ts
rahulramesha c593d5df1b
fix: enable global/ all issues (#3405)
* 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>
2024-01-18 15:51:17 +05:30

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;