From 89f4f2b6bf46408fba41651e9390db9dd593f8c5 Mon Sep 17 00:00:00 2001 From: Marco Salazar Date: Wed, 10 Jan 2024 17:15:44 -0500 Subject: [PATCH] ts --- .../AutomaterializeLeftPanel.tsx | 4 +++ .../AutomaterializeMiddlePanel.tsx | 26 +++++++++++++++++++ .../AutoMaterializePolicyPage.fixtures.ts | 10 +++---- .../AutomaterializeLeftList.stories.tsx | 4 +-- .../AutoMaterializePolicyPage/types.tsx | 3 +-- 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeLeftPanel.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeLeftPanel.tsx index e9a6063f2afc2..2860a3e52ad10 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeLeftPanel.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeLeftPanel.tsx @@ -17,6 +17,7 @@ import { colorTextBlue, colorTextDefault, colorTextGreen, + colorTextLight, } from '@dagster-io/ui-components'; import * as React from 'react'; import {Link} from 'react-router-dom'; @@ -87,6 +88,9 @@ export const AutomaterializeLeftList = (props: ListProps) => { + {evaluations.length === 0 ? ( + No evaluations + ) : null} {evaluations.map((evaluation) => { const isSelected = selectedEvaluation?.id === evaluation.id; diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeMiddlePanel.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeMiddlePanel.tsx index 4e7b4716c7b3c..4543fc79f847a 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeMiddlePanel.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/AutomaterializeMiddlePanel.tsx @@ -1,7 +1,9 @@ import {gql, useQuery} from '@apollo/client'; import { BaseTag, + Body2, Box, + ButtonLink, Icon, MenuItem, MiddleTruncate, @@ -24,6 +26,7 @@ import {ErrorWrapper} from '../../app/PythonErrorInfo'; import {formatElapsedTimeWithMsec} from '../../app/Util'; import {Timestamp} from '../../app/time/Timestamp'; import {DimensionPartitionKeys} from '../../graphql/types'; +import {AnchorButton} from '../../ui/AnchorButton'; import {numberFormatter} from '../../ui/formatters'; import {AssetKey} from '../types'; import {AssetViewDefinitionNodeFragment} from '../types/AssetView.types'; @@ -140,6 +143,29 @@ export const AutomaterializeMiddlePanel = (props: Props) => { _selectedEvaluation ?? evaluations.find((evaluation) => evaluation.evaluationId === selectedEvaluationId); + if (!selectedEvaluationId && !evaluations.length) { + return ( + + + + + This asset’s automation policy has not been evaluated yet. Make sure your + automation sensor is running. + + Manage sensor + Learn more about automation policies + + } + /> + + + ); + } + return ( { return (
setSelectedEvaluation(evaluation) } @@ -43,7 +43,7 @@ export const NoPartitions = () => { return (
setSelectedEvaluation(evaluation) } diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types.tsx index 38a105f1dce4b..ddffad06859c6 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/AutoMaterializePolicyPage/types.tsx @@ -1,8 +1,7 @@ import {PartitionKeyRange} from '../../graphql/types'; +import {AutoMaterializeEvaluationRecordItemFragment} from '../AutoMaterializePolicyPageOld/types/GetEvaluationsQuery.types'; import {AssetKey} from '../types'; -import {AutoMaterializeEvaluationRecordItemFragment} from './types/GetEvaluationsQuery.types'; - export type NoConditionsMetEvaluation = { __typename: 'no_conditions_met'; evaluationId: number;