From ff263ac4cc78c7e32a699a224cb1ade46082b73f Mon Sep 17 00:00:00 2001 From: Isaac Hellendag Date: Wed, 21 Aug 2024 15:32:15 -0500 Subject: [PATCH] [ui] Sensor history: Fix tick ID variable --- .../ui-core/src/instigation/TickDetailsDialog.tsx | 2 +- .../packages/ui-core/src/instigation/TickHistory.tsx | 9 +++++---- .../packages/ui-core/src/runs/TickTagForRun.tsx | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js_modules/dagster-ui/packages/ui-core/src/instigation/TickDetailsDialog.tsx b/js_modules/dagster-ui/packages/ui-core/src/instigation/TickDetailsDialog.tsx index 38499e8991b11..cf0ee8b8e6183 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/instigation/TickDetailsDialog.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/instigation/TickDetailsDialog.tsx @@ -61,7 +61,7 @@ export const TickDetailsDialog = ({tickId, isOpen, instigationSelector, onClose} }; interface InnerProps { - tickId: number | undefined; + tickId: string | undefined; instigationSelector: InstigationSelector; } diff --git a/js_modules/dagster-ui/packages/ui-core/src/instigation/TickHistory.tsx b/js_modules/dagster-ui/packages/ui-core/src/instigation/TickHistory.tsx index b7768959385f0..d1ebcff816bc4 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/instigation/TickHistory.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/instigation/TickHistory.tsx @@ -308,9 +308,9 @@ export const TickHistoryTimeline = ({ afterTimestamp?: number; statuses?: InstigationTickStatus[]; }) => { - const [selectedTickId, setSelectedTickId] = useQueryPersistedState({ + const [selectedTickId, setSelectedTickId] = useQueryPersistedState({ encode: (tickId) => ({tickId}), - decode: (qs) => (qs['tickId'] ? Number(qs['tickId']) : undefined), + decode: (qs) => qs['tickId'] ?? undefined, }); const [pollingPaused, pausePolling] = React.useState(false); @@ -364,7 +364,7 @@ export const TickHistoryTimeline = ({ const {ticks = []} = data.instigationStateOrError; const onTickClick = (tick?: InstigationTick) => { - setSelectedTickId(tick ? Number(tick.tickId) : undefined); + setSelectedTickId(tick ? tick.tickId : undefined); }; const onTickHover = (tick?: InstigationTick) => { @@ -376,6 +376,7 @@ export const TickHistoryTimeline = ({ pausePolling(true); } }; + return ( <> { setShowResults(false); diff --git a/js_modules/dagster-ui/packages/ui-core/src/runs/TickTagForRun.tsx b/js_modules/dagster-ui/packages/ui-core/src/runs/TickTagForRun.tsx index 178abdc21d517..32d52d2bd9432 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/runs/TickTagForRun.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/runs/TickTagForRun.tsx @@ -32,7 +32,7 @@ export const TickTagForRun = ({instigationSelector, instigationType, tickId}: Pr isOpen={isOpen} onClose={() => setIsOpen(false)} instigationSelector={instigationSelector} - tickId={Number(tickId)} + tickId={tickId} /> );