-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #633 from zenml-io/future
Release
- Loading branch information
Showing
15 changed files
with
287 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { InfoBox } from "@/components/Infobox"; | ||
import { stackQueries } from "@/data/stacks"; | ||
import { routes } from "@/router/routes"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { Button, Skeleton } from "@zenml-io/react-component-library"; | ||
import { Dispatch, SetStateAction, useEffect } from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { clearWizardData, parseWizardData } from "./create/new-infrastructure/persist"; | ||
|
||
type Props = { | ||
setHasResumeableStack: Dispatch<SetStateAction<boolean>>; | ||
}; | ||
|
||
export function ResumeStackBanner({ setHasResumeableStack }: Props) { | ||
const { success, data } = parseWizardData(); | ||
const stack = useQuery({ | ||
...stackQueries.stackDeploymentStack({ | ||
provider: data?.provider || "aws", | ||
stack_name: data?.stackName || "", | ||
date_start: data?.timestamp | ||
}), | ||
enabled: success, | ||
throwOnError: true | ||
}); | ||
|
||
useEffect(() => { | ||
if (stack.data) { | ||
clearWizardData(); | ||
setHasResumeableStack(false); | ||
} | ||
}, [stack.data]); | ||
|
||
if (!success) return null; | ||
|
||
if (stack.isError) return null; | ||
if (stack.isPending) return <Skeleton className="h-[70px] w-full" />; | ||
|
||
return ( | ||
<InfoBox className="w-full"> | ||
<section className="flex flex-wrap items-center justify-between gap-y-2"> | ||
<div className="flex flex-wrap items-center gap-2"> | ||
<p className="font-semibold">You have a Stack provision incomplete</p> | ||
<p className="text-text-sm"> | ||
Return to the setup and finish the configuration on your cloud provider | ||
</p> | ||
</div> | ||
<div> | ||
<Button | ||
className="w-fit bg-theme-surface-primary" | ||
intent="primary" | ||
emphasis="subtle" | ||
asChild | ||
> | ||
<Link to={routes.stacks.create.newInfra}> | ||
<span>Review Stack</span> | ||
</Link> | ||
</Button> | ||
</div> | ||
</section> | ||
</InfoBox> | ||
); | ||
} |
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
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
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
Oops, something went wrong.