Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decide whether to default to full and fast scan config (task dialog) #1671

Merged
merged 3 commits into from
Oct 9, 2019

Conversation

saberlynx
Copy link
Contributor

@saberlynx saberlynx commented Oct 8, 2019

Summary of changes:

  • moved handleScannerChange out of ScannerSelect
  • Refactored ScannerSelect into function
  • Added state variables configType and prevConfigType, and calculate/update them in handleScannerChange, and upon onScanConfigChange.

Expected behavior:

  • Changing between scanners of the same config type should not change displayed scan config selection
  • Edit dialog should show correct scan config
  • Scan config should default to "Full and Fast" when 1. creating a new task 2. changing configType from something else TO openvas config type.

Checklist:

@codecov
Copy link

codecov bot commented Oct 8, 2019

Codecov Report

Merging #1671 into gsa-9.0 will decrease coverage by 0.01%.
The diff coverage is 2.94%.

Impacted file tree graph

@@             Coverage Diff             @@
##           gsa-9.0    #1671      +/-   ##
===========================================
- Coverage       47%   46.98%   -0.02%     
===========================================
  Files         1047     1047              
  Lines        24072    24082      +10     
  Branches      6733     6712      -21     
===========================================
  Hits         11314    11314              
- Misses       11612    11620       +8     
- Partials      1146     1148       +2
Impacted Files Coverage Δ
gsa/src/web/pages/tasks/dialog.js 4.91% <2.94%> (-0.44%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17fd0bf...943dc70. Read the comment docs.

@saberlynx saberlynx marked this pull request as ready for review October 8, 2019 11:38
Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to say the scan config and scanner state must be move one layer upwards into the taskcomponent but maybe I am wrong and it can be solved in the dialog too.

The state of the scanner type and scan config should be initialized via useEffect and afterwards the state should only be updated via change handlers. Maybe we should introduce one config_id variable for each purpose. E.g. currentOspdConfigId currentOpenvasConfigId or something like that. Or use an object currentConfigIds = {openvas: ..., osp: ..., other: ...}

gsa/src/web/pages/tasks/dialog.js Outdated Show resolved Hide resolved
gsa/src/web/pages/tasks/dialog.js Outdated Show resolved Hide resolved
@saberlynx saberlynx added the work in progress This pull request should not be merged yet, more commits are expected label Oct 8, 2019
@swaterkamp
Copy link
Member

I was thinking to use the task component's state to control the dialog content (scanner and scan config types), but I think I haven't been clear about that, sorry.

@saberlynx saberlynx removed the work in progress This pull request should not be merged yet, more commits are expected label Oct 8, 2019
Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good! Just one small change and could you update your PR to be against the gsa-9.0 branch? It should be included in GOS 6 already.

gsa/src/web/pages/tasks/dialog.js Outdated Show resolved Hide resolved
@saberlynx saberlynx changed the base branch from master to gsa-9.0 October 9, 2019 07:16
@saberlynx saberlynx changed the base branch from gsa-9.0 to master October 9, 2019 07:17
…ect into a function, and added some update logic.
@saberlynx saberlynx changed the base branch from master to gsa-9.0 October 9, 2019 07:26
@bjoernricks bjoernricks merged commit 80b2985 into greenbone:gsa-9.0 Oct 9, 2019
@saberlynx saberlynx deleted the task-dialog-default branch November 11, 2019 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants