Skip to content

Commit

Permalink
Fix changing Trend and Select for nvt families and whole selection only
Browse files Browse the repository at this point in the history
(cherry picked from commit 5e794f0)
  • Loading branch information
swaterkamp authored and mergify-bot committed May 12, 2021
1 parent f62cb67 commit be44236
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions gsa/src/web/pages/scanconfigs/nvtfamilies.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,18 @@ const NvtFamily = ({
name={familyName}
checked={isToSelectWhole || trend === SCANCONFIG_TREND_DYNAMIC}
convert={parseTrend}
disabled={isToSelectWhole}
value={SCANCONFIG_TREND_DYNAMIC}
onChange={onTrendChange}
/>
<Trend trend={SCANCONFIG_TREND_DYNAMIC} />
<Trend active={!isToSelectWhole} trend={SCANCONFIG_TREND_DYNAMIC} />
<Radio
flex
name={familyName}
checked={!isToSelectWhole && trend === SCANCONFIG_TREND_STATIC}
checked={
(!isToSelectWhole && trend === SCANCONFIG_TREND_STATIC) ||
(isToSelectWhole && select === NO_VALUE)
}
disabled={isToSelectWhole}
convert={parseTrend}
value={SCANCONFIG_TREND_STATIC}
Expand Down Expand Up @@ -155,8 +159,11 @@ const NvtFamilies = ({
onValueChange(trend, 'trend');
};
const onSelectChange = (value, name) => {
const isToSelectWhole = WHOLE_SELECTION_FAMILIES.includes(name);
select[name] = value;

if (isToSelectWhole) {
onTrendChange(value, name);
}
onValueChange(select, 'select');
};
return (
Expand Down

0 comments on commit be44236

Please sign in to comment.