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

Model boolean parsing #1406

Merged
merged 8 commits into from May 15, 2019
Merged

Model boolean parsing #1406

merged 8 commits into from May 15, 2019

Conversation

bjoernricks
Copy link
Member

@bjoernricks bjoernricks commented May 15, 2019

Checklist:

The protocol is not very specific about boolean values. We have
considered '1' for 'true' and '0' for 'false' at the parseYesNo function
but this may not sufficient.

Therefore add a new parser function to
1. Use real boolean values (true/false) in the js code
2. Consider more values as true like the protocol does
Test also parsing of orphan, active and trash values.
Add tests for isInTrash, isWriteable and isOrphan.
These methods are now tested via the testModel test creator function
automatically.
Parse in_use with parseBoolean and as inUse property.
* isInUse should be passed as prop to the dialogs and not checked within
  the dialog
* Dialogs should not require a model in future and expect all arguments
  as props
* isInUse should be the variable name instead of in_use

To implement all these points further commits are required. This commit
only touches code paths which are easy to change without the risk to
break existing code.
@bjoernricks bjoernricks marked this pull request as ready for review May 15, 2019 12:51
@bjoernricks bjoernricks requested a review from a team May 15, 2019 12:51
@codecov
Copy link

codecov bot commented May 15, 2019

Codecov Report

Merging #1406 into gsa-8.0 will increase coverage by 0.16%.
The diff coverage is 88.15%.

Impacted file tree graph

@@             Coverage Diff             @@
##           gsa-8.0    #1406      +/-   ##
===========================================
+ Coverage    36.51%   36.68%   +0.16%     
===========================================
  Files          960      960              
  Lines        21678    21739      +61     
  Branches      6033     6039       +6     
===========================================
+ Hits          7915     7974      +59     
- Misses       12432    12434       +2     
  Partials      1331     1331
Impacted Files Coverage Δ
gsa/src/web/pages/roles/component.js 1.4% <ø> (ø) ⬆️
gsa/src/web/pages/targets/dialog.js 20.28% <0%> (ø) ⬆️
gsa/src/web/pages/roles/dialog.js 8% <0%> (-0.7%) ⬇️
gsa/src/web/pages/scanners/dialog.js 14.06% <0%> (ø) ⬆️
gsa/src/gmp/model.js 100% <100%> (ø) ⬆️
gsa/src/gmp/models/testing.js 100% <100%> (ø) ⬆️
gsa/src/gmp/parser.js 99.14% <100%> (+0.02%) ⬆️

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 32fd507...28f94ac. Read the comment docs.

@bjoernricks bjoernricks merged commit a8eb5d9 into greenbone:gsa-8.0 May 15, 2019
@bjoernricks bjoernricks deleted the model-boolean-parsing branch May 15, 2019 14:01
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.

None yet

2 participants