Skip to content

Commit

Permalink
Merge pull request #2905 from swaterkamp/wholeFamilyTrendSelect
Browse files Browse the repository at this point in the history
Fix changing Trend and Select for NVT-families and whole selection only
  • Loading branch information
saberlynx authored May 12, 2021
2 parents ecefb99 + f8d79d3 commit a2503c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Use greenbone sensor as default scanner type when opening the dialog if available [#2867](https://github.com/greenbone/gsa/pull/2867)

### Fixed
- Fixed changing Trend and Select for NVT-families and whole selection only [#2905](https://github.com/greenbone/gsa/pull/2905)
- Fixed missing name for CVE results on result detailspage [#2892](https://github.com/greenbone/gsa/pull/2892)
- Fixed setting secret key in RADIUS dialog [#2891](https://github.com/greenbone/gsa/pull/2891)
- Fixed setting result UUID in notes dialog [#2889](https://github.com/greenbone/gsa/pull/2889)
Expand Down
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 a2503c8

Please sign in to comment.