-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Controls Anywhere] Convert time slider to embeddable #238998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Controls Anywhere] Convert time slider to embeddable #238998
Conversation
FYI - time slider controls have never had the ability to edit the width and grow settings. So you should be able to add the time slider controls with size |
3e57a9b to
b9aa66b
Compare
b9aa66b to
9fa97ca
Compare
|
@Heenawter I had to hard code the values in the layout manager for now, added a TODO comment so we know to remove when we implement real |
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
src/platform/plugins/shared/controls/public/actions/create_time_slider_action.tsx
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/dashboard/public/dashboard_api/layout_manager/layout_manager.ts
Outdated
Show resolved
Hide resolved
…qary/kibana into 233037-timeslider-embeddable # Conflicts: # src/platform/plugins/shared/dashboard/public/dashboard_api/layout_manager/layout_manager.ts
...platform/packages/shared/presentation/presentation_containers/interfaces/panel_management.ts
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/controls/public/actions/create_time_slider_action.tsx
Outdated
Show resolved
Hide resolved
...lugins/shared/controls/public/controls/timeslider_control/get_timeslider_control_factory.tsx
Outdated
Show resolved
Hide resolved
...lugins/shared/controls/public/controls/timeslider_control/get_timeslider_control_factory.tsx
Outdated
Show resolved
Hide resolved
...lugins/shared/controls/public/controls/timeslider_control/get_timeslider_control_factory.tsx
Show resolved
Hide resolved
…qary/kibana into 233037-timeslider-embeddable
src/platform/plugins/shared/controls/public/actions/create_time_slider_action.tsx
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/controls/public/actions/create_time_slider_action.tsx
Outdated
Show resolved
Hide resolved
...ns/shared/dashboard/server/content_management/v1/transforms/in/transform_control_group_in.ts
Show resolved
Hide resolved
...lugins/shared/controls/public/controls/timeslider_control/get_timeslider_control_factory.tsx
Show resolved
Hide resolved
src/platform/plugins/shared/dashboard/public/dashboard_api/layout_manager/layout_manager.ts
Show resolved
Hide resolved
src/platform/plugins/shared/dashboard/public/dashboard_api/layout_manager/layout_manager.ts
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/dashboard/public/dashboard_api/layout_manager/layout_manager.ts
Show resolved
Hide resolved
src/platform/plugins/shared/dashboard/public/dashboard_api/layout_manager/layout_manager.ts
Show resolved
Hide resolved
This reverts commit 54c9f4a.
…qary/kibana into 233037-timeslider-embeddable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are getting so close!! Found some more regressions that should be addressed before we merge this, unfortunately 🙇 We also still need to figure out the bundle size increase.
"page load bundle size" for "triggersActionsUi" is 1.2KB over the configured limit of 107.4KB
src/platform/plugins/shared/controls/public/actions/create_time_slider_action.tsx
Outdated
Show resolved
Hide resolved
...m/plugins/shared/controls/public/controls/timeslider_control/init_time_range_subscription.ts
Outdated
Show resolved
Hide resolved
...lugins/shared/controls/public/controls/timeslider_control/get_timeslider_control_factory.tsx
Show resolved
Hide resolved
...lugins/shared/controls/public/controls/timeslider_control/get_timeslider_control_factory.tsx
Show resolved
Hide resolved
|
@Heenawter 1.2kb increase in export interface AppliesTimeslice {
appliedTimeslice$: PublishingSubject<[number, number] | undefined>;
}
export const apiAppliesTimeslice = (unknownApi: unknown): unknownApi is AppliesTimeslice => {
return Boolean(unknownApi && (unknownApi as AppliesTimeslice)?.appliedTimeslice$ !== undefined);
};Unfortunately we need to have this interface in a kbn package because both the I can fix this by having the one thing in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one final nit but otherwise I think everything looks good 🎉 Thanks so much for your work on this one!
...lugins/shared/controls/public/controls/timeslider_control/get_timeslider_control_factory.tsx
Outdated
Show resolved
Hide resolved
…r_control/get_timeslider_control_factory.tsx Co-authored-by: Hannah Mudge <[email protected]>
💔 Build Failed
Failed CI StepsHistory
|
Summary
Warning
This work is being merged into a feature branch, not main!
Because of this, we only need a review from @elastic/kibana-presentation for now.
Type failures are expected because the feature branch is currently in an incomplete state, where the controls that have not yet been converted are dependent on things that no longer exist.
Closes #233037
Time slider as embeddable
Converts the time slider to an embeddable, allows it to be added as a panel that immediately pins itself and cannot be unpinned.

Known issues
The control does not highlight itself when added, tracked in #238981.
Conditionally enabled add panel action
This PR adds support for
couldBecomeCompatibleto the Add Panel menu. Actions that failisCompatiblebut passcouldBecomeCompatiblewill be displayed as disabled menu items.The time slider action is the only thing with an Add Panel trigger that implements


couldBecomeCompatible, so this doesn't affect any existing actions.Refactoring add panel menu to subscribe to compatibility changes
I did a rewrite of the way the Add Panel flyout renders the group menu. Before I did this, the Time Slider action would be disabled when you opened the menu, and then stay disabled if you deleted your existing Time Slider before closing the menu. This is because
getMenuItemGroupswas only fetching action compatibility once, and wasn't set up to re-render the menu if compatibility changed. The refactor I did enables this behavior to go smoothly:enabledisable.mov
It's an edge case for sure, but if we add any new actions to the panel menu that take advantage of compatibility updates, we want them to work as expected.