Skip to content

Commit

Permalink
[dagit] Hide __asset_group partition sets from search bar (#7556)
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow committed Apr 25, 2022
1 parent 65b8cbd commit 91ced9c
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions js_modules/dagit/packages/core/src/search/useRepoSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const bootstrapDataToSearchResults = (data?: SearchBootstrapQuery) => {
const repoPath = buildRepoPath(repoName, locationName);

const allPipelinesAndJobs = pipelines
.filter((item) => !isAssetGroup(item.name))
.reduce((flat, pipelineOrJob) => {
const {name, isJob} = pipelineOrJob;
return [
Expand All @@ -64,8 +65,7 @@ const bootstrapDataToSearchResults = (data?: SearchBootstrapQuery) => {
type: SearchResultType.Pipeline,
},
];
}, [] as SearchResult[])
.filter((item) => !isAssetGroup(item.label));
}, [] as SearchResult[]);

const allSchedules: SearchResult[] = schedules.map((schedule) => ({
key: `${repoPath}-${schedule.name}`,
Expand All @@ -83,17 +83,19 @@ const bootstrapDataToSearchResults = (data?: SearchBootstrapQuery) => {
type: SearchResultType.Sensor,
}));

const allPartitionSets: SearchResult[] = partitionSets.map((partitionSet) => ({
key: `${repoPath}-${partitionSet.name}`,
label: partitionSet.name,
description: manyRepos ? `Partition set in ${repoPath}` : 'Partition set',
href: workspacePath(
repoName,
locationName,
`/pipeline_or_job/${partitionSet.pipelineName}/partitions?partitionSet=${partitionSet.name}`,
),
type: SearchResultType.PartitionSet,
}));
const allPartitionSets: SearchResult[] = partitionSets
.filter((item) => !isAssetGroup(item.pipelineName))
.map((partitionSet) => ({
key: `${repoPath}-${partitionSet.name}`,
label: partitionSet.name,
description: manyRepos ? `Partition set in ${repoPath}` : 'Partition set',
href: workspacePath(
repoName,
locationName,
`/pipeline_or_job/${partitionSet.pipelineName}/partitions?partitionSet=${partitionSet.name}`,
),
type: SearchResultType.PartitionSet,
}));

return [
...inner,
Expand Down

0 comments on commit 91ced9c

Please sign in to comment.