mirror of
https://github.com/Unleash/unleash.git
synced 2025-11-24 20:06:55 +01:00
feat: improve safeguard threshold field (#11004)
This commit is contained in:
parent
415978d965
commit
4890b16b49
@ -75,8 +75,7 @@ export const MilestoneProgressionTimeInput = ({
|
||||
return (
|
||||
<StyledInputGroup>
|
||||
<StyledTextField
|
||||
type='text'
|
||||
inputMode='numeric'
|
||||
type='number'
|
||||
value={timeValue}
|
||||
onChange={onTimeValueChange}
|
||||
onPaste={handleNumericPaste}
|
||||
|
||||
@ -244,7 +244,6 @@ export const SafeguardForm = ({
|
||||
<StyledLabel>filtered by</StyledLabel>
|
||||
<FormControl variant='outlined' size='small'>
|
||||
<StyledSelect
|
||||
sx={{ minWidth: 200 }}
|
||||
value={appName}
|
||||
onChange={(e) =>
|
||||
handleApplicationChange(String(e.target.value))
|
||||
@ -287,12 +286,15 @@ export const SafeguardForm = ({
|
||||
|
||||
<FormControl variant='outlined' size='small'>
|
||||
<TextField
|
||||
sx={{ minWidth: 120 }}
|
||||
type='number'
|
||||
inputProps={{
|
||||
step: 0.1,
|
||||
}}
|
||||
value={threshold}
|
||||
onChange={(e) =>
|
||||
handleThresholdChange(Number(e.target.value))
|
||||
}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
handleThresholdChange(Number(value));
|
||||
}}
|
||||
placeholder='Value'
|
||||
variant='outlined'
|
||||
size='small'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useState, useCallback } from 'react';
|
||||
import { isPast, addMinutes } from 'date-fns';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { addMinutes, isPast } from 'date-fns';
|
||||
import type { MilestoneStatus } from '../ReleasePlanMilestone/ReleasePlanMilestoneStatus.tsx';
|
||||
import { formatDateYMDHM } from 'utils/formatDate.ts';
|
||||
|
||||
@ -112,10 +112,7 @@ export const useMilestoneProgressionForm = (
|
||||
event: React.ChangeEvent<HTMLInputElement>,
|
||||
) => {
|
||||
const inputValue = event.target.value;
|
||||
if (inputValue === '' || /^\d+$/.test(inputValue)) {
|
||||
const value = inputValue === '' ? 0 : Number.parseInt(inputValue);
|
||||
setTimeValue(value);
|
||||
}
|
||||
setTimeValue(Number(inputValue));
|
||||
};
|
||||
|
||||
const clearErrors = useCallback(() => {
|
||||
|
||||
@ -15,7 +15,7 @@ export const ModeSelector: FC<ModeSelectorProps> = ({
|
||||
}) => {
|
||||
if (metricType === 'unknown') return null;
|
||||
return (
|
||||
<FormControl variant='outlined' size='small' sx={{ minWidth: 200 }}>
|
||||
<FormControl variant='outlined' size='small'>
|
||||
<InputLabel id='mode-select-label'>Mode</InputLabel>
|
||||
<Select
|
||||
labelId='mode-select-label'
|
||||
|
||||
@ -9,7 +9,7 @@ export type RangeSelectorProps = {
|
||||
};
|
||||
|
||||
export const RangeSelector: FC<RangeSelectorProps> = ({ value, onChange }) => (
|
||||
<FormControl variant='outlined' size='small' sx={{ minWidth: 200 }}>
|
||||
<FormControl variant='outlined' size='small'>
|
||||
<InputLabel id='range-select-label'>Time</InputLabel>
|
||||
<Select
|
||||
labelId='range-select-label'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user