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

Fix unable to edit schedules with number only name #2914

Merged
merged 4 commits into from
May 17, 2021
Merged

Fix unable to edit schedules with number only name #2914

merged 4 commits into from
May 17, 2021

Conversation

nichtsfrei
Copy link
Member

@nichtsfrei nichtsfrei commented May 17, 2021

When adding a new schedule with a numbers only name 1234 and daily
re occurrence and trying to edit the new schedule than a:

TypeError: e.replace is not a function

occurs because name is a number and not a string.

To fix that name.toString() is called to explicitly cast it to string.

What:

Why:

How:

Checklist:

  • Tests
  • CHANGELOG Entry
  • Labels for ports to other branches

@nichtsfrei nichtsfrei added bug port-to-main Use mergifiy to port PR to master labels May 17, 2021
@nichtsfrei nichtsfrei marked this pull request as ready for review May 17, 2021 09:57
@nichtsfrei nichtsfrei requested a review from a team as a code owner May 17, 2021 09:57
@codecov
Copy link

codecov bot commented May 17, 2021

Codecov Report

Merging #2914 (8e5f1c1) into gsa-21.04 (74a1fd3) will increase coverage by 0.00%.
The diff coverage is 77.77%.

❗ Current head 8e5f1c1 differs from pull request most recent head e948448. Consider uploading reports for the commit e948448 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           gsa-21.04    #2914   +/-   ##
==========================================
  Coverage      53.83%   53.84%           
==========================================
  Files           1075     1075           
  Lines          26226    26250   +24     
  Branches        7491     7506   +15     
==========================================
+ Hits           14118    14133   +15     
- Misses         10993    11000    +7     
- Partials        1115     1117    +2     
Impacted Files Coverage Δ
gsa/src/web/pages/notes/dialog.js 4.87% <ø> (ø)
gsa/src/web/pages/nvts/solution.js 22.22% <0.00%> (-11.12%) ⬇️
gsa/src/web/pages/radius/dialog.js 66.66% <ø> (ø)
gsa/src/web/pages/results/dashboard/index.js 75.00% <ø> (ø)
gsa/src/web/pages/results/details.js 6.74% <0.00%> (-0.16%) ⬇️
gsa/src/web/pages/schedules/dialog.js 10.23% <ø> (ø)
gsa/src/web/pages/targets/details.js 10.00% <ø> (ø)
gsa/src/web/pages/usersettings/dialog.js 29.41% <ø> (ø)
gsa/src/web/pages/scanners/dialog.js 70.31% <66.66%> (+0.47%) ⬆️
gsa/src/web/pages/scanconfigs/nvtfamilies.js 90.62% <80.00%> (-2.24%) ⬇️
... 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 a2503c8...e948448. Read the comment docs.

Copy link
Member

@swaterkamp swaterkamp left a comment

Choose a reason for hiding this comment

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

Please add new changelog entries to the top of the list

nichtsfrei and others added 3 commits May 17, 2021 13:18
When adding a new schedule with a numbers only name `1234` and daily
re occurrence and trying to edit the new schedule than a:
```
TypeError: e.replace is not a function
```
occurs because name is a number and not a string.

To fix that name.toString() is called to explicitly cast it to string.
@swaterkamp swaterkamp self-requested a review May 17, 2021 11:21
swaterkamp
swaterkamp previously approved these changes May 17, 2021
Using a template literal for converting an object to string is easier to read and imho safer to do.
@bjoernricks bjoernricks merged commit a8e2af8 into greenbone:gsa-21.04 May 17, 2021
bjoernricks added a commit that referenced this pull request May 17, 2021
Fix unable to edit schedules with number only name (backport #2914)
bjoernricks added a commit that referenced this pull request May 17, 2021
Fix unable to edit schedules with number only name (backport #2914)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug port-to-main Use mergifiy to port PR to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants