Skip to content

Commit

Permalink
[3/k][ui] Hide kind tags from search results, filter list
Browse files Browse the repository at this point in the history
  • Loading branch information
benpankow committed Sep 6, 2024
1 parent f803e74 commit 857f297
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {COMMON_COLLATOR} from '../app/Util';
import {AssetTableDefinitionFragment} from '../assets/types/AssetTableFragment.types';
import {isKindTag} from '../graph/KindTags';
import {DefinitionTag} from '../graphql/types';
import {buildTagString} from '../ui/tagAsString';
import {buildRepoPathForHuman} from '../workspace/buildRepoAddress';
Expand Down Expand Up @@ -96,6 +97,10 @@ export function buildAssetCountBySection(assets: AssetDefinitionMetadata[]): Ass
}

assetDefinition.tags.forEach((tag) => {
// Skip kind tags
if (isKindTag(tag)) {
return;
}
const stringifiedTag = JSON.stringify(tag);
assetCountByTag.increment(stringifiedTag);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import isEqual from 'lodash/isEqual';
import memoize from 'lodash/memoize';
import {useMemo} from 'react';

import {isKindTag} from '../../graph/KindTags';
import {DefinitionTag} from '../../graphql/types';
import {TruncatedTextWithFullTextOnHover} from '../../nav/getLeftNavItemsForOption';
import {StaticBaseConfig, useStaticSetFilter} from '../BaseFilters/useStaticSetFilter';
Expand Down Expand Up @@ -84,7 +85,12 @@ export function useAssetTagsForAssets(
Array.from(
new Set(
assets
.flatMap((a) => a.definition?.tags?.map((tag) => JSON.stringify(tag)) ?? [])
.flatMap(
(a) =>
a.definition?.tags
?.filter((tag) => !isKindTag(tag))
.map((tag) => JSON.stringify(tag)) ?? [],
)
.filter((o) => o),
),
)
Expand Down

0 comments on commit 857f297

Please sign in to comment.