Skip to content

Shared dashboards: Export and import of shared dashboards#3559

Merged
Simrayz merged 3 commits intofeat/support-loading-shared-dashboardsfrom
feat/3558-export-and-import-of-shared-dashboards
Oct 2, 2025
Merged

Shared dashboards: Export and import of shared dashboards#3559
Simrayz merged 3 commits intofeat/support-loading-shared-dashboardsfrom
feat/3558-export-and-import-of-shared-dashboards

Conversation

@Simrayz
Copy link
Copy Markdown
Contributor

@Simrayz Simrayz commented Sep 24, 2025

Scope and purpose

Resolves #3558, part of #2344.

Dependent on #3553.

This PR adds support for exporting shared dashboards, and an export action to the widget actions. I also added tests for the export view, as there were none.

In addition, I fixed a weird bug where a non-admin can't open the import modal due to this fun typo: /îndex/dashboard/importmodal instead of /index/dashboard/importmodal.

Screenshots

Export dashboard action on shared dashboards

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 requested a review from a team September 24, 2025 14:00
@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/3558 export and import of shared dashboards Shared dashboards: Export and import of shared dashboards Sep 24, 2025
@Simrayz Simrayz marked this pull request as ready for review September 24, 2025 14:04
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 24, 2025

Test results

    27 files      27 suites   45m 12s ⏱️
 2 574 tests  2 574 ✅ 0 💤 0 ❌
18 982 runs  18 982 ✅ 0 💤 0 ❌

Results for commit c2ad147.

♻️ 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.20%. Comparing base (67424dc) to head (3271252).

Additional details and impacted files
@@                           Coverage Diff                           @@
##           feat/support-loading-shared-dashboards    #3559   +/-   ##
=======================================================================
  Coverage                                   62.20%   62.20%           
=======================================================================
  Files                                         611      611           
  Lines                                       44925    44925           
  Branches                                       43       43           
=======================================================================
  Hits                                        27946    27946           
  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.

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.

I'll do a manual test of the whole shebang.

@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/3558-export-and-import-of-shared-dashboards branch from 786c8d9 to 51b48a4 Compare September 25, 2025 07:53
@Simrayz Simrayz linked an issue Sep 25, 2025 that may be closed by this pull request
@hmpf hmpf self-requested a review September 25, 2025 10:58
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.

Works, but slightly out of scope: might it be better to always have the "export"-icon and remove it from the dashboard settings-box? Anyone else?

@Simrayz
Copy link
Copy Markdown
Contributor Author

Simrayz commented Sep 25, 2025

Works, but slightly out of scope: might it be better to always have the "export"-icon and remove it from the dashboard settings-box? Anyone else?

Yeah, I kinda agree. It makes sense as a separate action, and would be consistent between owned and shared dashboards. Export is not really a "setting" anyways.

@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/3558-export-and-import-of-shared-dashboards branch from 51b48a4 to af45959 Compare September 26, 2025 10:12
@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/3558-export-and-import-of-shared-dashboards branch from af45959 to a56d931 Compare September 26, 2025 10:26
@Simrayz
Copy link
Copy Markdown
Contributor Author

Simrayz commented Sep 26, 2025

Added a follow-up task (#3564) to add consistency to the export function

@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/3558-export-and-import-of-shared-dashboards branch from a56d931 to c2ad147 Compare September 29, 2025 09:09
<i class="fa fa-download" title="Export dashboard"></i>
</a>
<div id="export-action-tooltip" role="tooltip">
Download this dashboards definition into a file that can later be imported by pressing the + next to the tab list
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Download this dashboards definition into a file that can later be imported by pressing the + next to the tab list
Download this dashboard's definition into a file that can later be imported by pressing the + next to the tab list

@Simrayz Simrayz force-pushed the feat/3558-export-and-import-of-shared-dashboards branch from c2ad147 to 3271252 Compare October 2, 2025 13:33
@Simrayz Simrayz merged commit 771f0a7 into feat/support-loading-shared-dashboards Oct 2, 2025
13 of 14 checks passed
@Simrayz Simrayz deleted the feat/3558-export-and-import-of-shared-dashboards branch October 2, 2025 13:34
@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 exporting and importing shared dashboards

4 participants