-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dagit] Add sensors/schedules to the asset details page (#7041)
- Loading branch information
Showing
10 changed files
with
179 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
js_modules/dagit/packages/core/src/assets/AssetNodeInstigatorTag.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import {gql} from '@apollo/client'; | ||
import {flatMap} from 'lodash'; | ||
import React from 'react'; | ||
|
||
import {ScheduleOrSensorTag} from '../nav/JobMetadata'; | ||
import {SCHEDULE_SWITCH_FRAGMENT} from '../schedules/ScheduleSwitch'; | ||
import {SENSOR_SWITCH_FRAGMENT} from '../sensors/SensorSwitch'; | ||
import {RepoAddress} from '../workspace/types'; | ||
|
||
import {AssetNodeInstigatorsFragment} from './types/AssetNodeInstigatorsFragment'; | ||
|
||
export const AssetNodeInstigatorTag: React.FC<{ | ||
assetNode: AssetNodeInstigatorsFragment; | ||
repoAddress: RepoAddress; | ||
}> = ({assetNode, repoAddress}) => { | ||
const schedules = flatMap(assetNode.jobs, (j) => j.schedules); | ||
const sensors = flatMap(assetNode.jobs, (j) => j.sensors); | ||
|
||
return <ScheduleOrSensorTag repoAddress={repoAddress} schedules={schedules} sensors={sensors} />; | ||
}; | ||
|
||
export const ASSET_NODE_INSTIGATORS_FRAGMENT = gql` | ||
fragment AssetNodeInstigatorsFragment on AssetNode { | ||
id | ||
jobs { | ||
id | ||
name | ||
schedules { | ||
id | ||
__typename | ||
...ScheduleSwitchFragment | ||
} | ||
sensors { | ||
id | ||
__typename | ||
...SensorSwitchFragment | ||
} | ||
} | ||
} | ||
${SCHEDULE_SWITCH_FRAGMENT} | ||
${SENSOR_SWITCH_FRAGMENT} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
js_modules/dagit/packages/core/src/assets/types/AssetNodeInstigatorsFragment.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
39 changes: 38 additions & 1 deletion
39
js_modules/dagit/packages/core/src/assets/types/AssetQuery.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters