[Links] Panel Placement#165919
Conversation
…vigation/PanelPlacement
| breakpoints={breakpoints} | ||
| onDragStop={onLayoutChange} | ||
| onResizeStop={onLayoutChange} | ||
| onLayoutChange={onLayoutChange} |
There was a problem hiding this comment.
This change fixes #165909. I fixed that in this PR because the problem is much more obvious here.
…-ref HEAD~1..HEAD --fix'
nickpeihl
left a comment
There was a problem hiding this comment.
lgtm! I love the implementation of the panel strategies. code review and tested in several different resolutions.
I would love to see panel strategies used by the CopyPanelAction, but I spoke offline with @ThomThomson about this and that should be accomplished in a different PR.
| latestVersion?: string | undefined; | ||
| telemetry?: | ||
| | ((state: EmbeddableStateWithType, stats: Record<string, any>) => Record<string, any>) | ||
| | undefined; | ||
| migrations?: MigrateFunctionsObject | GetMigrationFunctionObjectFn | undefined; | ||
| grouping?: UiActionsPresentableGrouping<unknown> | undefined; |
| } | ||
|
|
||
| const isHorizontal = attributes.layout === 'horizontal'; | ||
| const width = isHorizontal ? DASHBOARD_GRID_COLUMN_COUNT : 8; |
There was a problem hiding this comment.
I tested this at different resolutions (3840x2160, 1920x1080, 1280x720) and 8 seems like a good default width. I can't imagine authors using smaller resolutions. And authors can always resize to support the preferred resolution of viewers. 👍
| try { | ||
| explicitInput = await embeddableFactory.getExplicitInput(undefined, dashboard); | ||
| const explicitInputReturn = await embeddableFactory.getExplicitInput(undefined, dashboard); | ||
| if (isExplicitInputWithAttributes(explicitInputReturn)) { |
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Closes #165909
Closes #165400
Closes #165403
This PR adds the ability for Links Panels (and Dashboard panels more broadly) to choose their own size and placement strategy on creation. This PR also fills out the required method on the Navigation Embeddable Factory to place its panels at the top of the Dashboard, and to place them at an appropriate default sizing for their contents.
This behaviour should work the same in the following situations:
Currently, the Horizontal Links panel is by default full width and 4 rows tall and the vertical Links panel is 8 columns wide and the height in rows is calculated as
(number of links * 3) + 4Checklist
Delete any items that are not applicable to this PR.