Skip to content

Commit

Permalink
Merge pull request #2867 from bjoernricks/scanner-dialog-greenbone-se…
Browse files Browse the repository at this point in the history
…nsor

Pre-select greenbone sensor as default scanner type
  • Loading branch information
bjoernricks committed Apr 23, 2021
2 parents 3794fa4 + 42310dc commit 99f5929
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unrelased]

### Added
### Changed
- Use greenbone sensor as default scanner type when opening the dialog if available [#2867](https://github.com/greenbone/gsa/pull/2867)

### Fixed
### Removed

[Unreleased]: https://github.com/greenbone/gsa/compare/v21.4.0...gsa-21.04

## [21.04] - 2021-04-16

### Added
Expand Down
8 changes: 5 additions & 3 deletions gsa/src/web/pages/scanners/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import _ from 'gmp/locale';
import {longDate} from 'gmp/locale/date';

import {filter, map} from 'gmp/utils/array';
import {isDefined} from 'gmp/utils/identity';
import {hasValue, isDefined} from 'gmp/utils/identity';
import {selectSaveId} from 'gmp/utils/id';

import {parseInt} from 'gmp/parser';
Expand Down Expand Up @@ -118,7 +118,7 @@ const ScannerDialog = ({
name = _('Unnamed'),
port = '22',
title = _('New Scanner'),
type = OSP_SCANNER_TYPE,
type,
which_cert,
onClose,
onCredentialChange,
Expand Down Expand Up @@ -159,8 +159,10 @@ const ScannerDialog = ({
const {gmp} = props;

if (gmp.settings.enableGreenboneSensor) {
SCANNER_TYPES = [OSP_SCANNER_TYPE, GREENBONE_SENSOR_SCANNER_TYPE];
type = hasValue(type) ? type : GREENBONE_SENSOR_SCANNER_TYPE;
SCANNER_TYPES = [GREENBONE_SENSOR_SCANNER_TYPE, OSP_SCANNER_TYPE];
} else {
type = hasValue(type) ? type : OSP_SCANNER_TYPE;
SCANNER_TYPES = [OSP_SCANNER_TYPE];
}

Expand Down

0 comments on commit 99f5929

Please sign in to comment.