Skip to content

chore: update template opt-in checkbox #18481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 20, 2025
Merged
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 @@ -10,13 +10,15 @@ import {
} from "api/typesGenerated";
import { PremiumBadge } from "components/Badges/Badges";
import { Button } from "components/Button/Button";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import {
FormFields,
FormFooter,
FormSection,
HorizontalForm,
} from "components/Form/Form";
import { IconField } from "components/IconField/IconField";
import { Link } from "components/Link/Link";
import { Spinner } from "components/Spinner/Spinner";
import { Stack } from "components/Stack/Stack";
import {
Expand All @@ -25,6 +27,7 @@ import {
} from "components/StackLabel/StackLabel";
import { type FormikTouched, useFormik } from "formik";
import type { FC } from "react";
import { docs } from "utils/docs";
import {
displayNameValidator,
getFormHelpers,
Expand Down Expand Up @@ -230,21 +233,37 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
size="small"
id="use_classic_parameter_flow"
name="use_classic_parameter_flow"
checked={form.values.use_classic_parameter_flow}
onChange={form.handleChange}
checked={!form.values.use_classic_parameter_flow}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update the function that passes to the API to flip the value too? Like on the request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good catch, we do because someone decided to use an inverted state for this setting. fixed. =)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the onchange below

onChange={(event) =>
form.setFieldValue(
"use_classic_parameter_flow",
!event.currentTarget.checked,
)
}
disabled={false}
/>
}
label={
<StackLabel>
Use classic workspace creation form
<span className="flex flex-row gap-2">
Enable dynamic parameters for workspace creation
<FeatureStageBadge contentType={"beta"} size="sm" />
</span>
<StackLabelHelperText>
<span>
Show the original workspace creation form and workspace
parameters settings form without dynamic parameters or live
updates. Recommended if your provisioners aren't updated or
the dynamic form causes issues.
</span>
<div>
The new workspace form allows you to design your template
with new form types and identity-aware conditional
parameters. The form will only present options that are
compatible and available.
</div>
<Link
className="text-xs"
href={docs(
"/admin/templates/extending-templates/parameters#dynamic-parameters-beta",
)}
>
Learn more
</Link>
</StackLabelHelperText>
</StackLabel>
}
Expand Down
Loading