Skip to content

Commit

Permalink
fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
clairelin135 committed Mar 12, 2024
1 parent 4810e90 commit 062e19e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const linkToAssetGraphComputeKind = (computeKind: string) => {
})}`;
};

const linkToCodeLocation = (repoAddress: RepoAddress) => {
export const linkToCodeLocation = (repoAddress: RepoAddress) => {
return `/locations/${repoAddressAsURLString(repoAddress)}/assets`;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import {
import {useIndexedDBCachedQuery} from './useIndexedDBCachedQuery';
import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorFragment';
import {displayNameForAssetKey, isHiddenAssetGroupJob} from '../asset-graph/Utils';
import {GroupMetadata, buildAssetCountBySection} from '../assets/AssetsOverview';
import {
GroupMetadata,
buildAssetCountBySection,
linkToCodeLocation,
} from '../assets/AssetsOverview';
import {assetDetailsPathForKey} from '../assets/assetDetailsPathForKey';
import {buildRepoPathForHuman} from '../workspace/buildRepoAddress';
import {workspacePath} from '../workspace/workspacePath';
Expand All @@ -28,6 +32,12 @@ const linkToAssetTableWithComputeKindFilter = (computeKind: string) => {
})}`;
};

const linkToAssetTableWithOwnerFilter = (owner: string) => {
return `/assets?${qs.stringify({
owners: JSON.stringify([owner]),
})}`;
};

const primaryDataToSearchResults = (input: {data?: SearchPrimaryQuery}) => {
const {data} = input;

Expand Down Expand Up @@ -201,8 +211,7 @@ const secondaryDataToSearchResults = (
),
description: '',
type: AssetFilterSearchResultType.CodeLocation,
// TODO display correct link once https://github.com/dagster-io/dagster/pull/20342 lands
href: '/assets',
href: linkToCodeLocation(codeLocationAssetCount.repoAddress),
numResults: codeLocationAssetCount.assetCount,
}),
);
Expand All @@ -222,8 +231,7 @@ const secondaryDataToSearchResults = (
label: owner,
description: '',
type: AssetFilterSearchResultType.Owner,
// TODO display correct link once https://github.com/dagster-io/dagster/pull/20342 lands
href: '/assets',
href: linkToAssetTableWithOwnerFilter(owner),
numResults: count,
}),
);
Expand Down

0 comments on commit 062e19e

Please sign in to comment.