Skip to content

Commit 0b26a9b

Browse files
committed
Apply variant mod
1 parent 047c10b commit 0b26a9b

File tree

12 files changed

+513
-518
lines changed

12 files changed

+513
-518
lines changed

site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
4242
<p>{t("deleteDialog.confirm", { entity })}</p>
4343

4444
<TextField
45+
variant="standard"
4546
fullWidth
4647
InputLabelProps={{
4748
shrink: true,
@@ -56,8 +57,7 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
5657
onChange={handleChange}
5758
label={t("deleteDialog.confirmLabel", { entity })}
5859
error={hasError}
59-
helperText={hasError && t("deleteDialog.incorrectName", { entity })}
60-
/>
60+
helperText={hasError && t("deleteDialog.incorrectName", { entity })} />
6161
</>
6262
)
6363

site/src/components/ParameterInput/ParameterInput.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const ParameterField: React.FC<ParameterInputProps> = ({
7070
if (schema.validation_contains && schema.validation_contains.length > 0) {
7171
return (
7272
<TextField
73+
variant="standard"
7374
id={schema.name}
7475
size="small"
7576
defaultValue={defaultValue ?? schema.default_source_value}
@@ -79,15 +80,14 @@ const ParameterField: React.FC<ParameterInputProps> = ({
7980
onChange(event.target.value)
8081
}}
8182
select
82-
fullWidth
83-
>
83+
fullWidth>
8484
{schema.validation_contains.map((item) => (
8585
<MenuItem key={item} value={item}>
8686
{item}
8787
</MenuItem>
8888
))}
8989
</TextField>
90-
)
90+
);
9191
}
9292

9393
if (isBoolean(schema)) {
@@ -120,16 +120,16 @@ const ParameterField: React.FC<ParameterInputProps> = ({
120120
// we should break this out into more finely scoped input fields.
121121
return (
122122
<TextField
123+
variant="standard"
123124
id={schema.name}
124125
size="small"
125126
disabled={disabled}
126127
placeholder={schema.default_source_value}
127128
defaultValue={defaultValue ?? schema.default_source_value}
128129
onChange={(event) => {
129130
onChange(event.target.value)
130-
}}
131-
/>
132-
)
131+
}} />
132+
);
133133
}
134134

135135
const useStyles = makeStyles((theme) => ({

site/src/components/PortForwardButton/PortForwardButton.tsx

Lines changed: 71 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -59,82 +59,80 @@ const TooltipView: React.FC<PortForwardButtonProps> = (props) => {
5959
})
6060
const ports = state.context.listeningPorts?.ports
6161

62-
return (
63-
<>
64-
<HelpTooltipText>
65-
Access ports running on the agent with the{" "}
66-
<strong>port, agent name, workspace name</strong> and{" "}
67-
<strong>your username</strong> URL schema, as shown below. Port URLs are
68-
only accessible by you.
69-
</HelpTooltipText>
70-
71-
<CodeExample code={urlExample} className={styles.code} />
62+
return <>
63+
<HelpTooltipText>
64+
Access ports running on the agent with the{" "}
65+
<strong>port, agent name, workspace name</strong> and{" "}
66+
<strong>your username</strong> URL schema, as shown below. Port URLs are
67+
only accessible by you.
68+
</HelpTooltipText>
69+
70+
<CodeExample code={urlExample} className={styles.code} />
71+
72+
<HelpTooltipText>
73+
Use the form to open applications in a new tab.
74+
</HelpTooltipText>
75+
76+
<Stack
77+
direction="row"
78+
spacing={1}
79+
alignItems="center"
80+
className={styles.form}
81+
>
82+
<TextField
83+
variant="standard"
84+
label="Port"
85+
type="number"
86+
value={port}
87+
className={styles.portField}
88+
onChange={(e) => {
89+
setPort(e.currentTarget.value)
90+
}} />
91+
<Link
92+
underline="none"
93+
href={urlExample}
94+
target="_blank"
95+
rel="noreferrer"
96+
className={styles.openUrlButton}
97+
>
98+
<Button>Open URL</Button>
99+
</Link>
100+
</Stack>
72101

102+
<Maybe condition={Boolean(ports && ports.length > 0)}>
73103
<HelpTooltipText>
74-
Use the form to open applications in a new tab.
104+
{ports &&
105+
ports.map((p, i) => {
106+
const url = portForwardURL(
107+
host,
108+
p.port,
109+
agentName,
110+
workspaceName,
111+
username,
112+
)
113+
let label = `${p.port}`
114+
if (p.process_name) {
115+
label = `${p.process_name} - ${p.port}`
116+
}
117+
118+
return (
119+
<Fragment key={i}>
120+
{i > 0 && <span style={{ margin: "0 0.6em" }}>&middot;</span>}
121+
<Link href={url} target="_blank" rel="noreferrer">
122+
{label}
123+
</Link>
124+
</Fragment>
125+
)
126+
})}
75127
</HelpTooltipText>
76-
77-
<Stack
78-
direction="row"
79-
spacing={1}
80-
alignItems="center"
81-
className={styles.form}
82-
>
83-
<TextField
84-
label="Port"
85-
type="number"
86-
value={port}
87-
className={styles.portField}
88-
onChange={(e) => {
89-
setPort(e.currentTarget.value)
90-
}}
91-
/>
92-
<Link
93-
underline="none"
94-
href={urlExample}
95-
target="_blank"
96-
rel="noreferrer"
97-
className={styles.openUrlButton}
98-
>
99-
<Button>Open URL</Button>
100-
</Link>
101-
</Stack>
102-
103-
<Maybe condition={Boolean(ports && ports.length > 0)}>
104-
<HelpTooltipText>
105-
{ports &&
106-
ports.map((p, i) => {
107-
const url = portForwardURL(
108-
host,
109-
p.port,
110-
agentName,
111-
workspaceName,
112-
username,
113-
)
114-
let label = `${p.port}`
115-
if (p.process_name) {
116-
label = `${p.process_name} - ${p.port}`
117-
}
118-
119-
return (
120-
<Fragment key={i}>
121-
{i > 0 && <span style={{ margin: "0 0.6em" }}>&middot;</span>}
122-
<Link href={url} target="_blank" rel="noreferrer">
123-
{label}
124-
</Link>
125-
</Fragment>
126-
)
127-
})}
128-
</HelpTooltipText>
129-
</Maybe>
130-
131-
<HelpTooltipLinksGroup>
132-
<HelpTooltipLink href="https://coder.com/docs/coder-oss/latest/networking/port-forwarding#dashboard">
133-
Learn more about web port forwarding
134-
</HelpTooltipLink>
135-
</HelpTooltipLinksGroup>
136-
</>
137-
)
128+
</Maybe>
129+
130+
<HelpTooltipLinksGroup>
131+
<HelpTooltipLink href="https://coder.com/docs/coder-oss/latest/networking/port-forwarding#dashboard">
132+
Learn more about web port forwarding
133+
</HelpTooltipLink>
134+
</HelpTooltipLinksGroup>
135+
</>;
138136
}
139137

140138
export const PortForwardButton: React.FC<PortForwardButtonProps> = (props) => {

site/src/components/RichParameterInput/RichParameterInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ const RichParameterField: React.FC<RichParameterInputProps> = ({
191191
// we should break this out into more finely scoped input fields.
192192
return (
193193
<TextField
194+
variant="standard"
194195
{...props}
195196
type={parameter.type}
196197
size="small"
@@ -201,9 +202,8 @@ const RichParameterField: React.FC<RichParameterInputProps> = ({
201202
onChange={(event) => {
202203
setParameterValue(event.target.value)
203204
onChange(event.target.value)
204-
}}
205-
/>
206-
)
205+
}} />
206+
);
207207
}
208208

209209
const optionIconSize = 20

site/src/components/TemplateVersionEditor/FileDialog.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const CreateFileDialog: FC<{
6565
slashes too.
6666
</Typography>
6767
<TextField
68+
variant="standard"
6869
autoFocus
6970
onKeyDown={(event) => {
7071
if (event.key === "Enter") {
@@ -82,12 +83,11 @@ export const CreateFileDialog: FC<{
8283
label="File Path"
8384
InputLabelProps={{
8485
shrink: true,
85-
}}
86-
/>
86+
}} />
8787
</Stack>
8888
}
8989
/>
90-
)
90+
);
9191
}
9292

9393
export const DeleteFileDialog: FC<{
@@ -179,6 +179,7 @@ export const RenameFileDialog: FC<{
179179
contain slashes too!
180180
</p>
181181
<TextField
182+
variant="standard"
182183
autoFocus
183184
onKeyDown={(event) => {
184185
if (event.key === "Enter") {
@@ -193,10 +194,9 @@ export const RenameFileDialog: FC<{
193194
placeholder={filename}
194195
value={pathValue}
195196
onChange={handleChange}
196-
label="File Path"
197-
/>
197+
label="File Path" />
198198
</Stack>
199199
}
200200
/>
201-
)
201+
);
202202
}

site/src/components/TemplateVersionEditor/PublishTemplateVersionDialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ export const PublishTemplateVersionDialog: FC<
6464
<p>You are about to publish a new version of this template.</p>
6565
<FormFields>
6666
<TextField
67+
variant="standard"
6768
{...getFieldHelpers("name")}
6869
label="Version name"
6970
autoFocus
7071
disabled={isPublishing}
7172
InputLabelProps={{
7273
shrink: true,
73-
}}
74-
/>
74+
}} />
7575

7676
<FormControlLabel
7777
label="Promote to default version"
@@ -94,5 +94,5 @@ export const PublishTemplateVersionDialog: FC<
9494
</Stack>
9595
}
9696
/>
97-
)
97+
);
9898
}

site/src/components/WorkspaceScheduleForm/WorkspaceScheduleForm.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,25 +299,25 @@ export const WorkspaceScheduleForm: FC<
299299
/>
300300
<Stack direction="row">
301301
<TextField
302+
variant="standard"
302303
{...formHelpers("startTime")}
303304
disabled={isLoading || !form.values.autostartEnabled}
304305
InputLabelProps={{
305306
shrink: true,
306307
}}
307308
label={Language.startTimeLabel}
308309
type="time"
309-
fullWidth
310-
/>
310+
fullWidth />
311311
<TextField
312+
variant="standard"
312313
{...formHelpers("timezone")}
313314
disabled={isLoading || !form.values.autostartEnabled}
314315
InputLabelProps={{
315316
shrink: true,
316317
}}
317318
label={Language.timezoneLabel}
318319
select
319-
fullWidth
320-
>
320+
fullWidth>
321321
{zones.map((zone) => (
322322
<MenuItem key={zone} value={zone}>
323323
{zone}
@@ -326,7 +326,10 @@ export const WorkspaceScheduleForm: FC<
326326
</TextField>
327327
</Stack>
328328

329-
<FormControl component="fieldset" error={Boolean(form.errors.monday)}>
329+
<FormControl
330+
variant="standard"
331+
component="fieldset"
332+
error={Boolean(form.errors.monday)}>
330333
<FormLabel className={styles.daysOfWeekLabel} component="legend">
331334
{Language.daysOfWeekLabel}
332335
</FormLabel>
@@ -375,18 +378,18 @@ export const WorkspaceScheduleForm: FC<
375378
label={Language.stopSwitch}
376379
/>
377380
<TextField
381+
variant="standard"
378382
{...formHelpers("ttl", ttlShutdownAt(form.values.ttl), "ttl_ms")}
379383
disabled={isLoading || !form.values.autostopEnabled}
380384
inputProps={{ min: 0, step: 1 }}
381385
label={Language.ttlLabel}
382386
type="number"
383-
fullWidth
384-
/>
387+
fullWidth />
385388
</FormFields>
386389
</FormSection>
387390
<FormFooter onCancel={onCancel} isLoading={isLoading} />
388391
</HorizontalForm>
389-
)
392+
);
390393
}
391394

392395
export const ttlShutdownAt = (formTTL: number): string => {

0 commit comments

Comments
 (0)