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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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 991 0 13.47s
✅ PYTHON ruff 987 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   9m 0s ⏱️
2 140 tests 2 140 ✅ 0 💤 0 ❌
4 019 runs  4 019 ✅ 0 💤 0 ❌

Results for commit c499d88.

♻️ 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.39%. Comparing base (27b12b5) to head (c499d88).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3232   +/-   ##
=======================================
  Coverage   60.39%   60.39%           
=======================================
  Files         605      605           
  Lines       43687    43687           
  Branches       48       48           
=======================================
+ Hits        26383    26386    +3     
+ Misses      17292    17289    -3     
  Partials       12       12           

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


🚨 Try these New Features:

Copy link

sonarcloud bot commented Nov 21, 2024

@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

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