-
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.
Adds a new partition page behind a feature flag (#7617)
* add gated new partitions page individual new components * fix up run loader fragment * rebase
- Loading branch information
Showing
30 changed files
with
3,785 additions
and
108 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
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
43 changes: 43 additions & 0 deletions
43
js_modules/dagit/packages/core/src/instance/BackfillPartitionsRequestedDialog.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,43 @@ | ||
import {Button, DialogBody, DialogFooter, Dialog} from '@dagster-io/ui'; | ||
import * as React from 'react'; | ||
|
||
import {BackfillTableFragment} from './types/BackfillTableFragment'; | ||
|
||
interface Props { | ||
backfill?: BackfillTableFragment; | ||
onClose: () => void; | ||
} | ||
export const BackfillPartitionsRequestedDialog = ({backfill, onClose}: Props) => { | ||
if (!backfill) { | ||
return null; | ||
} | ||
if (!backfill.partitionSet) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Dialog | ||
isOpen={!!backfill} | ||
title={ | ||
<span> | ||
Partitions requested for backfill:{' '} | ||
<span style={{fontFamily: 'monospace'}}>{backfill.backfillId}</span> | ||
</span> | ||
} | ||
onClose={onClose} | ||
> | ||
<DialogBody> | ||
<div style={{maxHeight: '80vh', overflowY: 'auto'}}> | ||
{backfill.partitionNames.map((partitionName: string) => ( | ||
<div key={partitionName}>{partitionName}</div> | ||
))} | ||
</div> | ||
</DialogBody> | ||
<DialogFooter> | ||
<Button intent="none" onClick={onClose}> | ||
Close | ||
</Button> | ||
</DialogFooter> | ||
</Dialog> | ||
); | ||
}; |
103 changes: 103 additions & 0 deletions
103
js_modules/dagit/packages/core/src/instance/BackfillStepStatusDialog.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,103 @@ | ||
import {Button, DialogBody, DialogFooter, Dialog} from '@dagster-io/ui'; | ||
import * as React from 'react'; | ||
|
||
import {PartitionStepStatus} from '../partitions/PartitionStepStatus'; | ||
import {usePartitionStepQuery} from '../partitions/usePartitionStepQuery'; | ||
import {RunFilterToken} from '../runs/RunsFilterInput'; | ||
import {buildRepoAddress} from '../workspace/buildRepoAddress'; | ||
import {RepoAddress} from '../workspace/types'; | ||
|
||
import { | ||
BackfillTableFragment, | ||
BackfillTableFragment_partitionSet, | ||
} from './types/BackfillTableFragment'; | ||
|
||
interface Props { | ||
backfill?: BackfillTableFragment; | ||
onClose: () => void; | ||
} | ||
export const BackfillStepStatusDialog = ({backfill, onClose}: Props) => { | ||
if (!backfill) { | ||
return null; | ||
} | ||
if (!backfill.partitionSet) { | ||
return null; | ||
} | ||
const repoAddress = buildRepoAddress( | ||
backfill.partitionSet.repositoryOrigin.repositoryName, | ||
backfill.partitionSet.repositoryOrigin.repositoryLocationName, | ||
); | ||
return ( | ||
<BackfillStepStatusDialogContent | ||
backfill={backfill} | ||
partitionSet={backfill.partitionSet} | ||
repoAddress={repoAddress} | ||
onClose={onClose} | ||
/> | ||
); | ||
}; | ||
|
||
interface ContentProps { | ||
backfill: BackfillTableFragment; | ||
partitionSet: BackfillTableFragment_partitionSet; | ||
repoAddress: RepoAddress; | ||
onClose: () => void; | ||
} | ||
|
||
export const BackfillStepStatusDialogContent = ({ | ||
backfill, | ||
partitionSet, | ||
repoAddress, | ||
onClose, | ||
}: ContentProps) => { | ||
const [pageSize, setPageSize] = React.useState(60); | ||
const [offset, setOffset] = React.useState<number>(0); | ||
const runsFilter = React.useMemo(() => { | ||
const token: RunFilterToken = {token: 'tag', value: `dagster/backfill=${backfill.backfillId}`}; | ||
return [token]; | ||
}, [backfill.backfillId]); | ||
const partitions = usePartitionStepQuery( | ||
partitionSet.name, | ||
backfill.partitionNames, | ||
pageSize, | ||
runsFilter, | ||
partitionSet.pipelineName, | ||
offset, | ||
!backfill, | ||
); | ||
|
||
if (!backfill) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Dialog | ||
isOpen={!!backfill} | ||
title={ | ||
<span> | ||
Step status for backfill:{' '} | ||
<span style={{fontFamily: 'monospace'}}>{backfill.backfillId}</span> | ||
</span> | ||
} | ||
onClose={onClose} | ||
style={{width: '80vw'}} | ||
> | ||
<DialogBody> | ||
<PartitionStepStatus | ||
partitionNames={backfill.partitionNames} | ||
partitions={partitions} | ||
pipelineName={partitionSet?.pipelineName} | ||
repoAddress={repoAddress} | ||
setPageSize={setPageSize} | ||
offset={offset} | ||
setOffset={setOffset} | ||
/> | ||
</DialogBody> | ||
<DialogFooter> | ||
<Button intent="none" onClick={onClose}> | ||
Close | ||
</Button> | ||
</DialogFooter> | ||
</Dialog> | ||
); | ||
}; |
Oops, something went wrong.