Skip to content

fix(dashboards): Populate linked dashboard in widget builder edit modal#111085

Merged
DominikB2014 merged 3 commits intomasterfrom
dominikbuszowiecki/browse-450-linked-dashboards-modal-doesnt-populate-with-pre-existing
Mar 19, 2026
Merged

fix(dashboards): Populate linked dashboard in widget builder edit modal#111085
DominikB2014 merged 3 commits intomasterfrom
dominikbuszowiecki/browse-450-linked-dashboards-modal-doesnt-populate-with-pre-existing

Conversation

@DominikB2014
Copy link
Copy Markdown
Contributor

Fix the "Link to Dashboard" modal not populating with the pre-existing linked dashboard when editing a widget.

Three issues were addressed:

  1. Linked dashboard not found in list: The fetchDashboards endpoint returns a paginated/sorted list that may not include the currently linked dashboard. Now fetches the linked dashboard separately (in parallel) and merges it into the list if missing.

  2. Linked dashboards lost on edit: convertWidgetToQueryParams didn't carry linkedDashboards from the widget query to the builder state, so opening the widget builder for editing always started with empty links. Added serialization of linkedDashboards in the conversion and handling in the SET_STATE action.

  3. Duplicate linked dashboard entries: Re-saving an unchanged link appended a duplicate entry because onLink always spread the existing array and added a new item. Now filters out the existing entry for the same field before adding.

Fixes BROWSE-450

Fetch the linked dashboard separately when opening the link modal, since
the dashboard list endpoint may not include it. Also carry linkedDashboards
through the widget-to-builder-state conversion so editing a widget
preserves existing links. Fix duplicate linked dashboard entries when
re-saving an unchanged link by replacing instead of appending.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 19, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 19, 2026
@DominikB2014 DominikB2014 marked this pull request as ready for review March 19, 2026 15:01
@DominikB2014 DominikB2014 requested a review from a team as a code owner March 19, 2026 15:01
The spread of remaining state params passed unserialized
LinkedDashboard[] where string[] was expected, causing a type error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
If the linked dashboard has been deleted or is inaccessible,
fetchDashboard rejects and breaks the Promise.all, preventing the
dashboard list from loading. Catch the rejection so the modal
remains functional.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

DominikB2014 added a commit that referenced this pull request Mar 19, 2026
…111085

Remove linkedDashboards query param, SET_DATASET handler, and
serializeLinkedDashboards export that duplicate changes in PR #111085.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
Copy link
Copy Markdown
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

The data fetching story is getting messy, but this makes sense!

@DominikB2014 DominikB2014 merged commit 3da4799 into master Mar 19, 2026
64 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-450-linked-dashboards-modal-doesnt-populate-with-pre-existing branch March 19, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants