Skip to content

Commit

Permalink
[ui] Alerts: Component instead of hook for shared schedule/sensor
Browse files Browse the repository at this point in the history
[INTERNAL_BRANCH=dish/internal-component-not-hook]
  • Loading branch information
hellendag committed Feb 21, 2025
1 parent 21ce389 commit 8d09c6b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {RepoAddress} from '../workspace/types';

export interface Config {
export interface Props {
repoAddress: RepoAddress;
scheduleName: string;
}

export const useScheduleAlertDetails = (_config: Config) => null;
export const ScheduleAlertDetails = (_props: Props) => null;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Tag,
} from '@dagster-io/ui-components';
import {Link} from 'react-router-dom';
import {useScheduleAlertDetails} from 'shared/schedules/useScheduleAlertDetails.oss';
import {ScheduleAlertDetails} from 'shared/schedules/ScheduleAlertDetails.oss';
import styled from 'styled-components';

import {SchedulePartitionStatus} from './SchedulePartitionStatus';
Expand Down Expand Up @@ -41,11 +41,6 @@ export const ScheduleDetails = (props: {
const latestTick = ticks.length > 0 ? ticks[0] : null;
const running = status === InstigationStatus.RUNNING;

const alertDetails = useScheduleAlertDetails({
repoAddress,
scheduleName: name,
});

return (
<>
<PageHeader
Expand Down Expand Up @@ -173,7 +168,7 @@ export const ScheduleDetails = (props: {
<td>{executionTimezone}</td>
</tr>
) : null}
{alertDetails}
<ScheduleAlertDetails repoAddress={repoAddress} scheduleName={name} />
</tbody>
</MetadataTableWIP>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {RepoAddress} from '../workspace/types';

export interface Config {
export interface Props {
repoAddress: RepoAddress;
sensorName: string;
}

export const useSensorAlertDetails = (_config: Config) => null;
export const SensorAlertDetails = (_props: Props) => null;
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import {
} from '@dagster-io/ui-components';
import {useState} from 'react';
import {Link} from 'react-router-dom';
import {useSensorAlertDetails} from 'shared/sensors/useSensorAlertDetails.oss';
import {SensorAlertDetails} from 'shared/sensors/SensorAlertDetails.oss';
import styled from 'styled-components';

import {EditCursorDialog} from './EditCursorDialog';
import {SensorMonitoredAssets} from './SensorMonitoredAssets';
import {SensorResetButton} from './SensorResetButton';
import {SensorSwitch} from './SensorSwitch';
import {usePermissionsForLocation} from '../app/Permissions';
import {EvaluateTickButtonSensor} from '../ticks/EvaluateTickButtonSensor';
import {SensorFragment} from './types/SensorFragment.types';
import {usePermissionsForLocation} from '../app/Permissions';
import {QueryRefreshCountdown, QueryRefreshState} from '../app/QueryRefresh';
import {AutomationTargetList} from '../automation/AutomationTargetList';
import {AutomationAssetSelectionFragment} from '../automation/types/AutomationAssetSelectionFragment.types';
Expand Down Expand Up @@ -80,11 +80,6 @@ export const SensorDetails = ({
} = usePermissionsForLocation(repoAddress.location);
const {canUpdateSensorCursor} = permissions;

const alertDetails = useSensorAlertDetails({
repoAddress,
sensorName: sensor.name,
});

const [isCursorEditing, setCursorEditing] = useState(false);
const sensorSelector = {
sensorName: sensor.name,
Expand Down Expand Up @@ -239,7 +234,7 @@ export const SensorDetails = ({
</td>
</tr>
) : null}
{alertDetails}
<SensorAlertDetails repoAddress={repoAddress} sensorName={name} />
</tbody>
</MetadataTableWIP>
</>
Expand Down

0 comments on commit 8d09c6b

Please sign in to comment.