-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WEB-1176] chore: filter dropdown indicator and code refactor #4379
[WEB-1176] chore: filter dropdown indicator and code refactor #4379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the dry principle, and move the common code to a utility function.
@@ -61,6 +62,13 @@ export const ArchivedCyclesHeader: FC = observer(() => { | |||
} | |||
}; | |||
|
|||
const appliedFilters: TCycleFilters = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are not using applied filters for display purposes and only dependent on the boolean value, can you bailout early as soon as you come across a filter.
const hasFilters = objectHasValues(currentProjectArchivedFilters ?? {})
// Put this in a utilities file
objectHasValues = (obj)=>{
// run the for loop here.
}
web/helpers/filter.helper.ts
Outdated
@@ -26,6 +27,24 @@ export const calculateTotalFilters = (filters: TFilters): number => | |||
.reduce((curr, prev) => curr + prev, 0) | |||
: 0; | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the existing function above using typescript generics. Please create an issue for that and we will track it as a separate change.
Changes:
This PR includes following changes:
Issue link: [WEB-1176]
Media: