From 5091fd6024994be636a5d7debf4b8b47dbe1fe4f Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Mon, 22 Jul 2024 17:09:14 -0700 Subject: [PATCH 1/4] fix: `refreshMinInterval` for use in `EuiQuickSelectPopover` --- .../quick_select_popover/quick_select_popover.tsx | 4 ++++ .../date_picker/super_date_picker/super_date_picker.tsx | 2 ++ 2 files changed, 6 insertions(+) diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx index 50f94e093ee..a93b96fa44d 100644 --- a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx +++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx @@ -34,6 +34,7 @@ import { ApplyTime, QuickSelect, QuickSelectPanel, + Milliseconds, } from '../../types'; export type CustomQuickSelectRenderOptions = { @@ -58,6 +59,7 @@ export interface EuiQuickSelectPopoverProps { isPaused: boolean; recentlyUsedRanges: DurationRange[]; refreshInterval: number; + minInterval?: Milliseconds; intervalUnits?: RefreshUnitsOptions; start: string; timeOptions: TimeOptions; @@ -137,6 +139,7 @@ export const EuiQuickSelectPanels: FunctionComponent< customQuickSelectRender, isPaused, refreshInterval, + minInterval, intervalUnits, applyRefreshInterval, applyTime, @@ -173,6 +176,7 @@ export const EuiQuickSelectPanels: FunctionComponent< onRefreshChange={applyRefreshInterval} isPaused={isPaused} refreshInterval={refreshInterval} + minInterval={minInterval} intervalUnits={intervalUnits} /> ); diff --git a/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx b/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx index d7db318dd59..a2ad09c6ca8 100644 --- a/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx +++ b/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx @@ -457,6 +457,7 @@ export class EuiSuperDatePickerInternal extends Component< onRefreshChange, recentlyUsedRanges, refreshInterval, + refreshMinInterval, refreshIntervalUnits, isPaused, isDisabled, @@ -477,6 +478,7 @@ export class EuiSuperDatePickerInternal extends Component< isPaused={isPaused} recentlyUsedRanges={recentlyUsedRanges} refreshInterval={refreshInterval} + minInterval={refreshMinInterval} intervalUnits={refreshIntervalUnits} start={start} timeOptions={timeOptions} From e6d786305db4bfd1797c3d27671627f40874c2ce Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Mon, 22 Jul 2024 17:20:15 -0700 Subject: [PATCH 2/4] chore: add changelog file --- packages/eui/changelogs/upcoming/7905.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 packages/eui/changelogs/upcoming/7905.md diff --git a/packages/eui/changelogs/upcoming/7905.md b/packages/eui/changelogs/upcoming/7905.md new file mode 100644 index 00000000000..d14e3a01cef --- /dev/null +++ b/packages/eui/changelogs/upcoming/7905.md @@ -0,0 +1,4 @@ +**Bug fixes** + +- Fixed usage of `refreshMinInterval` with `EuiSuperDatePicker`, passing interval to `EuiQuickSelectPopover` https://github.com/elastic/eui/pull/7905 + From 0a389db2873d76ee1a0d745040da4c26cc1d8ea4 Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Mon, 22 Jul 2024 18:00:20 -0700 Subject: [PATCH 3/4] changelog tweak --- packages/eui/changelogs/upcoming/7905.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/eui/changelogs/upcoming/7905.md b/packages/eui/changelogs/upcoming/7905.md index d14e3a01cef..b1351973a28 100644 --- a/packages/eui/changelogs/upcoming/7905.md +++ b/packages/eui/changelogs/upcoming/7905.md @@ -1,4 +1,3 @@ **Bug fixes** -- Fixed usage of `refreshMinInterval` with `EuiSuperDatePicker`, passing interval to `EuiQuickSelectPopover` https://github.com/elastic/eui/pull/7905 - +- Fixed `EuiSuperDatePicker` not correctly passing `refreshMinInterval` from the quick select popover From a739946f90486bbeb8dff0a5edcdecfa37c6cdbb Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Mon, 22 Jul 2024 18:35:26 -0700 Subject: [PATCH 4/4] [PR feedback] Prop name + Use the full `refreshMinInterval` prop for EuiSuperDatePicker subcomponents - we use `minInterval` for the refresh component directly + unify types --- .../quick_select_popover/quick_select_popover.tsx | 8 ++++---- .../date_picker/super_date_picker/super_date_picker.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx index a93b96fa44d..72370d74240 100644 --- a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx +++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx @@ -58,8 +58,8 @@ export interface EuiQuickSelectPopoverProps { isDisabled: boolean; isPaused: boolean; recentlyUsedRanges: DurationRange[]; - refreshInterval: number; - minInterval?: Milliseconds; + refreshInterval: Milliseconds; + refreshMinInterval?: Milliseconds; intervalUnits?: RefreshUnitsOptions; start: string; timeOptions: TimeOptions; @@ -139,7 +139,7 @@ export const EuiQuickSelectPanels: FunctionComponent< customQuickSelectRender, isPaused, refreshInterval, - minInterval, + refreshMinInterval, intervalUnits, applyRefreshInterval, applyTime, @@ -176,7 +176,7 @@ export const EuiQuickSelectPanels: FunctionComponent< onRefreshChange={applyRefreshInterval} isPaused={isPaused} refreshInterval={refreshInterval} - minInterval={minInterval} + minInterval={refreshMinInterval} intervalUnits={intervalUnits} /> ); diff --git a/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx b/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx index a2ad09c6ca8..d599c5748f0 100644 --- a/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx +++ b/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx @@ -478,7 +478,7 @@ export class EuiSuperDatePickerInternal extends Component< isPaused={isPaused} recentlyUsedRanges={recentlyUsedRanges} refreshInterval={refreshInterval} - minInterval={refreshMinInterval} + refreshMinInterval={refreshMinInterval} intervalUnits={refreshIntervalUnits} start={start} timeOptions={timeOptions}