-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dagit] Add top level Asset Group pages, Asset Groups in left nav (#8203
) * BG Asset Groups UI 1 * Tags in the top nav of Asset Group + Asset Details for corss linking * Polish * Add subheaders for Asset Groups and Jobs in the left nav # Conflicts: # js_modules/dagit/packages/core/src/nav/FlatContentList.tsx # js_modules/dagit/packages/core/src/ui/SectionedLeftNav.tsx * Add asset group to the “defined in” column of the asset catalog * PR feedback Co-authored-by: bengotow <bgotow@elementl.com>
- Loading branch information
Showing
33 changed files
with
658 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
js_modules/dagit/packages/core/src/asset-graph/types/AssetGraphQuery.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
js_modules/dagit/packages/core/src/assets/AssetEntryRoot.tsx
This file was deleted.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
js_modules/dagit/packages/core/src/assets/AssetGroupRoot.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import {Box, Heading, Page, PageHeader, Tabs, Tag} from '@dagster-io/ui'; | ||
import * as React from 'react'; | ||
import {useHistory, useParams} from 'react-router-dom'; | ||
|
||
import {AssetGraphExplorer} from '../asset-graph/AssetGraphExplorer'; | ||
import {useDocumentTitle} from '../hooks/useDocumentTitle'; | ||
import {useQueryPersistedState} from '../hooks/useQueryPersistedState'; | ||
import {RepositoryLink} from '../nav/RepositoryLink'; | ||
import {explorerPathFromString, explorerPathToString} from '../pipelines/PipelinePathUtils'; | ||
import {TabLink} from '../ui/TabLink'; | ||
import {RepoAddress} from '../workspace/types'; | ||
import {workspacePathFromAddress} from '../workspace/workspacePath'; | ||
|
||
import {AssetsCatalogTable} from './AssetsCatalogTable'; | ||
|
||
export const AssetGroupRoot: React.FC<{repoAddress: RepoAddress}> = ({repoAddress}) => { | ||
const params = useParams(); | ||
const history = useHistory(); | ||
const explorerPath = explorerPathFromString(params[0]); | ||
const {pipelineName: groupName, opNames: prefixPath} = explorerPath; | ||
|
||
useDocumentTitle(`Asset Group: ${groupName}`); | ||
|
||
const [tab = 'lineage'] = useQueryPersistedState<'lineage' | 'list'>({queryKey: 'tab'}); | ||
const groupSelector = React.useMemo( | ||
() => ({ | ||
groupName, | ||
repositoryLocationName: repoAddress.location, | ||
repositoryName: repoAddress.name, | ||
}), | ||
[groupName, repoAddress], | ||
); | ||
|
||
return ( | ||
<Page style={{display: 'flex', flexDirection: 'column', paddingBottom: 0}}> | ||
<PageHeader | ||
title={<Heading>{groupName}</Heading>} | ||
tags={ | ||
<Tag icon="asset_group"> | ||
Asset Group in <RepositoryLink repoAddress={repoAddress} /> | ||
</Tag> | ||
} | ||
tabs={ | ||
<Box flex={{direction: 'row', justifyContent: 'space-between', alignItems: 'flex-end'}}> | ||
<Tabs selectedTabId={tab}> | ||
<TabLink | ||
id="lineage" | ||
title="Lineage" | ||
to={workspacePathFromAddress(repoAddress, `/asset-groups/${groupName}?tab=lineage`)} | ||
/> | ||
<TabLink | ||
id="list" | ||
title="List" | ||
to={workspacePathFromAddress(repoAddress, `/asset-groups/${groupName}?tab=list`)} | ||
/> | ||
</Tabs> | ||
</Box> | ||
} | ||
/> | ||
{tab === 'lineage' ? ( | ||
<AssetGraphExplorer | ||
fetchOptions={{groupSelector}} | ||
options={{preferAssetRendering: true, explodeComposites: true}} | ||
explorerPath={explorerPath} | ||
onChangeExplorerPath={(path, mode) => { | ||
history[mode]( | ||
workspacePathFromAddress(repoAddress, `/asset-groups/${explorerPathToString(path)}`), | ||
); | ||
}} | ||
/> | ||
) : ( | ||
<AssetsCatalogTable prefixPath={prefixPath.filter(Boolean)} groupSelector={groupSelector} /> | ||
)} | ||
</Page> | ||
); | ||
}; |
Oops, something went wrong.
7fa711e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
dagit-storybook – ./js_modules/dagit/packages/ui
dagit-storybook.vercel.app
dagit-storybook-git-master-elementl.vercel.app
dagit-storybook-elementl.vercel.app