8000 feat: add opt-out option to new parameters form by aslilac · Pull Request #17456 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add opt-out option to new parameters form #17456

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 11 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
clean up design
  • Loading branch information
aslilac committed Apr 18, 2025
commit a9badc9c167821831754f8926b9262ea951ee43a
6 changes: 3 additions & 3 deletions dogfood/coder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ data "coder_parameter" "image_type" {
type = "string"
name = "Coder Image"
default = "codercom/oss-dogfood:latest"
description = "The Docker image used to run your workspace."
description = "The Docker image used to run your workspace. Choose between nix and non-nix images."
option {
icon = "/icon/ubuntu.svg"
name = "Dogfood Ubuntu"
icon = "/icon/coder.svg"
name = "Dogfood (Default)"
value = "codercom/oss-dogfood:latest"
}
option {
Expand Down
4 changes: 1 addition & 3 deletions site/src/api/queries/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export const templateByName = (
): QueryOptions<Template> => {
return {
queryKey: templateByNameKey(organization, name),
queryFn: async () => {
return API.getTemplateByName(organization, name);
},
queryFn: async () => API.getTemplateByName(organization, name),
};
};

Expand Down
23 changes: 14 additions & 9 deletions site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,20 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
<Margins size="medium">
<PageHeader
actions={
<Button size="sm" variant="outline" onClick={onCancel}>
Cancel
</Button>
<>
{newFormContext && (
<Button
size="sm"
variant="outline"
onClick={newFormContext.toggleOptedOut}
>
Try out the new workspace creation flow ✨
</Button>
)}
<Button size="sm" variant="outline" onClick={onCancel}>
Cancel
</Bu 8000 tton>
</>
}
>
<Stack direction="row">
Expand All @@ -247,12 +258,6 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
</Stack>
</PageHeader>

{newFormContext && (
<button type="button" onClick={newFormContext.toggleOptedOut}>
Try out the new workspace creation flow ✨
</button>
)}

<HorizontalForm
name="create-workspace-form"
onSubmit={form.handleSubmit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export const CreateWorkspacePageViewExperimental: FC<
</button>
</div>
<div className="flex flex-col gap-6 max-w-screen-sm mx-auto">
<header className="flex flex-col gap-2 mt-10">
<header className="flex flex-col items-start gap-2 mt-10">
<div className="flex items-center gap-2">
<Avatar
variant="icon"
Expand All @@ -277,13 +277,17 @@ export const CreateWorkspacePageViewExperimental: FC<
<h1 className="text-3xl font-semibold m-0">New workspace</h1>

{template.deprecated && <Pill type="warning">Deprecated</Pill>}
</header>

{newFormContext && (
<button type="button" onClick={newFormContext.toggleOptedOut}>
Go back to the classic workspace creation flow
</button>
)}
{newFormContext && (
<Button
size="sm"
variant="subtle"
onClick={newFormContext.toggleOptedOut}
>
Go back to the classic workspace creation flow
</Button>
)}
</header>

<form
onSubmit={form.handleSubmit}
Expand Down
Loading
0