Skip to content

[Time to Visualize] Copy Panel to Dashboard#90856

Merged
ThomThomson merged 13 commits intoelastic:masterfrom
ThomThomson:feature/copyToDashboardAction
Feb 11, 2021
Merged

[Time to Visualize] Copy Panel to Dashboard#90856
ThomThomson merged 13 commits intoelastic:masterfrom
ThomThomson:feature/copyToDashboardAction

Conversation

@ThomThomson
Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson commented Feb 9, 2021

Summary

Closes #69423

Adds the ability to copy a panel from one dashboard to another. On submit the application redirects to the destination dashboard in edit mode, and adds the new panel to the bottom. This change will not be saved to the dashboard until the user chooses to save it.

The panel is always appended, even when a panel with the same id exists already.

Note: This does not include the ability to automatically make the panel 'by value', this can be added in a followup if necessary. For now, By Value panels remain by value, and by reference panels remain by reference.

Edit: The copy has been enhanced to the following:

Screen Shot 2021-02-10 at 7 10 57 PM

Feb-09-2021 16-46-59

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@ThomThomson ThomThomson added Feature:Dashboard Dashboard related features Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v8.0.0 Project:TimeToVisualize v7.12.0 release_note:feature Makes this part of the condensed release notes labels Feb 9, 2021
@ThomThomson ThomThomson force-pushed the feature/copyToDashboardAction branch from 8462b13 to 178f426 Compare February 10, 2021 19:11
@ThomThomson ThomThomson force-pushed the feature/copyToDashboardAction branch from 178f426 to a617c8d Compare February 10, 2021 20:46
@ThomThomson ThomThomson marked this pull request as ready for review February 11, 2021 03:28
@ThomThomson ThomThomson requested review from a team as code owners February 11, 2021 03:28
@elasticmachine
Copy link
Copy Markdown
Contributor

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

}

.dshCopyToParagraph {
max-width: 400px;
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.

I still need to run this locally, but I've led you astray here. There is a maxWidth prop on EuiModal that can be used for this case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, it turns out this setting was actually missing from the core service I was using to show the modal. I've added the option and it works correctly

@ThomThomson ThomThomson requested a review from a team as a code owner February 11, 2021 15:52
@ThomThomson ThomThomson force-pushed the feature/copyToDashboardAction branch from b74961d to 5de7f4f Compare February 11, 2021 15:54
Copy link
Copy Markdown
Contributor

@poffdeluxe poffdeluxe left a comment

Choose a reason for hiding this comment

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

Lgtm! Code looks good and works as expected

data-test-subj="add-to-new-dashboard-option"
id="new-dashboard-option"
name="dashboard-option"
disabled={!dashboardId}
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.

This is disabled because you cannot copy from an unsaved dashboard. Am I reading that right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Close! You can't copy from an unsaved dashboard, to another unsaved dashboard. This is because the URLs are the same, it would just append a copy of the panel.

@ryankeairns ryankeairns self-requested a review February 11, 2021 20:55
Copy link
Copy Markdown
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Thanks for the edits, nice addition!

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 203 206 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dashboard 177.6KB 177.6KB -24.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dashboard 299.0KB 308.2KB +9.2KB
presentationUtil 25.6KB 25.7KB +162.0B
total +9.4KB

History

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

@ThomThomson ThomThomson merged commit 6e8622f into elastic:master Feb 11, 2021
ThomThomson added a commit to ThomThomson/kibana that referenced this pull request Feb 11, 2021
ThomThomson added a commit that referenced this pull request Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Dashboard Dashboard related features Project:TimeToVisualize release_note:feature Makes this part of the condensed release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v7.12.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Time to visualize] Copy panel from one dashboard to another dashboard

6 participants