Skip to content

Commit

Permalink
convert to metadata type
Browse files Browse the repository at this point in the history
  • Loading branch information
benpankow committed Apr 29, 2024
1 parent 1a88fee commit 6b3d071
Show file tree
Hide file tree
Showing 33 changed files with 2,555 additions and 29 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions js_modules/dagster-ui/packages/ui-core/src/assets/AssetView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ import {
} from '../asset-graph/Utils';
import {useAssetGraphData} from '../asset-graph/useAssetGraphData';
import {StaleReasonsTag} from '../assets/Stale';
import {CodeLink, CodeLinkData} from '../code-links/CodeLink';
import {CodeLink} from '../code-links/CodeLink';
import {AssetComputeKindTag} from '../graph/OpTags';
import {JsonMetadataEntry} from '../graphql/types';
import {SourceMetadataEntry} from '../graphql/types';
import {useQueryPersistedState} from '../hooks/useQueryPersistedState';
import {isCanonicalCodeSourceEntry} from '../metadata/TableSchema';
import {RepositoryLink} from '../nav/RepositoryLink';
Expand Down Expand Up @@ -280,11 +280,8 @@ export const AssetView = ({assetKey, trace, headerBreadcrumbs}: Props) => {

const assetMetadata = definition && metadataForAssetNode(definition).assetMetadata;
const codeSource = assetMetadata?.find((m) => isCanonicalCodeSourceEntry(m)) as
| JsonMetadataEntry
| SourceMetadataEntry
| undefined;
const codeSourceUrlsData = codeSource
? (JSON.parse(codeSource.jsonString) as CodeLinkData)
: undefined;

return (
<Box
Expand All @@ -311,8 +308,8 @@ export const AssetView = ({assetKey, trace, headerBreadcrumbs}: Props) => {
}
right={
<Box style={{margin: '-4px 0'}} flex={{direction: 'row', gap: 8}}>
{codeSourceUrlsData && Object.keys(codeSourceUrlsData).length > 0 && (
<CodeLink codeLinkData={codeSourceUrlsData} />
{codeSource && Object.keys(codeSource.sources).length > 0 && (
<CodeLink codeLinkData={codeSource} />
)}
{definition && definition.isObservable ? (
<LaunchAssetObservationButton
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6b3d071

Please sign in to comment.