Skip to content
Open
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 @@ -2,11 +2,17 @@ import { observer } from "mobx-react-lite";

import { useAwaitAuthorization } from "@/components/shared/Authentication/useAwaitAuthorization";
import { HuggingFaceAuthButton } from "@/components/shared/HuggingFaceAuth/HuggingFaceAuthButton";
import { PipelineRunsList } from "@/components/shared/PipelineRunDisplay/PipelineRunsList";
import { usePipelineRuns } from "@/components/shared/PipelineRunDisplay/usePipelineRuns";
import { RecentExecutionsButton } from "@/components/shared/ReactFlow/FlowSidebar/components/RecentExecutionsButton";
import GoogleCloudSubmissionDialog from "@/components/shared/Submitters/GoogleCloud/GoogleCloudSubmissionDialog";
import TangleSubmitter from "@/components/shared/Submitters/Tangle/TangleSubmitter";
import { withSuspenseWrapper } from "@/components/shared/SuspenseWrapper";
import { Button } from "@/components/ui/button";
import { Icon } from "@/components/ui/icon";
import { BlockStack } from "@/components/ui/layout";
import { Text } from "@/components/ui/typography";
import { BlockStack, InlineStack } from "@/components/ui/layout";
import { Separator } from "@/components/ui/separator";
import { Heading, Text } from "@/components/ui/typography";
import { serializeComponentSpec } from "@/models/componentSpec";
import { useSharedStores } from "@/routes/v2/shared/store/SharedStoreContext";
import { deepClone } from "@/utils/deepClone";
Expand Down Expand Up @@ -64,6 +70,7 @@ export const RunsAndSubmissionContent = observer(() => {
</li>
)}
</BlockStack>
<MostRecentRun pipelineName={rootSpec?.name} />
</BlockStack>
);
});
Expand All @@ -78,3 +85,51 @@ function EmptyState() {
</BlockStack>
);
}

const MostRecentRun = withSuspenseWrapper(function MostRecentRun({
pipelineName,
}: {
pipelineName?: string;
}) {
const { data: pipelineRuns } = usePipelineRuns(pipelineName);

if (!pipelineRuns || pipelineRuns.length === 0) {
return null;
}

const showMoreButton = pipelineName ? (
<RecentExecutionsButton
pipelineName={pipelineName}
trigger={
<Button variant="ghost" size="xs" className="text-gray-700">
Show all runs
</Button>
}
/>
) : null;

return (
<>
<Separator />
<BlockStack className="p-2">
<InlineStack align="space-between" className="w-full">
<Heading level={3}>The most recent run:</Heading>
{showMoreButton}
</InlineStack>
<div className="flex-1 min-h-0 overflow-y-auto w-full">
<PipelineRunsList
pipelineName={pipelineName}
showTitle={false}
defaultShowingRuns={1}
showMoreButton={false}
overviewConfig={{
showName: false,
showDescription: true,
showTaskStatusBar: false,
}}
/>
</div>
</BlockStack>
</>
);
});
Loading