Skip to content

Shared dashboards: Add dashboard search form#3557

Merged
Simrayz merged 4 commits intofeat/support-loading-shared-dashboardsfrom
feat/3556-add-dashboard-search
Oct 2, 2025
Merged

Shared dashboards: Add dashboard search form#3557
Simrayz merged 4 commits intofeat/support-loading-shared-dashboardsfrom
feat/3556-add-dashboard-search

Conversation

@Simrayz
Copy link
Copy Markdown
Contributor

@Simrayz Simrayz commented Sep 24, 2025

Scope and purpose

Resolves #3556, part of #2344.
Dependent on PR #3553.

No-news as #3551 contains the news fragment.

This PR adds search functionality to the dashboard navigation. A user can search for shared dashboards by dashboard name, account name or account login. Dashboards belonging to the current account are excluded, and the search results show whether the user is currently subscribed.

I added two methods of triggering the search modal: From within the "Add dashboard" popover, and with a separate search button. Having both might be overkill, but I either could be a good solution.

This pull request

  • Adds a dashboard search modal and search results template
  • Adds views for displaying a search modal and handling shared dashboard search
  • Adds a name to the non_admin_account fixture, necessary for the tests to work.

How to test

You'll need two different users, so if have admin and you can make a new test user that's the easiest.

  1. Make a test user, sudo to it, and have that test user make a shared dashboard.
  2. Desudo and search for the new dashboard.
  3. If you find it and view it, you are not subscribed so it'll disappaer on page reload.
  4. Subscribe to the dashboard.

Screenshots

Dashboard search results

Dashboards found No dashboards found
image image

Open dashboard search

From add dashboard popover With search button trigger
image image

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
  • The first line of the commit message 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/
  • This pull request is based 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 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

@Simrayz Simrayz self-assigned this Sep 24, 2025
@Simrayz Simrayz added enhancement nonews No news fragment is necessary for this PR (e.g. refactoring, cleanups, workflow/development changes) labels Sep 24, 2025
@Simrayz Simrayz changed the title Feat/3556 add dashboard search Add dashboard search form Sep 24, 2025
@Simrayz Simrayz changed the base branch from master to feat/support-loading-shared-dashboards September 24, 2025 11:58
@Simrayz Simrayz requested a review from a team September 24, 2025 12:03
@Simrayz Simrayz marked this pull request as ready for review September 24, 2025 12:03
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 24, 2025

Test results

    27 files      27 suites   45m 18s ⏱️
 2 580 tests  2 580 ✅ 0 💤 0 ❌
19 030 runs  19 030 ✅ 0 💤 0 ❌

Results for commit 0b6a32d.

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.21%. Comparing base (771f0a7) to head (0e09189).

Additional details and impacted files
@@                            Coverage Diff                             @@
##           feat/support-loading-shared-dashboards    #3557      +/-   ##
==========================================================================
+ Coverage                                   62.20%   62.21%   +0.01%     
==========================================================================
  Files                                         611      611              
  Lines                                       44925    44939      +14     
  Branches                                       43       43              
==========================================================================
+ Hits                                        27946    27960      +14     
  Misses                                      16969    16969              
  Partials                                       10       10              

☔ View full report in Codecov by Sentry.
📢 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.

@Simrayz Simrayz changed the title Add dashboard search form Shared dashboards: Add dashboard search form Sep 24, 2025
Copy link
Copy Markdown
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

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

Nothing serious spotted, will test manually.

@Simrayz Simrayz force-pushed the feat/support-loading-shared-dashboards branch 2 times, most recently from 72e875f to d3ee6c1 Compare September 25, 2025 07:38
@Simrayz Simrayz force-pushed the feat/3556-add-dashboard-search branch from 06e6e4d to 13a456e Compare September 25, 2025 07:47
@hmpf
Copy link
Copy Markdown
Contributor

hmpf commented Sep 25, 2025

Out of scope..

Follow-up #1: Maybe a "tour" of how the new feature works?
Follow-up #2: More important: Mark a subscribed and not subscribed dashboard differently.

@hmpf hmpf self-requested a review September 25, 2025 10:47
Copy link
Copy Markdown
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

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

Passes manual test with flying colors but I got a bit confused about how to subscribe/knowing if the dashboard was subscribed to.

Copy link
Copy Markdown
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

I only have time to add one usability thought before I have to run:

Clicking the search button opens a modal, but I need to manually click the search element to enter search text. The search text field should be automatically focused when the dialog appears.

@Simrayz Simrayz force-pushed the feat/3556-add-dashboard-search branch from 13a456e to 1ccf3c1 Compare September 26, 2025 08:30
@Simrayz
Copy link
Copy Markdown
Contributor Author

Simrayz commented Sep 26, 2025

I only have time to add one usability thought before I have to run:

Clicking the search button opens a modal, but I need to manually click the search element to enter search text. The search text field should be automatically focused when the dialog appears.

Added autofocus to the search input, and adjusted subscribed tag and view button slightly.

image

@Simrayz Simrayz requested a review from lunkwill42 September 26, 2025 08:32
@Simrayz Simrayz force-pushed the feat/support-loading-shared-dashboards branch from 0c679f8 to bb94025 Compare September 26, 2025 10:10
@Simrayz Simrayz force-pushed the feat/3556-add-dashboard-search branch from 1ccf3c1 to ddaea53 Compare September 26, 2025 10:11
@Simrayz Simrayz force-pushed the feat/support-loading-shared-dashboards branch from bb94025 to f3078e4 Compare September 26, 2025 10:23
@Simrayz Simrayz force-pushed the feat/3556-add-dashboard-search branch 2 times, most recently from 7514947 to 96ea344 Compare September 26, 2025 10:56
@Simrayz Simrayz force-pushed the feat/support-loading-shared-dashboards branch from 5340d39 to edd62b1 Compare September 29, 2025 09:01
@Simrayz Simrayz force-pushed the feat/3556-add-dashboard-search branch from 96ea344 to 0b6a32d Compare September 29, 2025 09:08
Copy link
Copy Markdown
Contributor

@johannaengland johannaengland left a comment

Choose a reason for hiding this comment

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

I agree that having both way of getting to the search is overkill and I prefer having the search within the "Add dashboard" popover

Copy link
Copy Markdown
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

I think this will do, but agree with most of what @johannaengland said as well :)

@Simrayz Simrayz force-pushed the feat/3556-add-dashboard-search branch from 0b6a32d to 0e09189 Compare October 2, 2025 13:41
@Simrayz Simrayz merged commit 2dfd09c into feat/support-loading-shared-dashboards Oct 2, 2025
13 of 14 checks passed
@Simrayz Simrayz deleted the feat/3556-add-dashboard-search branch October 2, 2025 13:41
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Oct 2, 2025

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

Labels

enhancement nonews No news fragment is necessary for this PR (e.g. refactoring, cleanups, workflow/development changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for searching for shared dashboards

4 participants