Skip to content

Commit 392f6eb

Browse files
committed
fix merge stuff
1 parent bc6f96a commit 392f6eb

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
171171
</Stack>
172172
</PageHeader>
173173

174-
<HorizontalForm onSubmit={form.handleSubmit} css={{ padding: "16px 0" }}>
174+
<HorizontalForm
175+
name="create-workspace-form"
176+
onSubmit={form.handleSubmit}
177+
css={{ padding: "16px 0" }}
178+
>
175179
{Boolean(error) && <ErrorAlert error={error} />}
176180

177181
{mode === "duplicate" && (
@@ -204,15 +208,30 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
204208
</Stack>
205209
)}
206210

207-
<TextField
208-
{...getFieldHelpers("name")}
209-
disabled={creatingWorkspace}
210-
// resetMutation facilitates the clearing of validation errors
211-
onChange={onChangeTrimmed(form, resetMutation)}
212-
autoFocus
213-
fullWidth
214-
label="Workspace Name"
215-
/>
211+
<div>
212+
<TextField
213+
{...getFieldHelpers("name")}
214+
disabled={creatingWorkspace}
215+
// resetMutation facilitates the clearing of validation errors
216+
onChange={onChangeTrimmed(form, resetMutation)}
217+
autoFocus
218+
fullWidth
219+
label="Workspace Name"
220+
/>
221+
<FormHelperText data-chromatic="ignore">
222+
Need a suggestion?{" "}
223+
<Button
224+
variant="text"
225+
css={styles.nameSuggestion}
226+
onClick={async () => {
227+
await form.setFieldValue("name", suggestedName);
228+
rerollSuggestedName();
229+
}}
230+
>
231+
{suggestedName}
232+
</Button>
233+
</FormHelperText>
234+
</div>
216235

217236
{permissions.createWorkspaceForUser && (
218237
<UserAutocomplete
@@ -234,7 +253,9 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
234253
>
235254
<FormFields>
236255
{requiresExternalAuth && (
237-
<Alert severity="error">
256+
// This should really be a `notice` but `severity` is a MUI prop, and we'd need
257+
// to basically make our own `Alert` component.
258+
<Alert severity="info">
238259
To create a workspace using the selected template, please
239260
ensure you are authenticated with all the external providers
240261
listed below.

0 commit comments

Comments
 (0)