mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
fix update severity (#56527)
This commit is contained in:
parent
c72e8e0986
commit
3601602feb
1 changed files with 6 additions and 2 deletions
|
@ -168,7 +168,6 @@ const StepAboutRuleComponent: FC<StepAboutRuleProps> = ({
|
|||
min: 0,
|
||||
fullWidth: false,
|
||||
disabled: isLoading,
|
||||
options: severityOptions,
|
||||
showTicks: true,
|
||||
tickInterval: 25,
|
||||
},
|
||||
|
@ -239,8 +238,13 @@ const StepAboutRuleComponent: FC<StepAboutRuleProps> = ({
|
|||
<FormDataProvider pathsToWatch="severity">
|
||||
{({ severity }) => {
|
||||
const newRiskScore = defaultRiskScoreBySeverity[severity as SeverityValue];
|
||||
const severityField = form.getFields().severity;
|
||||
const riskScoreField = form.getFields().riskScore;
|
||||
if (newRiskScore != null && riskScoreField.value !== newRiskScore) {
|
||||
if (
|
||||
severityField.value !== severity &&
|
||||
newRiskScore != null &&
|
||||
riskScoreField.value !== newRiskScore
|
||||
) {
|
||||
riskScoreField.setValue(newRiskScore);
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue