mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
fix(AlertReports): disabling value when not null option is active (#27550)
(cherry picked from commit ed9e542781
)
This commit is contained in:
parent
32aa25ae17
commit
34b06f94ab
@ -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
|
||||
|
@ -1417,7 +1417,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
|
||||
@ -1426,7 +1427,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
Block a user