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

Show error message on trying to delete last dashboard #3232

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

johannaengland
Copy link
Contributor

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:

{% if request.account.account_dashboards.count > 1 %}

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

Copy link

github-actions bot commented Nov 21, 2024

🦙 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

Copy link

github-actions bot commented Nov 21, 2024

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 7720f56.

♻️ 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 (3c80b8b) to head (7720f56).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           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           

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


🚨 Try these New Features:

@stveit stveit self-requested a review November 22, 2024 14:07
Copy link
Contributor

@stveit stveit left a comment

Choose a reason for hiding this comment

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

I rescind my earlier approval, i still get the [object Object] message when trying to delete
image

@stveit
Copy link
Contributor

stveit commented Nov 22, 2024

Could this be some javascript shenanigans?

@stveit
Copy link
Contributor

stveit commented Nov 22, 2024

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

@johannaengland johannaengland force-pushed the bugfix/delete-last-dashboard branch from c499d88 to 7720f56 Compare November 25, 2024 10:03
@johannaengland johannaengland merged commit 6b1b864 into master Nov 25, 2024
13 of 14 checks passed
@johannaengland johannaengland deleted the bugfix/delete-last-dashboard branch November 25, 2024 10:15
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