Skip to content

Commit 5d0a35c

Browse files
Merge pull request #778 from zenml-io/staging
Release
2 parents 9c2249b + e60ad90 commit 5d0a35c

File tree

124 files changed

+2767
-1430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+2767
-1430
lines changed

src/app/404.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function Page404() {
1717
</p>
1818
<div className="mt-5 flex justify-center">
1919
<Button size="md" asChild>
20-
<Link className="w-min self-center whitespace-nowrap" to={routes.home}>
20+
<Link className="w-min self-center whitespace-nowrap" to={routes.projects.overview}>
2121
<span className="px-0.5">Go to Home</span>
2222
</Link>
2323
</Button>

src/app/activate-user/UsageReasonStep.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/app/activate-user/Wizard.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import { useState } from "react";
77
import { useSearchParams } from "react-router-dom";
88
import { AccountDetailsStep } from "./AccountDetailsStep";
99
import { ActivationProvider } from "./ActivationContext";
10-
import { InfraStep } from "./InfrastructureStep";
10+
import { AiChallengesStep } from "./ai-challenge-step";
1111
import { SetPasswordStep } from "./PasswordStep";
12-
import { PrimaryUseStep } from "./PrimaryUseStep";
13-
import { UsageReasonStep } from "./UsageReasonStep";
12+
import { PrimaryRoleStep } from "./primary-role-step";
1413

1514
export function ActivateWizard() {
1615
const { surveyStep } = useSurveyContext();
@@ -31,14 +30,13 @@ export function ActivateWizard() {
3130
return (
3231
<>
3332
<ActivationProvider initialUser={{ activation_token: token }}>
34-
<StepDisplay stepAmount={6} />
33+
<StepDisplay stepAmount={5} />
3534
{surveyStep === 1 && <AccountDetailsStep />}
3635
{surveyStep === 2 && <SetPasswordStep />}
37-
{surveyStep === 3 && <PrimaryUseStep />}
38-
{surveyStep === 4 && <UsageReasonStep />}
39-
{surveyStep === 5 && <InfraStep setUsername={setUsername} userId={id} />}
40-
{surveyStep === 6 && <SlackStep />}
41-
{surveyStep === 7 && (
36+
{surveyStep === 3 && <PrimaryRoleStep />}
37+
{surveyStep === 4 && <AiChallengesStep setUsername={setUsername} userId={id} />}
38+
{surveyStep === 5 && <SlackStep />}
39+
{surveyStep === 6 && (
4240
<SuccessStep subHeader="Your created your ZenML account" username={username} />
4341
)}
4442
</ActivationProvider>

src/app/activate-user/InfrastructureStep.tsx renamed to src/app/activate-user/ai-challenge-step.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import AlertCircle from "@/assets/icons/alert-circle.svg?react";
2-
import { InfrastructureForm } from "@/components/survey/Infrastructure";
3-
import { InfrastructureFormType } from "@/components/survey/form-schemas";
2+
import { AiChallengesForm } from "@/components/survey/ai-challenge";
3+
import { AiChallengesFormType } from "@/components/survey/form-schemas";
44
import { useActivateUser } from "@/data/users/activate-user-mutation";
55
import { useToast } from "@zenml-io/react-component-library";
66
import { useActivationContext } from "./ActivationContext";
@@ -15,7 +15,7 @@ type Props = {
1515
setUsername: Dispatch<SetStateAction<string>>;
1616
};
1717

18-
export function InfraStep({ userId, setUsername }: Props) {
18+
export function AiChallengesStep({ userId, setUsername }: Props) {
1919
const { newUser } = useActivationContext();
2020
const { setAuthState } = useAuthContext();
2121
const { setSurveyStep } = useSurveyContext();
@@ -44,10 +44,10 @@ export function InfraStep({ userId, setUsername }: Props) {
4444
}
4545
});
4646

47-
function handleInfraFormSubmit({ other, providers, otherVal }: InfrastructureFormType) {
48-
const providerArr = other ? [...providers, otherVal] : providers;
47+
function handleAiChallengesSubmit({ aiTypes, biggestChallenge }: AiChallengesFormType) {
4948
const updateMetadata: UserMetadata = {
50-
infra_providers: providerArr as string[],
49+
ai_types_working_with: aiTypes,
50+
biggest_ai_challenges: biggestChallenge,
5151
finished_onboarding_survey: true
5252
};
5353
mutate({
@@ -56,5 +56,5 @@ export function InfraStep({ userId, setUsername }: Props) {
5656
});
5757
}
5858

59-
return <InfrastructureForm submitHandler={handleInfraFormSubmit} />;
59+
return <AiChallengesForm submitHandler={handleAiChallengesSubmit} />;
6060
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { PrimaryUseForm } from "@/components/survey/PrimaryUse";
1+
import { PrimaryRoleForm } from "@/components/survey/primary-role";
22
import { useSurveyContext } from "@/components/survey/SurveyContext";
3-
import { PrimaryUseFormType } from "@/components/survey/form-schemas";
3+
import { PrimaryRoleFormType } from "@/components/survey/form-schemas";
44
import { useActivationContext } from "./ActivationContext";
55
import { UserMetadata } from "@/types/user";
66

7-
export function PrimaryUseStep() {
7+
export function PrimaryRoleStep() {
88
const { setSurveyStep } = useSurveyContext();
99
const { setNewUser } = useActivationContext();
1010

11-
function handlePrimaryUseSubmit({ primaryUse }: PrimaryUseFormType) {
11+
function handlePrimaryUseSubmit({ primaryRole, otherVal }: PrimaryRoleFormType) {
1212
const newMetadata: UserMetadata = {
13-
primary_use: primaryUse
13+
primary_role: primaryRole === "other" ? otherVal : primaryRole
1414
};
1515
setNewUser((prev) => ({
1616
...prev,
@@ -19,5 +19,5 @@ export function PrimaryUseStep() {
1919
setSurveyStep((prev) => prev + 1);
2020
}
2121

22-
return <PrimaryUseForm submitHandler={handlePrimaryUseSubmit} />;
22+
return <PrimaryRoleForm submitHandler={handlePrimaryUseSubmit} />;
2323
}

src/app/login/LoginForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function LoginForm() {
4444
},
4545
onSuccess: async () => {
4646
setAuthState("true");
47-
navigate(redirect || routes.home);
47+
navigate(redirect || routes.projects.overview);
4848
}
4949
});
5050

src/app/onboarding/Setup/Items.tsx

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@ import { ChecklistItem } from "@/components/onboarding/ChecklistItem";
55
import { useServerInfo } from "@/data/server/info-query";
66
import { getLoginCommand } from "@/lib/login-command";
77
import { OnboardingStep } from "@/types/onboarding";
8-
import { StackDeploymentProvider } from "@/types/stack";
98
import { Box, Skeleton, buttonVariants } from "@zenml-io/react-component-library";
10-
import { Dispatch, SetStateAction } from "react";
119
import { PipelineSnippet } from "./pipeline-snippet";
12-
import { DisabledOption, ProviderOnboardingStep } from "./provider-step";
1310
import { SetProject } from "./set-project";
14-
import { RunScript } from "./run-script";
15-
import { InfoBox } from "@/components/Infobox";
16-
import { SCRIPT_CONFIG } from "./constant";
1711

1812
export function ConnectZenMLStep({ completed, hasDownstreamStep, active }: OnboardingStep) {
1913
const { data } = useServerInfo({ throwOnError: true });
@@ -29,7 +23,7 @@ export function ConnectZenMLStep({ completed, hasDownstreamStep, active }: Onboa
2923
<div>
3024
<p className="mb-1 text-text-sm text-theme-text-secondary">Install ZenML</p>
3125
<Codesnippet
32-
code={`pip install "zenml==${data ? data.version : <Skeleton className="w-7" />}" scikit-learn scikit-image "numpy<2.0.0"`}
26+
code={`pip install "zenml==${data ? data.version : <Skeleton className="w-7" />}"`}
3327
/>
3428
</div>
3529
<div>
@@ -87,92 +81,3 @@ export function RunFirstPipeline({ active, completed, hasDownstreamStep }: Onboa
8781
</ChecklistItem>
8882
);
8983
}
90-
91-
export function ConnectRemoteStorage({
92-
completed,
93-
active,
94-
hasDownstreamStep,
95-
provider,
96-
setProvider
97-
}: OnboardingStep & {
98-
provider: StackDeploymentProvider | null;
99-
setProvider: Dispatch<SetStateAction<StackDeploymentProvider | null>>;
100-
}) {
101-
return (
102-
<ChecklistItem
103-
hasDownstream={hasDownstreamStep}
104-
completed={completed}
105-
title="Connect remote storage (5 min)"
106-
active={active}
107-
>
108-
<div className="space-y-5">
109-
<InfoBox>
110-
ZenML stacks provides the cloud infrastructure needed to run your ML pipelines at scale,
111-
giving you access to more compute resources than your local machine.{" "}
112-
<a
113-
rel="noopener noreferrer"
114-
target="_blank"
115-
className="link text-theme-text-brand"
116-
href="https://docs.zenml.io/stacks"
117-
>
118-
Learn more
119-
</a>
120-
</InfoBox>
121-
<ProviderOnboardingStep selectedProvider={provider} setSelectedProvider={setProvider} />
122-
123-
{provider ? (
124-
<RunScript provider={provider} />
125-
) : (
126-
<DisabledOption number={2}>Run the script</DisabledOption>
127-
)}
128-
<HelpBox link="https://docs.zenml.io/stacks" />
129-
</div>
130-
</ChecklistItem>
131-
);
132-
}
133-
134-
export function RunNewPipeline({
135-
active,
136-
completed,
137-
hasDownstreamStep,
138-
provider
139-
}: OnboardingStep & {
140-
provider: StackDeploymentProvider | null;
141-
}) {
142-
const stackName = provider ? SCRIPT_CONFIG[provider].stackName : "<REMOTE_STACK_NAME>";
143-
const integrationName = provider ? SCRIPT_CONFIG[provider].integration : "<INTEGRATION_NAME>";
144-
return (
145-
<ChecklistItem
146-
hasDownstream={hasDownstreamStep}
147-
completed={completed}
148-
title="Run a pipeline in a remote stack (3 min)"
149-
active={active}
150-
>
151-
<div className="space-y-5">
152-
<div className="space-y-1">
153-
<p className="text-text-sm text-theme-text-secondary">Install the stack integrations</p>
154-
<Codesnippet
155-
wrap
156-
codeClasses="whitespace-pre-wrap"
157-
code={`zenml integration install ${integrationName}`}
158-
/>
159-
</div>
160-
<div className="space-y-1">
161-
<p className="text-text-sm text-theme-text-secondary">Set the new stack</p>
162-
<Codesnippet
163-
wrap
164-
codeClasses="whitespace-pre-wrap"
165-
code={`zenml stack set ${stackName}`}
166-
/>
167-
</div>
168-
<div className="space-y-1">
169-
<p className="text-text-sm text-theme-text-secondary">Run the pipeline</p>
170-
<Codesnippet wrap codeClasses="whitespace-pre-wrap" code="python run.py" />
171-
</div>
172-
<div>
173-
<HelpBox link="https://docs.zenml.io/stacks" />
174-
</div>
175-
</div>
176-
</ChecklistItem>
177-
);
178-
}

src/app/onboarding/Setup/constant.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/app/onboarding/Setup/index.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import { useServerInfo } from "@/data/server/info-query";
22
import { useOnboarding } from "@/data/server/onboarding-state";
33
import { getOnboardingSetup } from "@/lib/onboarding";
44
import { checkIsLocalServer } from "@/lib/server";
5+
import { routes } from "@/router/routes";
6+
import { OnboardingResponse } from "@/types/onboarding";
57
import { Skeleton } from "@zenml-io/react-component-library";
6-
import { ConnectRemoteStorage, ConnectZenMLStep, RunFirstPipeline, RunNewPipeline } from "./Items";
7-
import { useState } from "react";
8-
import { StackDeploymentProvider } from "@/types/stack";
8+
import { useEffect, useRef } from "react";
9+
import { useNavigate } from "react-router-dom";
10+
import { ConnectZenMLStep, RunFirstPipeline } from "./Items";
911

1012
export function OnboardingSetupList() {
11-
const [provider, setProvider] = useState<StackDeploymentProvider | null>(null);
1213
const onboarding = useOnboarding({ refetchInterval: 5000 });
1314
const serverInfo = useServerInfo();
1415

@@ -17,11 +18,27 @@ export function OnboardingSetupList() {
1718
if (onboarding.isError || serverInfo.isError) return null;
1819

1920
const isLocalServer = checkIsLocalServer(serverInfo.data.deployment_type || "other");
20-
const { getItem } = getOnboardingSetup(onboarding.data, isLocalServer);
21+
22+
return <OnboardingSetupListContent onboarding={onboarding.data} isLocalServer={isLocalServer} />;
23+
}
24+
25+
type Props = {
26+
onboarding: OnboardingResponse;
27+
isLocalServer: boolean;
28+
};
29+
30+
function OnboardingSetupListContent({ onboarding, isLocalServer }: Props) {
31+
const navigate = useNavigate();
32+
const { getItem, isFinished } = getOnboardingSetup(onboarding, isLocalServer);
2133
const connectStep = getItem("device_verified");
2234
const pipelineStep = getItem("pipeline_run");
23-
const stackStep = getItem("stack_with_remote_artifact_store_created");
24-
const remotePipelineStep = getItem("pipeline_run_with_remote_artifact_store");
35+
const isInitialFinished = useRef(isFinished);
36+
37+
useEffect(() => {
38+
if (isFinished === true && isInitialFinished.current === false) {
39+
navigate(routes.home + "?success=true");
40+
}
41+
}, [isFinished, navigate]);
2542

2643
return (
2744
<ul className="space-y-5">
@@ -41,23 +58,6 @@ export function OnboardingSetupList() {
4158
hasDownstreamStep={pipelineStep.hasDownStreamStep}
4259
/>
4360
</li>
44-
<li>
45-
<ConnectRemoteStorage
46-
provider={provider}
47-
setProvider={setProvider}
48-
active={stackStep.isActive}
49-
completed={stackStep.isCompleted}
50-
hasDownstreamStep={stackStep.hasDownStreamStep}
51-
/>
52-
</li>
53-
<li>
54-
<RunNewPipeline
55-
provider={provider}
56-
active={remotePipelineStep.isActive}
57-
completed={remotePipelineStep.isCompleted}
58-
hasDownstreamStep={remotePipelineStep.hasDownStreamStep}
59-
/>
60-
</li>
6161
</ul>
6262
);
6363
}

0 commit comments

Comments
 (0)