Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Nov 17, 2024
1 parent 9ea4930 commit 0bdb899
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,10 @@ export const useAssetSelectionFiltering = <
);
}, [graphAssetKeys, assetsByKey]);

return {filtered, fetchResult, graphQueryItems};
const filteredByKey = useMemo(
() => Object.fromEntries(filtered.map((asset) => [tokenForAssetKey(asset.key), asset])),
[filtered],
);

return {filtered, filteredByKey, fetchResult, graphAssetKeys, graphQueryItems};
};
3 changes: 2 additions & 1 deletion js_modules/dagster-ui/packages/ui-core/src/search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SearchScheduleFragment,
SearchSensorFragment,
} from './types/useGlobalSearch.types';
import {DefinitionTag} from '../graphql/types';
import {AssetKey, DefinitionTag} from '../graphql/types';

export enum SearchResultType {
AssetGroup,
Expand Down Expand Up @@ -54,6 +54,7 @@ export function isAssetFilterSearchResultType(
}

export type SearchResult = {
key?: AssetKey;
label: string;
description: string;
href: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ const secondaryDataToSearchResults = (
const assets: SearchResult[] = nodes
.filter(({definition}) => definition !== null)
.map((node) => ({
key: node.key,
label: displayNameForAssetKey(node.key),
description: `Asset in ${buildRepoPathForHuman(
node.definition!.repository.name,
Expand Down

0 comments on commit 0bdb899

Please sign in to comment.