Skip to content

Commit

Permalink
[dagit] Remove search item key (#7830)
Browse files Browse the repository at this point in the history
### Summary & Motivation

Since we'll now key search results on `href` (which should be unique per object), we don't need the `key` key on the result objects anymore.

### How I Tested These Changes

yarn ts
  • Loading branch information
hellendag committed May 12, 2022
1 parent 7207a6e commit 2238f8b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion js_modules/dagit/packages/core/src/search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export enum SearchResultType {
}

export type SearchResult = {
key: string;
label: string;
description: string;
href: string;
Expand Down
5 changes: 0 additions & 5 deletions js_modules/dagit/packages/core/src/search/useRepoSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const bootstrapDataToSearchResults = (data?: SearchBootstrapQuery) => {
return [
...flat,
{
key: `${repoPath}-${name}`,
label: name,
description: manyRepos
? `${isJob ? 'Job' : 'Pipeline'} in ${repoPath}`
Expand All @@ -68,15 +67,13 @@ const bootstrapDataToSearchResults = (data?: SearchBootstrapQuery) => {
}, [] as SearchResult[]);

const allSchedules: SearchResult[] = schedules.map((schedule) => ({
key: `${repoPath}-${schedule.name}`,
label: schedule.name,
description: manyRepos ? `Schedule in ${repoPath}` : 'Schedule',
href: workspacePath(repoName, locationName, `/schedules/${schedule.name}`),
type: SearchResultType.Schedule,
}));

const allSensors: SearchResult[] = sensors.map((sensor) => ({
key: `${repoPath}-${sensor.name}`,
label: sensor.name,
description: manyRepos ? `Sensor in ${repoPath}` : 'Sensor',
href: workspacePath(repoName, locationName, `/sensors/${sensor.name}`),
Expand All @@ -86,7 +83,6 @@ const bootstrapDataToSearchResults = (data?: SearchBootstrapQuery) => {
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(
Expand Down Expand Up @@ -119,7 +115,6 @@ const secondaryDataToSearchResults = (data?: SearchSecondaryQuery) => {
const {nodes} = data.assetsOrError;
const allEntries = nodes.map(({key}) => {
return {
key: displayNameForAssetKey(key),
label: displayNameForAssetKey(key),
segments: key.path,
description: 'Asset',
Expand Down

0 comments on commit 2238f8b

Please sign in to comment.