Skip to content

[Dashboard navigation] Inject/extract references#164330

Merged
nickpeihl merged 7 commits intoelastic:navigation-embeddablefrom
nickpeihl:navEmbeddable-references
Aug 31, 2023
Merged

[Dashboard navigation] Inject/extract references#164330
nickpeihl merged 7 commits intoelastic:navigation-embeddablefrom
nickpeihl:navEmbeddable-references

Conversation

@nickpeihl
Copy link
Contributor

@nickpeihl nickpeihl commented Aug 21, 2023

Fixes #154363

Summary

Extracts and injects references to Dashboards in Link panels to allow sharing / importing to other Spaces.

To test this:

  1. Create an empty dashboard.
  2. Create a Links panel on the dashboard and save to library.
  3. Save the dashboard as one or more new dashboards.
  4. Update the Links panel with links to the new dashboards.
  5. Create two new Spaces, "space1" and "space2" with the default settings.
  6. In Saved Objects, click the Actions button for your Links and choose "Copy to Spaces".
  7. Copy the Links to "space1".
  8. Switch to the "space1" space and verify all the dashboards using that Links panel were included.
  9. In Saved Objects, select the Links saved object and export it including all related objects
  10. Switch to "space2" and import the Links saved object from the file downloaded in the previous step.
  11. Verify all the dashboards were also imported.
  12. Inspect the saved object for the Links. The references array should contain objects for each dashboard.
  13. The attributes.links[].destination property should be a string in the format of links_<someuuid>_dashboard. This string should match one of the references[].id.

@nickpeihl nickpeihl added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// label Aug 21, 2023
@nickpeihl nickpeihl requested a review from a team as a code owner August 21, 2023 15:11
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@Heenawter Heenawter self-requested a review August 22, 2023 15:05
Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Tested by-reference links panel (via the steps outlined in the PR description) + tested by-value links panels by importing/copying a dashboard with a by-value link panel. Everything worked as expected, and relationships stayed intact 🎉

Left a comment WRT not having a refName property - personally, I find it a bit confusing, especially when trying to trace the tests? But ultimately I'm good either way 👍

Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Thanks so much for making the refName separate - it made things so much easier to follow IMO 💃 I left one question WRT the external link supported protocols constant, but otherwise looks great!!

export const NAV_HORIZONTAL_LAYOUT = 'horizontal';
export const NAV_VERTICAL_LAYOUT = 'vertical';

export const EXTERNAL_LINK_SUPPORTED_PROTOCOLS = ['http', 'https'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add mailto to this? We allow mailto for URL drilldowns, and I am using the exact same Regex match for external links so they do as well 🤔

{
type: 'dashboardLink',
id: 'fc7b8c70-2eb9-40b2-936d-457d1721a438',
destinationRefName: 'link_fc7b8c70-2eb9-40b2-936d-457d1721a438_dashboard',
Copy link
Contributor

Choose a reason for hiding this comment

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

This small change makes the tests so much easier to follow - my brain thanks you, hahahah 🤣

And some minor fixes
Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Approving based on most recent mailto changes 🎉

@nickpeihl nickpeihl merged commit 409a8f9 into elastic:navigation-embeddable Aug 31, 2023
@kibana-ci
Copy link

kibana-ci commented Aug 31, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #1 / checking migration metadata changes on all registered SO types detecting migration related changes in registered types
  • [job] [logs] FTR Configs #12 / Controls Range Slider Control create and edit edits title and size of an existing control and retains existing range selection
  • [job] [logs] FTR Configs #12 / Controls Range Slider Control create and edit edits title and size of an existing control and retains existing range selection
  • [job] [logs] Jest Integration Tests #5 / fleet usage telemetry should fetch usage telemetry
  • [job] [logs] FTR Configs #52 / Options list control Dashboard options list creation and editing Options List Control creation and editing experience renames an existing control and retains selection
  • [job] [logs] FTR Configs #52 / Options list control Dashboard options list creation and editing Options List Control creation and editing experience renames an existing control and retains selection
  • [job] [logs] Jest Integration Tests #3 / SO type registrations does not remove types from registrations without updating excludeOnUpgradeQuery
  • [job] [logs] FTR Configs #34 / Synthetics API Tests SyncGlobalParams added an integration for previously added monitor
  • [job] [logs] FTR Configs #34 / Synthetics API Tests SyncGlobalParams added an integration for previously added monitor

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [d51bcd8]

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

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

Labels

Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants