Changeset View
Changeset View
Standalone View
Standalone View
js_modules/dagit/packages/core/src/nav/JobMetadata.tsx
import {gql, useQuery} from '@apollo/client'; | import {gql, useQuery} from '@apollo/client'; | ||||
import {Button, Classes, Colors, Dialog, Icon} from '@blueprintjs/core'; | import {Button, Classes, Colors, Dialog, Icon} from '@blueprintjs/core'; | ||||
import {Tooltip2 as Tooltip} from '@blueprintjs/popover2'; | import {Tooltip2 as Tooltip} from '@blueprintjs/popover2'; | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import {Link} from 'react-router-dom'; | import {Link} from 'react-router-dom'; | ||||
import styled from 'styled-components/macro'; | import styled from 'styled-components/macro'; | ||||
import {useFeatureFlags} from '../app/Flags'; | import {useFeatureFlags} from '../app/Flags'; | ||||
import {timingStringForStatus} from '../runs/RunDetails'; | import {timingStringForStatus} from '../runs/RunDetails'; | ||||
import {RunStatus} from '../runs/RunStatusDots'; | import {RunStatus} from '../runs/RunStatusDots'; | ||||
import {RunTime, RUN_TIME_FRAGMENT} from '../runs/RunUtils'; | import {RunTime, RUN_TIME_FRAGMENT} from '../runs/RunUtils'; | ||||
import {ScheduleSwitch} from '../schedules/ScheduleSwitch'; | import {ScheduleSwitch, SCHEDULE_SWITCH_FRAGMENT} from '../schedules/ScheduleSwitch'; | ||||
import {SCHEDULE_FRAGMENT} from '../schedules/ScheduleUtils'; | |||||
import {TimestampDisplay} from '../schedules/TimestampDisplay'; | import {TimestampDisplay} from '../schedules/TimestampDisplay'; | ||||
import {SENSOR_FRAGMENT} from '../sensors/SensorFragment'; | import {SensorSwitch, SENSOR_SWITCH_FRAGMENT} from '../sensors/SensorSwitch'; | ||||
import {SensorSwitch} from '../sensors/SensorSwitch'; | |||||
import {Box} from '../ui/Box'; | import {Box} from '../ui/Box'; | ||||
import {ButtonLink} from '../ui/ButtonLink'; | import {ButtonLink} from '../ui/ButtonLink'; | ||||
import {Group} from '../ui/Group'; | import {Group} from '../ui/Group'; | ||||
import {MetadataTable, StyledTable} from '../ui/MetadataTable'; | import {MetadataTable, StyledTable} from '../ui/MetadataTable'; | ||||
import {FontFamily} from '../ui/styles'; | import {FontFamily} from '../ui/styles'; | ||||
import {RepoAddress} from '../workspace/types'; | import {RepoAddress} from '../workspace/types'; | ||||
import {workspacePathFromAddress} from '../workspace/workspacePath'; | import {workspacePathFromAddress} from '../workspace/workspacePath'; | ||||
▲ Show 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | |||||
const JOB_METADATA_QUERY = gql` | const JOB_METADATA_QUERY = gql` | ||||
query JobMetadataQuery($params: PipelineSelector!, $runsFilter: PipelineRunsFilter) { | query JobMetadataQuery($params: PipelineSelector!, $runsFilter: PipelineRunsFilter) { | ||||
pipelineOrError(params: $params) { | pipelineOrError(params: $params) { | ||||
... on Pipeline { | ... on Pipeline { | ||||
id | id | ||||
schedules { | schedules { | ||||
id | id | ||||
...ScheduleFragment | mode | ||||
...ScheduleSwitchFragment | |||||
} | } | ||||
sensors { | sensors { | ||||
id | id | ||||
...SensorFragment | mode | ||||
...SensorSwitchFragment | |||||
} | } | ||||
} | } | ||||
} | } | ||||
pipelineRunsOrError(filter: $runsFilter, limit: 5) { | pipelineRunsOrError(filter: $runsFilter, limit: 5) { | ||||
... on PipelineRuns { | ... on PipelineRuns { | ||||
results { | results { | ||||
id | id | ||||
...RunMetadataFragment | ...RunMetadataFragment | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
${SCHEDULE_FRAGMENT} | ${SCHEDULE_SWITCH_FRAGMENT} | ||||
${SENSOR_FRAGMENT} | ${SENSOR_SWITCH_FRAGMENT} | ||||
${RUN_METADATA_FRAGMENT} | ${RUN_METADATA_FRAGMENT} | ||||
`; | `; |