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

Create alerts via graphql #2425

Merged
merged 30 commits into from
Aug 28, 2020
Merged

Conversation

saberlynx
Copy link
Contributor

@saberlynx saberlynx commented Aug 27, 2020

What:
Implement a handleSaveAlert method using the createAlert mutation then refetch alerts after creating the alert.

Why:

It is possible to create alerts from the task dialog.

How:

Checklist:

@saberlynx saberlynx marked this pull request as ready for review August 27, 2020 11:13
@saberlynx saberlynx requested a review from a team August 27, 2020 11:13
@saberlynx saberlynx marked this pull request as draft August 27, 2020 11:13
@codecov
Copy link

codecov bot commented Aug 27, 2020

Codecov Report

Merging #2425 into master will increase coverage by 0.26%.
The diff coverage is 94.70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2425      +/-   ##
==========================================
+ Coverage   54.95%   55.21%   +0.26%     
==========================================
  Files        1094     1095       +1     
  Lines       26573    26734     +161     
  Branches     7538     7642     +104     
==========================================
+ Hits        14603    14762     +159     
- Misses      10862    10865       +3     
+ Partials     1108     1107       -1     
Impacted Files Coverage Δ
gsa/src/web/pages/alerts/component.js 22.31% <22.22%> (+0.09%) ⬆️
gsa/src/web/pages/tasks/component.js 35.95% <50.00%> (+0.39%) ⬆️
gsa/src/web/pages/alerts/parser.js 99.32% <99.32%> (ø)
gsa/src/gmp/commands/alerts.js 14.28% <100.00%> (ø)
gsa/src/web/graphql/alerts.js 100.00% <100.00%> (ø)
gsa/src/web/pages/extras/feedstatuspage.js 94.11% <0.00%> (-3.56%) ⬇️
gsa/src/gmp/models/portlist.js 92.30% <0.00%> (-0.29%) ⬇️
gsa/src/gmp/models/scanconfig.js 98.57% <0.00%> (-0.03%) ⬇️
gsa/src/gmp/gmpsettings.js 96.19% <0.00%> (ø)
gsa/src/gmp/models/policy.js 100.00% <0.00%> (ø)
... 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 e51bc9f...aba80b7. Read the comment docs.

@saberlynx saberlynx marked this pull request as ready for review August 27, 2020 15:51
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.

The whole conversion seems to be unnecessary to me. Why not unify the API and frontend? The frontend should just use the values that the backend expects. And you are free to adjust the backend for the frontend needs.

Comment on lines +138 to +139
composer_include_notes: 1,
composer_include_overrides: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not be send via the api. At least not as methodData. We need to think about the api changes for the content composer sometime in future.

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.

Am really not satisfied with the alert handling and the API but we leave it as it is atm.

@bjoernricks bjoernricks merged commit 2e5e036 into greenbone:master Aug 28, 2020
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