-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(dashboards): temporary filters broken when changing values #104482
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
base: master
Are you sure you want to change the base?
fix(dashboards): temporary filters broken when changing values #104482
Conversation
| onRemoveFilter: (filter: GlobalFilter) => void; | ||
| onUpdateFilter: (filter: GlobalFilter) => void; | ||
| searchBarData: SearchBarData; | ||
| disableRemoveFilter?: boolean; |
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.
Bug: NumericFilterSelector ignores disableRemoveFilter prop
The NumericFilterSelector component doesn't destructure or use the disableRemoveFilter prop from GenericFilterSelectorProps, even though the PR adds this prop to disable removing filters from prebuilt dashboards. As a result, numeric filters on prebuilt dashboards will always show the "Remove Filter" button (rendered at line 294-301), defeating the intended protection for prebuilt dashboard filters. The prop is correctly added to FilterSelector but is missing from NumericFilterSelector.
| <Fragment> | ||
| {activeGlobalFilters.map(filter => ( | ||
| <GenericFilterSelector | ||
| disableRemoveFilter={ |
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.
Bug: Release filter change clears temporary filters from URL
When the release filter is changed via ReleasesSelectControl, the handler calls onDashboardFilterChange without including TEMPORARY_FILTERS. The new code in detail.tsx always sets filterParams[TEMPORARY_FILTERS] - when it's not provided, it defaults to ['']. This overwrites any existing temporaryFilters in the URL, effectively clearing temporary filters when users change the release filter. Before this PR, the TEMPORARY_FILTERS key wasn't set in filterParams, so existing URL values were preserved. The fix requires the release handler to separate and pass temporary filters like updateGlobalFilters does.
Additional Locations (1)
Ahmed-Labs
left a comment
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.
I tested global filters in non-prebuilt dashboards and it seems that unsaved changes don't get picked up (changes get pushed to url params but no save button pops up)
| tag: Tag; | ||
| // The raw filter condition string (e.g. 'tagKey:[values,...]') | ||
| value: string; | ||
| isTemporary?: boolean; |
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.
With this new isTemporary field, would it be worth using it as the main separator between global/temp filters instead of using a new temporary filters parameter?
temporaryFiltersquery param instead ofglobalFiltersso that the new filter is correctly applied. We now flag temporary filters withisTemporary: trueto make it much easier to distinguish between temporary and non-temporary once we combine them all