-
Notifications
You must be signed in to change notification settings - Fork 95
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
Scan config dialog improvements #1624
Conversation
Use camelCase name
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.
Use a more descriptive component name.
This commit was only a leftover. The config isn't required anymore in the EditScanConfigDialog.
The prop isn't used anymore.
Adjust the policy component to use similar code as the scan config for editing.
The create policy dialog doesn't expect a base and scanner_id prop anymore.
Avoid proptype warning in policy details page tests.
@@ -143,15 +143,15 @@ const ScannerPreferences = ({ | |||
</Section> | |||
); | |||
|
|||
export const ScannerPreferencePropType = PropTypes.shape({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as with NvtPreferencePropType
Co-Authored-By: Steffen Waterkamp <32056637+swaterkamp@users.noreply.github.com>
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 Report
@@ 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
Continue to review full report at Codecov.
|
Checklist: