Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Usersettings default severity #907

Merged
merged 3 commits into from
Sep 3, 2018
Merged

Usersettings default severity #907

merged 3 commits into from
Sep 3, 2018

Conversation

bjoernricks
Copy link
Contributor

Centralize formatting of numbers to fix saving the default severity user setting.

Always format passed default severity to a one digit decimal point value
when saving the user settings. A JavaScript Number of 10 is the same as
10.0 but the backend checks for fractional digits.

Fixes #890
@codecov
Copy link

codecov bot commented Sep 3, 2018

Codecov Report

Merging #907 into master will increase coverage by 0.01%.
The diff coverage is 21.05%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #907      +/-   ##
=========================================
+ Coverage    7.35%   7.36%   +0.01%     
=========================================
  Files         825     826       +1     
  Lines       26933   26936       +3     
  Branches     5684    5703      +19     
=========================================
+ Hits         1980    1984       +4     
- Misses      22542   22544       +2     
+ Partials     2411    2408       -3
Impacted Files Coverage Δ
gsa/src/gmp/commands/users.js 3.7% <ø> (ø) ⬆️
...shboard/display/severity/severityclasstransform.js 0% <0%> (ø) ⬆️
gsa/src/web/components/form/spinner.js 0% <0%> (ø) ⬆️
gsa/src/web/components/form/numberfield.js 0% <0%> (ø) ⬆️
gsa/src/web/pages/overrides/row.js 0% <0%> (ø) ⬆️
gsa/src/gmp/utils/number.js 100% <100%> (ø)

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 5549db8...16734c2. Read the comment docs.

expect(severityValue(1.0)).toEqual('1.0');
expect(severityValue(1.1)).toEqual('1.1');
expect(severityValue(1.10)).toEqual('1.1');
expect(severityValue(1.15)).toEqual('1.1');
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this equal 1.2 as well?

@swaterkamp swaterkamp merged commit 59ce350 into greenbone:master Sep 3, 2018
@bjoernricks bjoernricks deleted the usersettings-default-severity branch September 3, 2018 13:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants