Skip to content

Commit

Permalink
feat(insights): keep rolling date range popover open (#24132)
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr authored Aug 1, 2024
1 parent ceccb49 commit cb55c15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/lib/components/DateFilter/DateFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function DateFilter({
dateRangeFilterLabel={isFixedDateMode ? 'Last' : undefined}
selected={isRollingDateRange}
onChange={(fromDate) => {
setDate(fromDate, '')
setDate(fromDate, '', true)
}}
makeLabel={makeLabel}
popover={{
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/lib/components/DateFilter/dateFilterLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export const dateFilterLogic = kea<dateFilterLogicType>([
openFixedDate: true,
close: true,
applyRange: true,
setDate: (dateFrom: string | null, dateTo: string | null) => ({ dateFrom, dateTo }),
setDate: (dateFrom: string | null, dateTo: string | null, keepPopoverOpen = false) => ({
dateFrom,
dateTo,
keepPopoverOpen,
}),
setRangeDateFrom: (range: Dayjs | null) => ({ range }),
setRangeDateTo: (range: Dayjs | null) => ({ range }),
}),
Expand All @@ -44,7 +48,7 @@ export const dateFilterLogic = kea<dateFilterLogicType>([
openFixedRange: () => true,
openDateToNow: () => true,
openFixedDate: () => true,
setDate: () => false,
setDate: (_, { keepPopoverOpen }) => keepPopoverOpen,
close: () => false,
},
],
Expand Down

0 comments on commit cb55c15

Please sign in to comment.