Skip to content

Commit

Permalink
[dagit] Move asset-graph out of workspace dir, non-graph code to /ass…
Browse files Browse the repository at this point in the history
…ets (#7373)
  • Loading branch information
bengotow committed Apr 12, 2022
1 parent bdb8126 commit 925ddbc
Show file tree
Hide file tree
Showing 65 changed files with 138 additions and 178 deletions.
2 changes: 1 addition & 1 deletion js_modules/dagit/packages/core/src/app/FallthroughRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {Box, ExternalAnchorButton, Colors, NonIdealState, Spinner} from '@dagste
import * as React from 'react';
import {Redirect, Route, Switch, useLocation} from 'react-router-dom';

import {__ASSET_GROUP} from '../asset-graph/Utils';
import {WorkspaceContext} from '../workspace/WorkspaceContext';
import {__ASSET_GROUP} from '../workspace/asset-graph/Utils';
import {workspacePipelinePath} from '../workspace/workspacePath';

const InstanceRedirect = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components/macro';
import {buildSVGPath} from './Utils';
import {AssetLayoutEdge} from './layout';

export const AssetLinks: React.FC<{edges: AssetLayoutEdge[]}> = React.memo(({edges}) => (
export const AssetEdges: React.FC<{edges: AssetLayoutEdge[]}> = React.memo(({edges}) => (
<>
<defs>
<marker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,42 @@ import _, {flatMap, uniq, uniqBy, without} from 'lodash';
import React from 'react';
import styled from 'styled-components/macro';

import {GraphQueryItem} from '../../app/GraphQueryImpl';
import {GraphQueryItem} from '../app/GraphQueryImpl';
import {
FIFTEEN_SECONDS,
QueryRefreshCountdown,
QueryRefreshState,
useQueryRefreshAtInterval,
} from '../../app/QueryRefresh';
import {AssetKey} from '../../assets/types';
import {SVGViewport} from '../../graph/SVGViewport';
import {useAssetLayout} from '../../graph/asyncGraphLayout';
import {useDocumentTitle} from '../../hooks/useDocumentTitle';
} from '../app/QueryRefresh';
import {LaunchAssetExecutionButton} from '../assets/LaunchAssetExecutionButton';
import {AssetKey} from '../assets/types';
import {SVGViewport} from '../graph/SVGViewport';
import {useAssetLayout} from '../graph/asyncGraphLayout';
import {useDocumentTitle} from '../hooks/useDocumentTitle';
import {
GraphExplorerOptions,
OptionsOverlay,
QueryOverlay,
RightInfoPanel,
RightInfoPanelContent,
} from '../../pipelines/GraphExplorer';
} from '../pipelines/GraphExplorer';
import {
EmptyDAGNotice,
EntirelyFilteredDAGNotice,
LargeDAGNotice,
LoadingNotice,
} from '../../pipelines/GraphNotices';
import {ExplorerPath} from '../../pipelines/PipelinePathUtils';
import {SidebarPipelineOrJobOverview} from '../../pipelines/SidebarPipelineOrJobOverview';
import {GraphExplorerSolidHandleFragment} from '../../pipelines/types/GraphExplorerSolidHandleFragment';
import {useDidLaunchEvent} from '../../runs/RunUtils';
import {PipelineSelector} from '../../types/globalTypes';
import {GraphQueryInput} from '../../ui/GraphQueryInput';
import {Loading} from '../../ui/Loading';

import {AssetLinks} from './AssetLinks';
} from '../pipelines/GraphNotices';
import {ExplorerPath} from '../pipelines/PipelinePathUtils';
import {SidebarPipelineOrJobOverview} from '../pipelines/SidebarPipelineOrJobOverview';
import {GraphExplorerSolidHandleFragment} from '../pipelines/types/GraphExplorerSolidHandleFragment';
import {useDidLaunchEvent} from '../runs/RunUtils';
import {PipelineSelector} from '../types/globalTypes';
import {GraphQueryInput} from '../ui/GraphQueryInput';
import {Loading} from '../ui/Loading';

import {AssetEdges} from './AssetEdges';
import {AssetNode} from './AssetNode';
import {ForeignNode} from './ForeignNode';
import {LaunchAssetExecutionButton} from './LaunchAssetExecutionButton';
import {OmittedAssetsNotice} from './OmittedAssetsNotice';
import {SidebarAssetInfo} from './SidebarAssetInfo';
import {
Expand Down Expand Up @@ -253,7 +253,7 @@ const AssetGraphExplorerWithData: React.FC<
>
{({scale: _scale}, viewportRect) => (
<SVGContainer width={layout.width} height={layout.height}>
<AssetLinks edges={layout.edges} />
<AssetEdges edges={layout.edges} />

{Object.values(layout.nodes).map(({id, bounds}, index) => {
const graphNode = assetGraphData.nodes[id];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import React, {CSSProperties} from 'react';
import {Link} from 'react-router-dom';
import styled from 'styled-components/macro';

import {LATEST_MATERIALIZATION_METADATA_FRAGMENT} from '../../assets/LastMaterializationMetadata';
import {NodeHighlightColors} from '../../graph/OpNode';
import {OpTags} from '../../graph/OpTags';
import {METADATA_ENTRY_FRAGMENT} from '../../metadata/MetadataEntry';
import {titleForRun} from '../../runs/RunUtils';
import {TimeElapsed} from '../../runs/TimeElapsed';
import {TimestampDisplay} from '../../schedules/TimestampDisplay';
import {markdownToPlaintext} from '../../ui/markdownToPlaintext';
import {buildRepoAddress} from '../buildRepoAddress';
import {workspacePath, workspacePipelinePathGuessRepo} from '../workspacePath';
import {LATEST_MATERIALIZATION_METADATA_FRAGMENT} from '../assets/LastMaterializationMetadata';
import {NodeHighlightColors} from '../graph/OpNode';
import {OpTags} from '../graph/OpTags';
import {METADATA_ENTRY_FRAGMENT} from '../metadata/MetadataEntry';
import {titleForRun} from '../runs/RunUtils';
import {TimeElapsed} from '../runs/TimeElapsed';
import {TimestampDisplay} from '../schedules/TimestampDisplay';
import {markdownToPlaintext} from '../ui/markdownToPlaintext';
import {buildRepoAddress} from '../workspace/buildRepoAddress';
import {workspacePath, workspacePipelinePathGuessRepo} from '../workspace/workspacePath';

import {displayNameForAssetKey, LiveDataForNode, __ASSET_GROUP} from './Utils';
import {AssetNodeFragment} from './types/AssetNodeFragment';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {gql, useQuery} from '@apollo/client';
import {Colors} from '@dagster-io/ui';
import React from 'react';
import styled from 'styled-components/macro';

import {Colors} from '../../../../ui/src';
import {AssetKey} from '../../assets/types';
import {AssetKey} from '../assets/types';

import {OmittedAssetCountQuery} from './types/OmittedAssetCountQuery';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import * as React from 'react';
import {Link} from 'react-router-dom';
import styled from 'styled-components/macro';

import {AssetEvents} from '../../assets/AssetEvents';
import {AssetEvents} from '../assets/AssetEvents';
import {
AssetMetadataTable,
ASSET_NODE_OP_METADATA_FRAGMENT,
metadataForAssetNode,
} from '../../assets/AssetMetadata';
import {PartitionHealthSummary, usePartitionHealthData} from '../../assets/PartitionHealthSummary';
import {AssetKey} from '../../assets/types';
import {DagsterTypeSummary} from '../../dagstertype/DagsterType';
import {DagsterTypeFragment} from '../../dagstertype/types/DagsterTypeFragment';
import {METADATA_ENTRY_FRAGMENT} from '../../metadata/MetadataEntry';
import {Description} from '../../pipelines/Description';
import {SidebarSection, SidebarTitle} from '../../pipelines/SidebarComponents';
import {pluginForMetadata} from '../../plugins';
import {buildRepoAddress} from '../buildRepoAddress';
import {RepoAddress} from '../types';
} from '../assets/AssetMetadata';
import {PartitionHealthSummary, usePartitionHealthData} from '../assets/PartitionHealthSummary';
import {AssetKey} from '../assets/types';
import {DagsterTypeSummary} from '../dagstertype/DagsterType';
import {DagsterTypeFragment} from '../dagstertype/types/DagsterTypeFragment';
import {METADATA_ENTRY_FRAGMENT} from '../metadata/MetadataEntry';
import {Description} from '../pipelines/Description';
import {SidebarSection, SidebarTitle} from '../pipelines/SidebarComponents';
import {pluginForMetadata} from '../plugins';
import {buildRepoAddress} from '../workspace/buildRepoAddress';
import {RepoAddress} from '../workspace/types';

import {LiveDataForNode, displayNameForAssetKey} from './Utils';
import {SidebarAssetFragment} from './types/SidebarAssetFragment';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {gql} from '@apollo/client';
import {pathVerticalDiagonal} from '@vx/shape';

import {AssetNodeDefinitionFragment} from '../../assets/types/AssetNodeDefinitionFragment';
import {AssetNodeDefinitionFragment} from '../assets/types/AssetNodeDefinitionFragment';

import {AssetGraphLiveQuery_assetNodes_assetMaterializations} from './types/AssetGraphLiveQuery';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dagre from 'dagre';

import {ILayout, IPoint} from '../../graph/layout';
import {ILayout, IPoint} from '../graph/layout';

import {GraphData, GraphNode, GraphId, displayNameForAssetKey} from './Utils';

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.

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.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {gql, useQuery} from '@apollo/client';
import React from 'react';

import {filterByQuery, GraphQueryItem} from '../../app/GraphQueryImpl';
import {PipelineSelector} from '../../types/globalTypes';
import {filterByQuery, GraphQueryItem} from '../app/GraphQueryImpl';
import {PipelineSelector} from '../types/globalTypes';

import {ASSET_NODE_FRAGMENT} from './AssetNode';
import {buildGraphData, tokenForAssetKey} from './Utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {gql, useApolloClient} from '@apollo/client';
import React from 'react';

import {AssetKeyInput} from '../../types/globalTypes';
import {AssetKeyInput} from '../types/globalTypes';

import {
AssetForNavigationQuery,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {gql, useQuery} from '@apollo/client';
import React from 'react';

import {AssetKeyInput, PipelineSelector} from '../../types/globalTypes';
import {AssetKeyInput, PipelineSelector} from '../types/globalTypes';

import {ASSET_NODE_LIVE_FRAGMENT} from './AssetNode';
import {buildLiveData, GraphData, REPOSITORY_LIVE_FRAGMENT} from './Utils';
Expand Down
6 changes: 3 additions & 3 deletions js_modules/dagit/packages/core/src/assets/AssetEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import {gql, useQuery} from '@apollo/client';
import {Box, ButtonGroup, Colors, NonIdealState, Spinner, Subheading} from '@dagster-io/ui';
import * as React from 'react';

import {LiveDataForNode} from '../asset-graph/Utils';
import {METADATA_ENTRY_FRAGMENT} from '../metadata/MetadataEntry';
import {SidebarSection} from '../pipelines/SidebarComponents';
import {RepositorySelector} from '../types/globalTypes';
import {CurrentRunsBanner} from '../workspace/asset-graph/CurrentRunsBanner';
import {FailedRunsSinceMaterializationBanner} from '../workspace/asset-graph/FailedRunsSinceMaterializationBanner';
import {LiveDataForNode} from '../workspace/asset-graph/Utils';

import {AssetEventsTable} from './AssetEventsTable';
import {ASSET_LINEAGE_FRAGMENT} from './AssetLineageElements';
import {AssetMaterializationGraphs} from './AssetMaterializationGraphs';
import {AssetViewParams} from './AssetView';
import {CurrentRunsBanner} from './CurrentRunsBanner';
import {FailedRunsSinceMaterializationBanner} from './FailedRunsSinceMaterializationBanner';
import {LatestMaterializationMetadata} from './LastMaterializationMetadata';
import {AssetEventGroup, groupByPartition} from './groupByPartition';
import {AssetKey} from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import {Link} from 'react-router-dom';
import styled from 'styled-components/macro';

import {Timestamp} from '../app/time/Timestamp';
import {__ASSET_GROUP} from '../asset-graph/Utils';
import {MetadataEntry} from '../metadata/MetadataEntry';
import {PipelineReference} from '../pipelines/PipelineReference';
import {RunStatusWithStats} from '../runs/RunStatusDots';
import {titleForRun} from '../runs/RunUtils';
import {isThisThingAJob, useRepository} from '../workspace/WorkspaceContext';
import {__ASSET_GROUP} from '../workspace/asset-graph/Utils';
import {buildRepoAddress} from '../workspace/buildRepoAddress';

import {AssetLineageElements} from './AssetLineageElements';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import {gql} from '@apollo/client';
import {Box, MetadataTable} from '@dagster-io/ui';
import * as React from 'react';

import {__ASSET_GROUP} from '../asset-graph/Utils';
import {DAGSTER_TYPE_FRAGMENT} from '../dagstertype/DagsterType';
import {DagsterTypeFragment} from '../dagstertype/types/DagsterTypeFragment';
import {MetadataEntry, METADATA_ENTRY_FRAGMENT} from '../metadata/MetadataEntry';
import {MetadataEntryFragment} from '../metadata/types/MetadataEntryFragment';
import {__ASSET_GROUP} from '../workspace/asset-graph/Utils';

import {AssetNodeOpMetadataFragment} from './types/AssetNodeOpMetadataFragment';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import {Box, Colors, Icon, Caption, Subheading, Mono} from '@dagster-io/ui';
import * as React from 'react';
import {Link} from 'react-router-dom';

import {DagsterTypeSummary} from '../dagstertype/DagsterType';
import {Description} from '../pipelines/Description';
import {instanceAssetsExplorerPathToURL} from '../pipelines/PipelinePathUtils';
import {PipelineReference} from '../pipelines/PipelineReference';
import {ASSET_NODE_FRAGMENT, ASSET_NODE_LIVE_FRAGMENT} from '../workspace/asset-graph/AssetNode';
import {ASSET_NODE_FRAGMENT, ASSET_NODE_LIVE_FRAGMENT} from '../asset-graph/AssetNode';
import {
displayNameForAssetKey,
isSourceAsset,
LiveData,
tokenForAssetKey,
__ASSET_GROUP,
} from '../workspace/asset-graph/Utils';
} from '../asset-graph/Utils';
import {DagsterTypeSummary} from '../dagstertype/DagsterType';
import {Description} from '../pipelines/Description';
import {instanceAssetsExplorerPathToURL} from '../pipelines/PipelinePathUtils';
import {PipelineReference} from '../pipelines/PipelineReference';
import {buildRepoAddress} from '../workspace/buildRepoAddress';
import {RepoAddress} from '../workspace/types';

Expand Down
6 changes: 3 additions & 3 deletions js_modules/dagit/packages/core/src/assets/AssetNodeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {Box} from '@dagster-io/ui';
import React from 'react';
import {useHistory} from 'react-router-dom';

import {AssetNode} from '../workspace/asset-graph/AssetNode';
import {ForeignNode} from '../workspace/asset-graph/ForeignNode';
import {LiveData, toGraphId} from '../workspace/asset-graph/Utils';
import {AssetNode} from '../asset-graph/AssetNode';
import {ForeignNode} from '../asset-graph/ForeignNode';
import {LiveData, toGraphId} from '../asset-graph/Utils';

import {AssetNodeDefinitionFragment_dependencies} from './types/AssetNodeDefinitionFragment';

Expand Down
2 changes: 1 addition & 1 deletion js_modules/dagit/packages/core/src/assets/AssetTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {Link} from 'react-router-dom';
import styled from 'styled-components/macro';

import {usePermissions} from '../app/Permissions';
import {tokenForAssetKey} from '../asset-graph/Utils';
import {useSelectionReducer} from '../hooks/useSelectionReducer';
import {RepositoryLink} from '../nav/RepositoryLink';
import {instanceAssetsExplorerPathToURL} from '../pipelines/PipelinePathUtils';
import {MenuLink} from '../ui/MenuLink';
import {markdownToPlaintext} from '../ui/markdownToPlaintext';
import {tokenForAssetKey} from '../workspace/asset-graph/Utils';

import {AssetLink} from './AssetLink';
import {AssetWipeDialog} from './AssetWipeDialog';
Expand Down

0 comments on commit 925ddbc

Please sign in to comment.