Skip to content
Merged
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
24 changes: 17 additions & 7 deletions static/app/views/detectors/components/forms/metric/metric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,24 +228,34 @@ function PriorityRow({

const thresholdAriaLabel = isHigh ? t('High threshold') : t('Medium threshold');

const directionField = (
const directionField = isHigh ? (
<DirectionField
aria-label={t('Threshold direction')}
name={METRIC_DETECTOR_FORM_FIELDS.conditionType}
hideLabel
inline
flexibleControlStateSize
choices={conditionChoices}
required={isHigh}
disabled={!isHigh}
defaultValue={conditionType}
required
preserveOnUnmount
/>
) : (
<DirectionField
aria-label={t('Threshold direction')}
name="conditionTypeDisplay"
hideLabel
inline
flexibleControlStateSize
choices={conditionChoices}
value={conditionType}
defaultValue={conditionType}
disabled
/>
);

return (
<PriorityRowContainer>
<PriorityDot $priority={priority} />
<PriorityDot priority={priority} />
<PriorityLabel>
{isHigh ? t('High priority') : t('Medium priority')}
{isHigh && <RequiredAsterisk>*</RequiredAsterisk>}
Expand Down Expand Up @@ -677,11 +687,11 @@ const PriorityRowContainer = styled('div')`
gap: ${space(1)};
`;

const PriorityDot = styled('div')<{$priority: 'high' | 'medium'}>`
const PriorityDot = styled('div')<{priority: 'high' | 'medium'}>`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was weirdly named too

width: 8px;
height: 8px;
border-radius: 50%;
background-color: ${p => (p.$priority === 'high' ? p.theme.red300 : p.theme.yellow400)};
background-color: ${p => (p.priority === 'high' ? p.theme.red300 : p.theme.yellow400)};
flex-shrink: 0;
`;

Expand Down
Loading