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

Edit dialog: only send name and comment if config or policy is in use, and add in use notification #2463

Merged
merged 23 commits into from
Sep 25, 2020

Conversation

saberlynx
Copy link
Contributor

@saberlynx saberlynx commented Sep 22, 2020

What:

If a config or policy is in use, ONLY send name and comment fields (and id, of course) through the ScanConfigCommand or PolicyCommand. Added a h4 notification in the edit dialog to make users aware that they can only edit name and comment for in use config/policy.

Why:

Currently, the edit scan config dialog sends all the form fields (even if unchanged) to the backend, even if only name and comment fields are rendered (in the case of in-use config/policy). This triggers a response from gvmd that "since the entity is in use, only name and comment can be edited". Due to this error, even if the user does everything correctly and only edit the fields available to them, it will trigger a gsad error and the dialog will not close. This is wrong and confusing for the user.

This change avoids triggering the error because nothing outside of the permitted fields are "edited", and the user is made aware why the edit dialog is so short in this case.

How:

Checklist:

@codecov
Copy link

codecov bot commented Sep 22, 2020

Codecov Report

Merging #2463 into gsa-20.08 will increase coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##           gsa-20.08    #2463      +/-   ##
=============================================
+ Coverage      52.76%   52.94%   +0.17%     
=============================================
  Files           1070     1071       +1     
  Lines          25789    25863      +74     
  Branches        7312     7376      +64     
=============================================
+ Hits           13607    13692      +85     
+ Misses         11058    11050       -8     
+ Partials        1124     1121       -3     
Impacted Files Coverage Δ
gsa/src/gmp/commands/feedstatus.js 100.00% <ø> (ø)
gsa/src/gmp/commands/policies.js 86.15% <ø> (+1.67%) ⬆️
gsa/src/gmp/commands/scanconfigs.js 90.62% <ø> (+0.73%) ⬆️
gsa/src/gmp/commands/wizard.js 9.23% <ø> (ø)
gsa/src/gmp/gmpsettings.js 95.74% <ø> (ø)
gsa/src/gmp/models/alert.js 100.00% <ø> (ø)
gsa/src/gmp/models/event.js 22.91% <ø> (+2.17%) ⬆️
gsa/src/gmp/models/nvt.js 98.87% <ø> (ø)
gsa/src/gmp/models/ovaldef.js 94.64% <ø> (ø)
gsa/src/gmp/models/policy.js 100.00% <ø> (ø)
... and 87 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 ff335c6...290df53. Read the comment docs.

@saberlynx saberlynx changed the title Edit dialog: only send name and comment if config or policy is in use, and add warning Edit dialog: only send name and comment if config or policy is in use, and add in use notification Sep 22, 2020
@saberlynx saberlynx marked this pull request as ready for review September 22, 2020 15:06
@saberlynx saberlynx requested a review from a team September 22, 2020 15:06
@saberlynx saberlynx marked this pull request as draft September 22, 2020 15:08
@saberlynx saberlynx marked this pull request as ready for review September 22, 2020 15:17
gsa/src/web/pages/policies/component.js Outdated Show resolved Hide resolved
gsa/src/web/pages/scanconfigs/component.js Outdated Show resolved Hide resolved
gsa/src/web/pages/scanconfigs/editdialog.js Outdated Show resolved Hide resolved
@saberlynx saberlynx force-pushed the edit-inuse-config branch 2 times, most recently from c9924e0 to 57e60dc Compare September 23, 2020 12:46
sarahd93
sarahd93 previously approved these changes Sep 25, 2020
@swaterkamp swaterkamp merged commit 94272e0 into greenbone:gsa-20.08 Sep 25, 2020
@saberlynx saberlynx deleted the edit-inuse-config branch September 25, 2020 08:56
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