Skip to content

Commit 537556d

Browse files
ref(ui): Use label w/ hideLabel in monitorForm (#75985)
This is the more correct way to provide the label
1 parent 46444a4 commit 537556d

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

static/app/views/monitors/components/monitorForm.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ function MonitorForm({
260260
<InputGroup>
261261
<TextField
262262
name="name"
263-
aria-label={t('Name')}
263+
label={t('Name')}
264+
hideLabel
264265
placeholder={t('My Cron Job')}
265266
required
266267
stacked
@@ -269,7 +270,8 @@ function MonitorForm({
269270
{monitor && (
270271
<TextField
271272
name="slug"
272-
aria-label={t('Slug')}
273+
label={t('Slug')}
274+
hideLabel
273275
help={tct(
274276
'The [strong:monitor-slug] is used to uniquely identify your monitor within your organization. Changing this slug will require updates to any instrumented check-in calls.',
275277
{strong: <strong />}
@@ -283,7 +285,8 @@ function MonitorForm({
283285
)}
284286
<SentryProjectSelectorField
285287
name="project"
286-
aria-label={t('Project')}
288+
label={t('Project')}
289+
hideLabel
287290
groupProjects={project =>
288291
platformsWithGuides.includes(project.platform) ? 'suggested' : 'other'
289292
}
@@ -317,7 +320,8 @@ function MonitorForm({
317320
)}
318321
<SelectField
319322
name="config.scheduleType"
320-
aria-label={t('Schedule Type')}
323+
label={t('Schedule Type')}
324+
hideLabel
321325
options={SCHEDULE_OPTIONS}
322326
defaultValue={ScheduleType.CRONTAB}
323327
orientInline
@@ -341,7 +345,8 @@ function MonitorForm({
341345
<MultiColumnInput columns="1fr 2fr">
342346
<TextField
343347
name="config.schedule"
344-
aria-label={t('Crontab Schedule')}
348+
label={t('Crontab Schedule')}
349+
hideLabel
345350
placeholder="* * * * *"
346351
defaultValue={DEFAULT_CRONTAB}
347352
css={{input: {fontFamily: commonTheme.text.familyMono}}}
@@ -351,7 +356,8 @@ function MonitorForm({
351356
/>
352357
<SelectField
353358
name="config.timezone"
354-
aria-label={t('Timezone')}
359+
label={t('Timezone')}
360+
hideLabel
355361
defaultValue="UTC"
356362
options={timezoneOptions}
357363
required
@@ -368,7 +374,8 @@ function MonitorForm({
368374
<LabelText>{t('Every')}</LabelText>
369375
<NumberField
370376
name="config.schedule.frequency"
371-
aria-label={t('Interval Frequency')}
377+
label={t('Interval Frequency')}
378+
hideLabel
372379
placeholder="e.g. 1"
373380
defaultValue="1"
374381
min={1}
@@ -378,7 +385,8 @@ function MonitorForm({
378385
/>
379386
<SelectField
380387
name="config.schedule.interval"
381-
aria-label={t('Interval Type')}
388+
label={t('Interval Type')}
389+
hideLabel
382390
options={getScheduleIntervals(
383391
Number(form.current.getValue('config.schedule.frequency') ?? 1)
384392
)}

0 commit comments

Comments
 (0)