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

Disable deleting of default dashboard #3233

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

johannaengland
Copy link
Contributor

@johannaengland johannaengland commented Nov 21, 2024

This will disable deleting of a dashboard if it is the default on and show an alert box why it was not possible to delete the dashboard.

image

Copy link

github-actions bot commented Nov 21, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 992 0 12.79s
✅ PYTHON ruff 988 0 0.11s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copy link

github-actions bot commented Nov 21, 2024

Test results

    9 files      9 suites   8m 8s ⏱️
2 143 tests 2 143 ✅ 0 💤 0 ❌
4 025 runs  4 025 ✅ 0 💤 0 ❌

Results for commit 6c55c5a.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.40%. Comparing base (6b1b864) to head (6c55c5a).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3233   +/-   ##
=======================================
  Coverage   60.40%   60.40%           
=======================================
  Files         605      605           
  Lines       43683    43685    +2     
  Branches       48       48           
=======================================
+ Hits        26385    26388    +3     
+ Misses      17286    17285    -1     
  Partials       12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@stveit
Copy link
Contributor

stveit commented Nov 22, 2024

Is the end goal avoiding the default dashboard from being deleted, or avoiding that there is no default dashboard? #3150 described the expected behaviour to be that if the original dashboard is deleted, then another dashboard (assuming there are more than one) should become the new default. So if someone has 2 dashboard, then its fine for the default to be deleted.

Assuming that is how we want to solve this, I feel like the error message should be something along the lines of "You cannot delete your last dashboard", since there situations where it actually is okay to delete the dashboard

@johannaengland
Copy link
Contributor Author

Is the end goal avoiding the default dashboard from being deleted, or avoiding that there is no default dashboard? #3150 described the expected behaviour to be that if the original dashboard is deleted, then another dashboard (assuming there are more than one) should become the new default. So if someone has 2 dashboard, then its fine for the default to be deleted.

Assuming that is how we want to solve this, I feel like the error message should be something along the lines of "You cannot delete your last dashboard", since there situations where it actually is okay to delete the dashboard

I will edit the original issue, because in the meantime @lunkwill42 and I decided it is better to outright disable deletion of the default dashboard.

Another part of fixing this that is on the way is adding two migrations that will ensure that after applying them every user will have exactly one dashboard.

@johannaengland johannaengland force-pushed the bugfix/delete-last-dashboard branch from c499d88 to 7720f56 Compare November 25, 2024 10:03
Base automatically changed from bugfix/delete-last-dashboard to master November 25, 2024 10:15
@johannaengland johannaengland force-pushed the bugfix/delete-default-dashboard branch from 1162b47 to 6c55c5a Compare November 25, 2024 10:16
@johannaengland johannaengland merged commit 480b586 into master Nov 25, 2024
14 checks passed
@johannaengland johannaengland deleted the bugfix/delete-default-dashboard branch November 25, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants