From f0b7d5d506b8808385e0a543bcabcaaf07958f50 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Mon, 29 Jun 2020 14:48:11 -0400 Subject: [PATCH] Remove obsolete custom types from super date picker handlers. (#69038) (#69271) Co-authored-by: Elastic Machine Co-authored-by: Elastic Machine --- .../components/common/uptime_date_picker.tsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx index 4254004dba4e0a..1d0dcad73795bd 100644 --- a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx +++ b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx @@ -10,17 +10,6 @@ import { useUrlParams } from '../../hooks'; import { CLIENT_DEFAULTS } from '../../../common/constants'; import { UptimeRefreshContext, UptimeSettingsContext } from '../../contexts'; -// TODO: when EUI exports types for this, this should be replaced -interface SuperDateRangePickerRangeChangedEvent { - start: string; - end: string; -} - -interface SuperDateRangePickerRefreshChangedEvent { - isPaused: boolean; - refreshInterval?: number; -} - export interface CommonlyUsedRange { from: string; to: string; @@ -52,12 +41,12 @@ export const UptimeDatePicker = () => { commonlyUsedRanges={euiCommonlyUsedRanges} isPaused={autorefreshIsPaused} refreshInterval={autorefreshInterval} - onTimeChange={({ start, end }: SuperDateRangePickerRangeChangedEvent) => { + onTimeChange={({ start, end }) => { updateUrl({ dateRangeStart: start, dateRangeEnd: end }); refreshApp(); }} onRefresh={refreshApp} - onRefreshChange={({ isPaused, refreshInterval }: SuperDateRangePickerRefreshChangedEvent) => { + onRefreshChange={({ isPaused, refreshInterval }) => { updateUrl({ autorefreshInterval: refreshInterval === undefined ? autorefreshInterval : refreshInterval,