Skip to content

Commit

Permalink
sofar
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Mar 6, 2024
1 parent 775d766 commit 0ab225b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const ChangedReasonsTag = ({
if (!changedReasons) {
return null;
}
console.log({changedReasons});
return (
<ChangedReasonsPopover changedReasons={changedReasons} assetKey={assetKey}>
<BaseTag
Expand Down
26 changes: 11 additions & 15 deletions js_modules/dagster-ui/packages/ui-core/src/assets/Stale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import styled from 'styled-components';

import {assetDetailsPathForKey} from './assetDetailsPathForKey';
import {LiveDataForNode, displayNameForAssetKey} from '../asset-graph/Utils';
import {AssetNodeKeyFragment} from '../asset-graph/types/AssetNode.types';
import {AssetKeyInput, StaleCauseCategory, StaleStatus} from '../graphql/types';
import {numberFormatter} from '../ui/formatters';

Expand Down Expand Up @@ -225,11 +224,7 @@ const StaleCausesPopoverSummary = ({
flex={{direction: 'row', alignItems: 'center', gap: 4}}
key={idx}
>
<StaleReason
reason={cause.reason}
dependency={cause.dependency}
assetKey={assetKey}
/>
<StaleReason cause={cause} />
</Box>
))}
</Box>
Expand All @@ -239,16 +234,17 @@ const StaleCausesPopoverSummary = ({
);
};

const StaleReason = ({
reason,
dependency,
}: {
assetKey: AssetKeyInput;
reason: string;
dependency: AssetNodeKeyFragment | null;
}) => {
const StaleReason = ({cause}: {cause: NonNullable<StaleDataForNode['staleCauses']>[0]}) => {
const {dependency, reason, key} = cause;
if (!dependency) {
return <Caption>{` ${reason}`}</Caption>;
return (
<>
<Link to={assetDetailsPathForKey(key)}>
<Tag icon="asset">{displayNameForAssetKey(key)}</Tag>
</Link>
<Caption>{` ${reason}`}</Caption>
</>
);
}

const dependencyName = displayNameForAssetKey(dependency);
Expand Down

0 comments on commit 0ab225b

Please sign in to comment.