Skip to content

Commit

Permalink
ts
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Jan 10, 2024
1 parent 9389f57 commit 89f4f2b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -87,6 +88,9 @@ export const AutomaterializeLeftList = (props: ListProps) => {
</Link>
</Box>
<Box flex={{direction: 'column'}}>
{evaluations.length === 0 ? (
<Caption color={colorTextLight()}>No evaluations</Caption>
) : null}
{evaluations.map((evaluation) => {
const isSelected = selectedEvaluation?.id === evaluation.id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import {gql, useQuery} from '@apollo/client';
import {
BaseTag,
Body2,
Box,
ButtonLink,
Icon,
MenuItem,
MiddleTruncate,
Expand All @@ -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';
Expand Down Expand Up @@ -140,6 +143,29 @@ export const AutomaterializeMiddlePanel = (props: Props) => {
_selectedEvaluation ??
evaluations.find((evaluation) => evaluation.evaluationId === selectedEvaluationId);

if (!selectedEvaluationId && !evaluations.length) {
return (
<Box flex={{direction: 'column', grow: 1}}>
<Box flex={{direction: 'row', justifyContent: 'center'}} padding={{vertical: 24}}>
<NonIdealState
icon="sensors"
title="No evaluations"
description={
<Body2>
<Box flex={{direction: 'column', gap: 6}}>
This asset’s automation policy has not been evaluated yet. Make sure your
automation sensor is running.
</Box>
<AnchorButton to="/asset-groups">Manage sensor</AnchorButton>
<a href="">Learn more about automation policies</a>
</Body2>
}
/>
</Box>
</Box>
);
}

return (
<AutomaterializeMiddlePanelWithData
selectedEvaluation={selectedEvaluation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export const Evaluations = {
}),
currentAutoMaterializeEvaluationId: 1000,
}),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords(),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords() as any,
},
});
},
Expand All @@ -268,7 +268,7 @@ export const Evaluations = {
rules: BASE_AUTOMATERIALIZE_RULES,
}),
}),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords(),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords() as any,
},
});
},
Expand All @@ -285,7 +285,7 @@ export const Evaluations = {
rules: [...BASE_AUTOMATERIALIZE_RULES, DISCARD_RULE],
}),
}),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords(),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords() as any,
},
});
},
Expand All @@ -302,7 +302,7 @@ export const Evaluations = {
rules: [...BASE_AUTOMATERIALIZE_RULES, DISCARD_RULE],
}),
}),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords(),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords() as any,
},
});
},
Expand All @@ -319,7 +319,7 @@ export const Evaluations = {
rules: [...BASE_AUTOMATERIALIZE_RULES, DISCARD_RULE],
}),
}),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords(),
assetConditionEvaluationRecordsOrError: buildAssetConditionEvaluationRecords() as any,
},
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const WithPartitions = () => {
return (
<div style={{width: '320px'}}>
<AutomaterializeLeftList
evaluations={evaluations}
evaluations={evaluations as any}
onSelectEvaluation={(evaluation: AssetConditionEvaluationRecordFragment) =>
setSelectedEvaluation(evaluation)
}
Expand All @@ -43,7 +43,7 @@ export const NoPartitions = () => {
return (
<div style={{width: '320px'}}>
<AutomaterializeLeftList
evaluations={evaluations}
evaluations={evaluations as any}
onSelectEvaluation={(evaluation: AssetConditionEvaluationRecordFragment) =>
setSelectedEvaluation(evaluation)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 89f4f2b

Please sign in to comment.