fix(AlertReports): disabling value when not null option is active (#27550)
This commit is contained in:
parent
fa3fea9dd8
commit
ed9e542781
|
|
@ -371,12 +371,15 @@ test('disables condition threshold if not null condition is selected', async ()
|
|||
userEvent.click(screen.getByTestId('alert-condition-panel'));
|
||||
await screen.findByText(/smaller than/i);
|
||||
const condition = screen.getByRole('combobox', { name: /condition/i });
|
||||
const spinButton = screen.getByRole('spinbutton');
|
||||
expect(spinButton).toHaveValue(10);
|
||||
await comboboxSelect(
|
||||
condition,
|
||||
'not null',
|
||||
() => screen.getAllByText(/not null/i)[0],
|
||||
);
|
||||
expect(screen.getByRole('spinbutton')).toBeDisabled();
|
||||
expect(spinButton).toHaveValue(null);
|
||||
expect(spinButton).toBeDisabled();
|
||||
});
|
||||
|
||||
// Content Section
|
||||
|
|
|
|||
|
|
@ -1410,7 +1410,8 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
|
|||
</StyledInputContainer>
|
||||
<StyledInputContainer css={noMarginBottom}>
|
||||
<div className="control-label">
|
||||
{t('Value')} <span className="required">*</span>
|
||||
{t('Value')}{' '}
|
||||
{!conditionNotNull && <span className="required">*</span>}
|
||||
</div>
|
||||
<div className="input-container">
|
||||
<input
|
||||
|
|
@ -1419,7 +1420,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
|
|||
disabled={conditionNotNull}
|
||||
value={
|
||||
currentAlert?.validator_config_json?.threshold !==
|
||||
undefined
|
||||
undefined && !conditionNotNull
|
||||
? currentAlert.validator_config_json.threshold
|
||||
: ''
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue