diff --git a/js_modules/dagster-ui/packages/ui-core/src/automation/VirtualizedAutomationScheduleRow.tsx b/js_modules/dagster-ui/packages/ui-core/src/automation/VirtualizedAutomationScheduleRow.tsx index b2294c8f089d9..03c1ef0c5956b 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/automation/VirtualizedAutomationScheduleRow.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/automation/VirtualizedAutomationScheduleRow.tsx @@ -1,5 +1,5 @@ -import {Box, Caption, Checkbox, MiddleTruncate, Tooltip} from '@dagster-io/ui-components'; -import {forwardRef, useCallback, useMemo} from 'react'; +import {Box, Button, Caption, Checkbox, MiddleTruncate, Tooltip} from '@dagster-io/ui-components'; +import {forwardRef, useCallback, useMemo, useState} from 'react'; import {Link} from 'react-router-dom'; import {AutomationTargetList} from './AutomationTargetList'; @@ -17,6 +17,7 @@ import { ScheduleAssetSelectionQuery, ScheduleAssetSelectionQueryVariables, } from '../schedules/types/ScheduleAssetSelectionsQuery.types'; +import {EvaluateScheduleDialog} from '../ticks/EvaluateScheduleDialog'; import {TickStatusTag} from '../ticks/TickStatusTag'; import {RowCell} from '../ui/VirtualizedTable'; import {SINGLE_SCHEDULE_QUERY} from '../workspace/VirtualizedScheduleRow'; @@ -40,6 +41,8 @@ export const VirtualizedAutomationScheduleRow = forwardRef( (props: ScheduleRowProps, ref: React.ForwardedRef) => { const {index, name, repoAddress, checked, onToggleChecked} = props; + const [showTestTickDialog, setShowTestTickDialog] = useState(false); + const [querySchedule, queryResult] = useLazyQuery< SingleScheduleQuery, SingleScheduleQueryVariables @@ -133,22 +136,33 @@ export const VirtualizedAutomationScheduleRow = forwardRef( + {/* Left aligned content */} - {scheduleData ? ( - - {/* Keyed so that a new switch is always rendered, otherwise it's reused and animates on/off */} - - {errorDisplay( - scheduleData.scheduleState.status, - scheduleData.scheduleState.runningCount, - )} - - ) : ( -
- )} - - - + + {scheduleData ? ( + <> + + {errorDisplay( + scheduleData.scheduleState.status, + scheduleData.scheduleState.runningCount, + )} + + ) : ( +
+ )} + + + + + {/* Right aligned content */} + @@ -216,6 +230,16 @@ export const VirtualizedAutomationScheduleRow = forwardRef( )} + { + setShowTestTickDialog(false); + }} + name={scheduleData?.name || ''} + repoAddress={repoAddress} + jobName={scheduleData?.pipelineName || ''} + />
); }, diff --git a/js_modules/dagster-ui/packages/ui-core/src/automation/VirtualizedAutomationSensorRow.tsx b/js_modules/dagster-ui/packages/ui-core/src/automation/VirtualizedAutomationSensorRow.tsx index dd96e54793059..5900d55e031f9 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/automation/VirtualizedAutomationSensorRow.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/automation/VirtualizedAutomationSensorRow.tsx @@ -1,12 +1,12 @@ -import {Box, Checkbox, MiddleTruncate, Tag, Tooltip} from '@dagster-io/ui-components'; -import {forwardRef, useCallback, useMemo} from 'react'; +import {Box, Button, Checkbox, MiddleTruncate, Tag, Tooltip} from '@dagster-io/ui-components'; +import {forwardRef, useCallback, useMemo, useState} from 'react'; import {Link} from 'react-router-dom'; import {AutomationTargetList} from './AutomationTargetList'; import {AutomationRowGrid} from './VirtualizedAutomationRow'; import {useLazyQuery} from '../apollo-client'; import {FIFTEEN_SECONDS, useQueryRefreshAtInterval} from '../app/QueryRefresh'; -import {InstigationStatus} from '../graphql/types'; +import {InstigationStatus, SensorType} from '../graphql/types'; import {LastRunSummary} from '../instance/LastRunSummary'; import {SENSOR_ASSET_SELECTIONS_QUERY} from '../sensors/SensorRoot'; import {SensorSwitch} from '../sensors/SensorSwitch'; @@ -14,6 +14,7 @@ import { SensorAssetSelectionQuery, SensorAssetSelectionQueryVariables, } from '../sensors/types/SensorRoot.types'; +import {SensorDryRunDialog} from '../ticks/SensorDryRunDialog'; import {TickStatusTag} from '../ticks/TickStatusTag'; import {RowCell} from '../ui/VirtualizedTable'; import {SENSOR_TYPE_META, SINGLE_SENSOR_QUERY} from '../workspace/VirtualizedSensorRow'; @@ -37,6 +38,8 @@ export const VirtualizedAutomationSensorRow = forwardRef( (props: Props, ref: React.ForwardedRef) => { const {index, name, repoAddress, checked, onToggleChecked} = props; + const [showTestTickDialog, setShowTestTickDialog] = useState(false); + const [querySensor, sensorQueryResult] = useLazyQuery< SingleSensorQuery, SingleSensorQueryVariables @@ -83,6 +86,12 @@ export const VirtualizedAutomationSensorRow = forwardRef( return data.sensorOrError; }, [data]); + const cursor = + sensorData && + sensorData.sensorState.typeSpecificData && + sensorData.sensorState.typeSpecificData.__typename === 'SensorData' && + sensorData.sensorState.typeSpecificData.lastCursor; + const onChange = (e: React.FormEvent) => { if (onToggleChecked && e.target instanceof HTMLInputElement) { const {checked} = e.target; @@ -132,15 +141,38 @@ export const VirtualizedAutomationSensorRow = forwardRef( - {/* Keyed so that a new switch is always rendered, otherwise it's reused and animates on/off */} + {/* Left aligned content */} + + {/* Keyed so that a new switch is always rendered, otherwise it's reused and animates on/off */} + {sensorData ? ( + + ) : ( +
+ )} + + + + + {/* Right aligned content */} {sensorData ? ( - + + + ) : (
)} - - - @@ -196,6 +228,16 @@ export const VirtualizedAutomationSensorRow = forwardRef( )} + { + setShowTestTickDialog(false); + }} + currentCursor={cursor || ''} + name={sensorData?.name || ''} + repoAddress={repoAddress} + jobName={sensorData?.targets?.[0]?.pipelineName || ''} + />
); },