Uninett / nav

Network Administration Visualized
GNU General Public License v3.0
194 stars 39 forks source link

Show error message on trying to delete last dashboard #3232

Closed johannaengland closed 2 days ago

johannaengland commented 6 days ago

This is not an actual bug, but something I noticed when working on #3150.

The "Delete dashboard" button is already not shown when there is only one dashboard, so it is not possible for a user to try to delete their last dashboard.

So to reproduce this you need to change this line to actually show that button: https://github.com/Uninett/nav/blob/27b12b527aac40a9702cc515981346e21eab89bf/python/nav/web/templates/webfront/index.html#L147

After that when trying to delete the last dashboard an alert box will be added with the content [Object object] instead of showing the correct error message Cannot delete last dashboard.

Before: image

After: image

github-actions[bot] commented 6 days ago

πŸ¦™ MegaLinter status: βœ… SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
βœ… PYTHON black 992 0 13.17s
βœ… PYTHON ruff 988 0 0.1s

See detailed report in MegaLinter reports

_MegaLinter is graciously provided by OX Security_

github-actions[bot] commented 6 days ago

Test results

β€‡β€ˆβ€‡β€‡9 filesβ€„β€ƒβ€‡β€ˆβ€‡β€‡9 suites   8m 28s ⏱️ 2β€ˆ142 tests 2β€ˆ142 βœ…β€ƒ0 πŸ’€β€ƒ0 ❌ 4β€ˆ023 runsβ€Šβ€ƒ4β€ˆ023 βœ…β€ƒ0 πŸ’€β€ƒ0 ❌

Results for commit 7720f56f.

:recycle: This comment has been updated with latest results.

codecov[bot] commented 6 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 60.40%. Comparing base (3c80b8b) to head (7720f56). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3232 +/- ## ======================================= Coverage 60.39% 60.40% ======================================= Files 605 605 Lines 43683 43683 Branches 48 48 ======================================= + Hits 26382 26385 +3 + Misses 17289 17286 -3 Partials 12 12 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

stveit commented 5 days ago

Could this be some javascript shenanigans?

stveit commented 5 days ago

Yeah nevermind, just my js scripts werent updated. Had to down-up the containers and now it works fine

sonarcloud[bot] commented 2 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud