- Notifications
You must be signed in to change notification settings - Fork923
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { | ||
@@ -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} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. =) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
<span className="flex flex-row gap-2"> | ||
Enable dynamic parameters for workspace creation | ||
<FeatureStageBadge contentType={"beta"} size="sm" /> | ||
</span> | ||
<StackLabelHelperText> | ||
<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> | ||
} | ||
Uh oh!
There was an error while loading.Please reload this page.