Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ export interface BAIImportArtifactModalProps
}[],
) => void;
onCancel: (e: React.MouseEvent<HTMLElement>) => void;
connectionIds?: string[];
}

const BAIImportArtifactModal = ({
selectedArtifactFrgmt,
selectedArtifactRevisionFrgmt,
onOk,
onCancel,
connectionIds,
...modalProps
}: BAIImportArtifactModalProps) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -81,6 +83,7 @@ const BAIImportArtifactModal = ({
useMutation<BAIImportArtifactModalImportArtifactsMutation>(graphql`
mutation BAIImportArtifactModalImportArtifactsMutation(
$input: ImportArtifactsInput!
$connectionIds: [ID!]!
) {
importArtifacts(input: $input) {
tasks {
Expand All @@ -90,7 +93,7 @@ const BAIImportArtifactModal = ({
}
}
artifactRevisions {
edges {
edges @appendEdge(connections: $connectionIds) {
node {
id
status
Expand Down Expand Up @@ -138,6 +141,7 @@ const BAIImportArtifactModal = ({
toLocalId(revision.id),
),
},
connectionIds: connectionIds ?? [],
},
onCompleted: (res, errors) => {
if (errors && errors.length > 0) {
Expand Down
12 changes: 10 additions & 2 deletions react/src/pages/ReservoirArtifactDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,15 @@ const ReservoirArtifactDetailPage = () => {
}
updatedAt
pullingArtifactRevisions: revisions(
first: null
last: null
filter: { status: { equals: PULLING } }
orderBy: { field: VERSION, direction: DESC }
) {
)
@connection(
key: "ReservoirArtifactDetailPage_pullingArtifactRevisions"
) {
__id
count
edges {
node {
Expand Down Expand Up @@ -518,6 +524,9 @@ const ReservoirArtifactDetailPage = () => {
selectedArtifactFrgmt={artifact ?? null}
selectedArtifactRevisionFrgmt={selectedRevisions}
open={!!artifact && !_.isEmpty(selectedRevisions)}
connectionIds={
artifact ? [artifact.pullingArtifactRevisions.__id] : undefined
}
onOk={(_e, tasks) => {
setSelectedRevisions([]);
tasks.forEach((task) => {
Expand Down Expand Up @@ -546,7 +555,6 @@ const ReservoirArtifactDetailPage = () => {
},
});
});
updateFetchKey();
}}
onCancel={() => {
setSelectedRevisions([]);
Expand Down
Loading