Skip to content

Forbid setting dashboard name to empty#4092

Draft
johannaengland wants to merge 3 commits into
Uninett:5.19.xfrom
johannaengland:bugfix/empty-dashboard-name
Draft

Forbid setting dashboard name to empty#4092
johannaengland wants to merge 3 commits into
Uninett:5.19.xfrom
johannaengland:bugfix/empty-dashboard-name

Conversation

@johannaengland

@johannaengland johannaengland commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Scope and purpose

Fixes #4061. In draft since only added constraint and tests for now. It is still lacking actually updating add_dashboard and rename_dashboard to empty string/whitespace and showing the user an error message when they try to set it to empty.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with ruff, easiest by using pre-commit
  • Wrote the commit message so that the first line continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • Based this pull request on the correct upstream branch: For a patch/bugfix affecting the latest stable version, it should be based on that version's branch (<major>.<minor>.x). For a new feature or other additions, it should be based on master.
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If it's not obvious from a linked issue, described how to interact with NAV in order for a reviewer to observe the effects of this change first-hand (commands, URLs, UI interactions)
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this adds a new Python source code file: Added the boilerplate header to that file

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

5 of 93 new test names are missing convention keywords (given/when/then/it_should)

File Test name
tests/integration/web/dashboard_test.py test_should_render_import_dashboard_modal
tests/integration/web/dashboard_test.py test_exported_file_should_have_correct_headers
tests/integration/web/dashboard_test.py test_should_render_search_dashboard_modal
tests/integration/web/dashboard_test.py test_response_should_contain_nav_dashboard_reload_event
tests/integration/web/dashboard_test.py test_dashboard_load_should_contain_correct_number_of_columns
Why am I seeing this?

Test names should follow a loose given/when/then pattern with keywords like given, when, then, or it_should. This is a suggestion, not a blocker. The check runs on new test methods added in this PR.

Examples:

  • test_when_no_incidents_then_returns_empty_list
  • test_it_should_create_incident_with_set_description
  • test_given_expired_token_when_refreshing_then_raises_error

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.16%. Comparing base (daa519f) to head (7daad10).

Additional details and impacted files
@@            Coverage Diff             @@
##           5.18.x    #4092      +/-   ##
==========================================
+ Coverage   64.15%   64.16%   +0.01%     
==========================================
  Files         628      628              
  Lines       46553    46553              
  Branches       43       43              
==========================================
+ Hits        29867    29873       +6     
+ Misses      16676    16670       -6     
  Partials       10       10              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@johannaengland
johannaengland force-pushed the bugfix/empty-dashboard-name branch from 7daad10 to 7ce970a Compare July 10, 2026 13:42
@johannaengland
johannaengland force-pushed the bugfix/empty-dashboard-name branch from 7ce970a to f6ebd4f Compare July 10, 2026 13:49
@johannaengland
johannaengland changed the base branch from 5.18.x to 5.19.x July 10, 2026 13:49
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant