mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: update template opt-in checkbox (#18481)
<img width="848" alt="Screenshot 2025-06-20 at 20 01 55" src="https://github.com/user-attachments/assets/bd825778-3d10-49e1-bcc3-193516ed3ba6" />
This commit is contained in:
+28
-9
@@ -10,6 +10,7 @@ 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,
|
||||
@@ -17,6 +18,7 @@ import {
|
||||
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 {
|
||||
@@ -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,
|
||||
@@ -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}
|
||||
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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user