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

Scan config dialog improvements #1624

Merged
merged 116 commits into from
Sep 16, 2019
Merged

Scan config dialog improvements #1624

merged 116 commits into from
Sep 16, 2019

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented Sep 11, 2019

Checklist:

@bjoernricks bjoernricks marked this pull request as ready for review September 12, 2019 13:03
Use new constants and parser function from ScanConfig model for the
EditDialog.
* Put the calculation of the nvt family trends and selection into an own
  function. This will allow to move the calculation code in future.

* Also fix the selection by using family maxNvtCount instead of max

* Use new scanconfig constants instead of yes/no
Only pass required data from loading to the dialog to saving.
Update editing and saving default timeouts and use camel case for all
nvt preferences related variables.
Version got dropped from nvts. Instead last modified is displayed now.
A user should look at the details page if he is interested in the
overrides or notes. Dropping them from the dialog will simplify our
requests in future.
Since we only need the nvt from this command just return the nvt model
in the response data now.
Use shape to specify the expected object shape for the preference.
It is often very difficult to gather which objects in which shape must
be passed to a dialog component. Therefore it is better to pass used
properties as a prop to the dialogs directly.
Update edit scan config nvt dialog to pass all displayed values as props
to the dialog.
Internally they are mapped to the same gsad function.
Adjust policy and scanconfig components accordingly.
Don't request overrides and notes because they aren't used anymore.
Use Object.entries in conjunction with for...of loop.
Use hooks to automatically derive the preferences values object from the
preferences list.
@@ -143,15 +143,15 @@ const ScannerPreferences = ({
</Section>
);

export const ScannerPreferencePropType = PropTypes.shape({
Copy link
Member

Choose a reason for hiding this comment

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

Same as with NvtPreferencePropType

@swaterkamp
Copy link
Member

All in all this looks good to me. Just the failing tests need to be fixed. I don't know, if our CI can't handle .finally() or what else is wrong with it. As .then() is a working function, the failing code is not due to .get() being no Promise or so...

It seems nodejs 8 doesn't support Promise.finally by default.
Set exact datetime fot the test.
@codecov
Copy link

codecov bot commented Sep 16, 2019

Codecov Report

Merging #1624 into master will increase coverage by 0.33%.
The diff coverage is 54.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1624      +/-   ##
==========================================
+ Coverage      42%   42.33%   +0.33%     
==========================================
  Files        1044     1047       +3     
  Lines       23955    23988      +33     
  Branches     6635     6686      +51     
==========================================
+ Hits        10062    10156      +94     
+ Misses      12647    12593      -54     
+ Partials     1246     1239       -7
Impacted Files Coverage Δ
gsa/src/web/components/dialog/savedialog.js 73.68% <ø> (ø) ⬆️
gsa/src/gmp/commands/nvt.js 29.16% <0%> (-12.01%) ⬇️
gsa/src/web/pages/scanconfigs/component.js 1.06% <1.02%> (+0.47%) ⬆️
gsa/src/web/pages/nvts/nvtpreference.js 72.72% <100%> (ø) ⬆️
gsa/src/web/components/loading/loading.js 100% <100%> (ø) ⬆️
gsa/src/web/pages/policies/dialog.js 90% <100%> (+8.18%) ⬆️
gsa/src/gmp/models/policy.js 100% <100%> (ø) ⬆️
gsa/src/gmp/models/scanconfig.js 95.58% <100%> (ø) ⬆️
gsa/src/web/pages/policies/component.js 33.87% <31.46%> (+2.94%) ⬆️
gsa/src/web/pages/scanconfigs/dialog.js 14.28% <50%> (ø) ⬆️
... and 13 more

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 2934c3e...9beff2e. Read the comment docs.

@swaterkamp swaterkamp merged commit 100200d into greenbone:master Sep 16, 2019
@bjoernricks bjoernricks deleted the scan-config-dialog-improvements branch September 16, 2019 09:09
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.

2 participants