Skip to content

[Links] Panel Placement#165919

Merged
ThomThomson merged 13 commits intoelastic:navigation-embeddablefrom
ThomThomson:navigation/PanelPlacement
Sep 11, 2023
Merged

[Links] Panel Placement#165919
ThomThomson merged 13 commits intoelastic:navigation-embeddablefrom
ThomThomson:navigation/PanelPlacement

Conversation

@ThomThomson
Copy link
Contributor

@ThomThomson ThomThomson commented Sep 6, 2023

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.

TopByDefault

This behaviour should work the same in the following situations:

  • Adding a new Links panel by value
  • Adding a new Links panel by Reference
  • Adding an existing Links panel from the Library

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) + 4

Checklist

Delete any items that are not applicable to this PR.

@ThomThomson ThomThomson changed the title Navigation/panel placement [Links] Panel Placement Sep 7, 2023
breakpoints={breakpoints}
onDragStop={onLayoutChange}
onResizeStop={onLayoutChange}
onLayoutChange={onLayoutChange}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change fixes #165909. I fixed that in this PR because the problem is much more obvious here.

Copy link
Contributor

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +63 to +68
latestVersion?: string | undefined;
telemetry?:
| ((state: EmbeddableStateWithType, stats: Record<string, any>) => Record<string, any>)
| undefined;
migrations?: MigrateFunctionsObject | GetMigrationFunctionObjectFn | undefined;
grouping?: UiActionsPresentableGrouping<unknown> | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

}

const isHorizontal = attributes.layout === 'horizontal';
const width = isHorizontal ? DASHBOARD_GRID_COLUMN_COUNT : 8;
Copy link
Contributor

Choose a reason for hiding this comment

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

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)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🥳

@ThomThomson ThomThomson marked this pull request as ready for review September 11, 2023 20:47
@ThomThomson ThomThomson requested review from a team as code owners September 11, 2023 20:47
@ThomThomson ThomThomson merged commit a2a2cf2 into elastic:navigation-embeddable Sep 11, 2023
@kibana-ci
Copy link

kibana-ci commented Sep 11, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #6 / checking migration metadata changes on all registered SO types detecting migration related changes in registered types
  • [job] [logs] FTR Configs #9 / Controls Range Slider Control create and edit edits title and size of an existing control and retains existing range selection
  • [job] [logs] FTR Configs #9 / Controls Range Slider Control create and edit edits title and size of an existing control and retains existing range selection
  • [job] [logs] FTR Configs #52 / dashboard app - group 1 Changing field formatter to Url applied on dashboard
  • [job] [logs] FTR Configs #52 / dashboard app - group 1 Changing field formatter to Url applied on dashboard
  • [job] [logs] FTR Configs #24 / dashboard app - group 5 embed mode non-default URL params renders as expected when scrolling
  • [job] [logs] FTR Configs #24 / dashboard app - group 5 embed mode non-default URL params renders as expected when scrolling
  • [job] [logs] FTR Configs #13 / 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 #13 / 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] Serverless Search Tests / serverless search UI Importing an existing dashboard does not show the unsaved changes badge in edit mode
  • [job] [logs] Jest Integration Tests #5 / SO type registrations does not remove types from registrations without updating excludeOnUpgradeQuery

Metrics [docs]

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

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants