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 03c1ef0c5956b..14a6fce6dce92 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,6 +1,7 @@ -import {Box, Button, Caption, Checkbox, MiddleTruncate, Tooltip} from '@dagster-io/ui-components'; -import {forwardRef, useCallback, useMemo, useState} from 'react'; +import {Box, Caption, Checkbox, MiddleTruncate, Tooltip} from '@dagster-io/ui-components'; +import {forwardRef, useCallback, useMemo} from 'react'; import {Link} from 'react-router-dom'; +import styled from 'styled-components'; import {AutomationTargetList} from './AutomationTargetList'; import {AutomationRowGrid} from './VirtualizedAutomationRow'; @@ -17,7 +18,7 @@ import { ScheduleAssetSelectionQuery, ScheduleAssetSelectionQueryVariables, } from '../schedules/types/ScheduleAssetSelectionsQuery.types'; -import {EvaluateScheduleDialog} from '../ticks/EvaluateScheduleDialog'; +import {EvaluateTickButtonSchedule} from '../ticks/EvaluateTickButtonSchedule'; import {TickStatusTag} from '../ticks/TickStatusTag'; import {RowCell} from '../ui/VirtualizedTable'; import {SINGLE_SCHEDULE_QUERY} from '../workspace/VirtualizedScheduleRow'; @@ -41,8 +42,6 @@ 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 @@ -155,14 +154,13 @@ export const VirtualizedAutomationScheduleRow = forwardRef( {/* Right aligned content */} - + + + @@ -230,17 +228,13 @@ export const VirtualizedAutomationScheduleRow = forwardRef( )} - { - setShowTestTickDialog(false); - }} - name={scheduleData?.name || ''} - repoAddress={repoAddress} - jobName={scheduleData?.pipelineName || ''} - /> ); }, ); + +const EvaluateTickButtonScheduleWrapper = styled.div` + button { + height: 24px; + } +`; 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 5900d55e031f9..6a00524e7794b 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,13 @@ -import {Box, Button, Checkbox, MiddleTruncate, Tag, Tooltip} from '@dagster-io/ui-components'; -import {forwardRef, useCallback, useMemo, useState} from 'react'; +import {Box, Checkbox, MiddleTruncate, Tag, Tooltip} from '@dagster-io/ui-components'; +import {forwardRef, useCallback, useMemo} from 'react'; import {Link} from 'react-router-dom'; +import styled from 'styled-components'; import {AutomationTargetList} from './AutomationTargetList'; import {AutomationRowGrid} from './VirtualizedAutomationRow'; import {useLazyQuery} from '../apollo-client'; import {FIFTEEN_SECONDS, useQueryRefreshAtInterval} from '../app/QueryRefresh'; -import {InstigationStatus, SensorType} from '../graphql/types'; +import {InstigationStatus} from '../graphql/types'; import {LastRunSummary} from '../instance/LastRunSummary'; import {SENSOR_ASSET_SELECTIONS_QUERY} from '../sensors/SensorRoot'; import {SensorSwitch} from '../sensors/SensorSwitch'; @@ -14,7 +15,7 @@ import { SensorAssetSelectionQuery, SensorAssetSelectionQueryVariables, } from '../sensors/types/SensorRoot.types'; -import {SensorDryRunDialog} from '../ticks/SensorDryRunDialog'; +import {EvaluateTickButtonSensor} from '../ticks/EvaluateTickButtonSensor'; import {TickStatusTag} from '../ticks/TickStatusTag'; import {RowCell} from '../ui/VirtualizedTable'; import {SENSOR_TYPE_META, SINGLE_SENSOR_QUERY} from '../workspace/VirtualizedSensorRow'; @@ -38,8 +39,6 @@ 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 @@ -155,21 +154,15 @@ export const VirtualizedAutomationSensorRow = forwardRef( {/* Right aligned content */} {sensorData ? ( - - - + + + ) : (
)} @@ -228,17 +221,13 @@ export const VirtualizedAutomationSensorRow = forwardRef( )} - { - setShowTestTickDialog(false); - }} - currentCursor={cursor || ''} - name={sensorData?.name || ''} - repoAddress={repoAddress} - jobName={sensorData?.targets?.[0]?.pipelineName || ''} - />
); }, ); + +const EvaluateTickButtonSensorWrapper = styled.div` + button { + height: 24px; + } +`; diff --git a/js_modules/dagster-ui/packages/ui-core/src/schedules/ScheduleDetails.tsx b/js_modules/dagster-ui/packages/ui-core/src/schedules/ScheduleDetails.tsx index 93f22553610ed..4957075f8d135 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/schedules/ScheduleDetails.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/schedules/ScheduleDetails.tsx @@ -1,6 +1,5 @@ import { Box, - Button, Code, Group, Heading, @@ -8,7 +7,6 @@ import { PageHeader, Tag, } from '@dagster-io/ui-components'; -import {useState} from 'react'; import {Link} from 'react-router-dom'; import styled from 'styled-components'; @@ -23,7 +21,7 @@ import {AutomationTargetList} from '../automation/AutomationTargetList'; import {AutomationAssetSelectionFragment} from '../automation/types/AutomationAssetSelectionFragment.types'; import {InstigationStatus} from '../graphql/types'; import {RepositoryLink} from '../nav/RepositoryLink'; -import {EvaluateScheduleDialog} from '../ticks/EvaluateScheduleDialog'; +import {EvaluateTickButtonSchedule} from '../ticks/EvaluateTickButtonSchedule'; import {TickStatusTag} from '../ticks/TickStatusTag'; import {RepoAddress} from '../workspace/types'; @@ -42,8 +40,6 @@ export const ScheduleDetails = (props: { const latestTick = ticks.length > 0 ? ticks[0] : null; const running = status === InstigationStatus.RUNNING; - const [showTestTickDialog, setShowTestTickDialog] = useState(false); - return ( <> - + } /> - { - setShowTestTickDialog(false); - }} - name={schedule.name} - repoAddress={repoAddress} - jobName={pipelineName} - /> {schedule.description ? ( diff --git a/js_modules/dagster-ui/packages/ui-core/src/sensors/SensorDetails.tsx b/js_modules/dagster-ui/packages/ui-core/src/sensors/SensorDetails.tsx index e1dfccab4bf9c..2e2d005dac948 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/sensors/SensorDetails.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/sensors/SensorDetails.tsx @@ -17,6 +17,7 @@ import {EditCursorDialog} from './EditCursorDialog'; import {SensorMonitoredAssets} from './SensorMonitoredAssets'; import {SensorResetButton} from './SensorResetButton'; import {SensorSwitch} from './SensorSwitch'; +import {EvaluateTickButtonSensor} from '../ticks/EvaluateTickButtonSensor'; import {SensorFragment} from './types/SensorFragment.types'; import {usePermissionsForLocation} from '../app/Permissions'; import {QueryRefreshCountdown, QueryRefreshState} from '../app/QueryRefresh'; @@ -25,7 +26,6 @@ import {AutomationAssetSelectionFragment} from '../automation/types/AutomationAs import {InstigationStatus, SensorType} from '../graphql/types'; import {RepositoryLink} from '../nav/RepositoryLink'; import {TimestampDisplay} from '../schedules/TimestampDisplay'; -import {SensorDryRunDialog} from '../ticks/SensorDryRunDialog'; import {TickStatusTag} from '../ticks/TickStatusTag'; import {RepoAddress} from '../workspace/types'; @@ -92,7 +92,6 @@ export const SensorDetails = ({ sensor.sensorState.typeSpecificData.__typename === 'SensorData' && sensor.sensorState.typeSpecificData.lastCursor; - const [showTestTickDialog, setShowTestTickDialog] = useState(false); const running = status === InstigationStatus.RUNNING; return ( @@ -114,33 +113,16 @@ export const SensorDetails = ({ right={ - - - + } /> - { - setShowTestTickDialog(false); - }} - currentCursor={cursor || ''} - name={sensor.name} - repoAddress={repoAddress} - jobName={sensor.targets?.[0]?.pipelineName || ''} - /> {sensor.description ? ( diff --git a/js_modules/dagster-ui/packages/ui-core/src/ticks/EvaluateTickButtonSchedule.tsx b/js_modules/dagster-ui/packages/ui-core/src/ticks/EvaluateTickButtonSchedule.tsx new file mode 100644 index 0000000000000..03ea49e3fdf2d --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/ticks/EvaluateTickButtonSchedule.tsx @@ -0,0 +1,41 @@ +import {Box, Button} from '@dagster-io/ui-components'; +import {useState} from 'react'; + +import {EvaluateScheduleDialog} from './EvaluateScheduleDialog'; +import {RepoAddress} from '../workspace/types'; + +interface EvaluateTickButtonScheduleProps { + name: string; + repoAddress: RepoAddress; + jobName: string; +} + +export const EvaluateTickButtonSchedule = ({ + name, + repoAddress, + jobName, +}: EvaluateTickButtonScheduleProps) => { + const [showTestTickDialog, setShowTestTickDialog] = useState(false); + + return ( + + + { + setShowTestTickDialog(false); + }} + name={name} + repoAddress={repoAddress} + jobName={jobName} + /> + + ); +}; diff --git a/js_modules/dagster-ui/packages/ui-core/src/ticks/EvaluateTickButtonSensor.tsx b/js_modules/dagster-ui/packages/ui-core/src/ticks/EvaluateTickButtonSensor.tsx new file mode 100644 index 0000000000000..cec8337183c97 --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/ticks/EvaluateTickButtonSensor.tsx @@ -0,0 +1,49 @@ +import {Box, Button, Tooltip} from '@dagster-io/ui-components'; +import {useState} from 'react'; + +import {SensorDryRunDialog} from './SensorDryRunDialog'; +import {SensorType} from '../graphql/types'; +import {RepoAddress} from '../workspace/types'; + +interface EvaluateTickButtonSensorProps { + cursor: string; + name: string; + repoAddress: RepoAddress; + jobName: string; + sensorType: SensorType; +} + +export const EvaluateTickButtonSensor = ({ + cursor, + name, + repoAddress, + jobName, + sensorType, +}: EvaluateTickButtonSensorProps) => { + const [showTestTickDialog, setShowTestTickDialog] = useState(false); + + return ( + + + + + setShowTestTickDialog(false)} + currentCursor={cursor} + name={name} + repoAddress={repoAddress} + jobName={jobName} + /> + + ); +};