-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Setting up Presentation Util; Create Service Abstraction API #88112
Setting up Presentation Util; Create Service Abstraction API #88112
Conversation
Pinging @elastic/kibana-presentation (Team:Presentation) |
@elasticmachine merge upstream |
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.
Ops change looks good.
Looks like this is breaking in Kibana if you go to Lens and try to save in a way that will bring up the The error is that |
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 a few thoughts, and the issue with the plugins not being started needs to be resolved, but the code as a whole looks good. This is going to be great to build on going forward.
src/plugins/presentation_util/public/components/dashboard_picker.tsx
Outdated
Show resolved
Hide resolved
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.
I love the concept, I'm just not sure if these interfaces/classes belong in the platform, or if we should consider this a recommended "best practice", and leave it up to each plugin author to build the service how they need.
src/plugins/presentation_util/public/services/create/factory.ts
Outdated
Show resolved
Hide resolved
c57d5a2
to
9f6444e
Compare
5507b7c
to
6b2c96c
Compare
47bf073
to
8ca4297
Compare
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.
Found a bug with the refactor of the modal but otherwise I'm fine with the setup
src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx
Show resolved
Hide resolved
src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard_selector.tsx
Show resolved
Hide resolved
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.
Looks good to me -- there's one fix you'll want to make in maps (I should've caught that... sorry..) but I'm approving to unblock 👍
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.
Looks good to me 👍
Love seeing more mdx docs!! I'll add the Team:Docs label so this gets included in the docs challenge. One thing though - can you nest this under the |
Pinging @elastic/kibana-docs (Team:Docs) |
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.
maps/**
lgtm!
tagOptions={tagOptions} | ||
objectType={'visualization'} | ||
onClose={() => {}} | ||
savedObjectsClient={savedObjectsClient} |
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.
It seems that now savedObjectsClient it is not used for getTopNavConfig
so no need to exist and it can be removed from the props here:
export const getTopNavConfig = (
{
hasUnsavedChanges,
setHasUnsavedChanges,
openInspector,
originatingApp,
setOriginatingApp,
hasUnappliedChanges,
visInstance,
stateContainer,
savedObjectsClient,
visualizationIdFromUrl,
stateTransfer,
embeddableId,
}
It should be cleared from the visualize_top_nav.tsx
too
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.
Lens changes LGTM
💔 Build Failed
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
This PR completes a number of items:
Canvas has a bespoke method of providing simplified services to the plugin, (rather than consume
useKibana
or similar, which are notoriously difficult to track/mock). This PR extracts and improves upon that approach to be used in Dashboard, Canvas and elsewhere, (PR next). The net benefit is that plugins consuming Presentation Utility components don't need to provide full implementations of Kibana services, (particularly if they weren't present to begin with). In other words, there's no need to addsavedObjects
to thekibana.json
for your plugin just to consumepresentationUtil
.While working on the new service architecture, I added and refactored to provide Storybook to the Presentation Utility plugin.
I also took the opportunity to write docs using the new docs system, (a PR to add the items to the docs is forthcoming).