Skip to content

chore: hide classic workspace checkbox when experiment is not enabled #18061

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 2 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
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 @@ -63,6 +63,7 @@ export interface TemplateSettingsForm {
accessControlEnabled: boolean;
advancedSchedulingEnabled: boolean;
portSharingControlsEnabled: boolean;
isDynamicParametersEnabled: boolean;
}

export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
Expand All @@ -75,6 +76,7 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
accessControlEnabled,
advancedSchedulingEnabled,
portSharingControlsEnabled,
isDynamicParametersEnabled,
}) => {
const form = useFormik<UpdateTemplateMeta>({
initialValues: {
Expand Down Expand Up @@ -224,34 +226,37 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
</StackLabel>
}
/>
<FormControlLabel
control={
<Checkbox
size="small"
id="use_classic_parameter_flow"
name="use_classic_parameter_flow"
checked={form.values.use_classic_parameter_flow}
onChange={form.handleChange}
disabled={false}
/>
}
label={
<StackLabel>
Use classic workspace creation form
<StackLabelHelperText>
<span>
Show the original workspace creation form without dynamic
parameters or live updates. Recommended if your provisioners
aren't updated or the new form causes issues.{" "}
<strong>
Users can always manually switch experiences in the
workspace creation form.
</strong>
</span>
</StackLabelHelperText>
</StackLabel>
}
/>
{isDynamicParametersEnabled && (
<FormControlLabel
control={
<Checkbox
size="small"
id="use_classic_parameter_flow"
name="use_classic_parameter_flow"
checked={form.values.use_classic_parameter_flow}
onChange={form.handleChange}
disabled={false}
/>
}
label={
<StackLabel>
Use classic workspace creation form
<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 new form causes issues.{" "}
<strong>
Users can always manually switch experiences in the
workspace creation form.
</strong>
</span>
</StackLabelHelperText>
</StackLabel>
}
/>
)}
</FormFields>
</FormSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { useTemplateSettings } from "../TemplateSettingsLayout";
import { TemplateSettingsPageView } from "./TemplateSettingsPageView";

const TemplateSettingsPage: FC = () => {
const { experiments } = useDashboard();
const isDynamicParametersEnabled = experiments.includes("dynamic-parameters");
const { template: templateName } = useParams() as { template: string };
const navigate = useNavigate();
const getLink = useLinks();
Expand Down Expand Up @@ -79,6 +81,7 @@ const TemplateSettingsPage: FC = () => {
accessControlEnabled={accessControlEnabled}
advancedSchedulingEnabled={advancedSchedulingEnabled}
sharedPortControlsEnabled={sharedPortControlsEnabled}
isDynamicParametersEnabled={isDynamicParametersEnabled}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface TemplateSettingsPageViewProps {
accessControlEnabled: boolean;
advancedSchedulingEnabled: boolean;
sharedPortControlsEnabled: boolean;
isDynamicParametersEnabled: boolean;
}

export const TemplateSettingsPageView: FC<TemplateSettingsPageViewProps> = ({
Expand All @@ -27,6 +28,7 @@ export const TemplateSettingsPageView: FC<TemplateSettingsPageViewProps> = ({
accessControlEnabled,
advancedSchedulingEnabled,
sharedPortControlsEnabled,
isDynamicParametersEnabled,
}) => {
return (
<>
Expand All @@ -44,6 +46,7 @@ export const TemplateSettingsPageView: FC<TemplateSettingsPageViewProps> = ({
accessControlEnabled={accessControlEnabled}
advancedSchedulingEnabled={advancedSchedulingEnabled}
portSharingControlsEnabled={sharedPortControlsEnabled}
isDynamicParametersEnabled={isDynamicParametersEnabled}
/>
</>
);
Expand Down
Loading