-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Pluggable sharing interface #7320
Comments
I think the biggest challenge we'll have here is providing plugins a way to conditionally show their sharing options based on context. For example, the reporting plugin wouldn't want the "export to pdf" sharing option to appear on routes that it couldn't actually export to a pdf. |
the first things we want to define here are:
Once we define the elements, from there on we could implement some sort of "marked" function that an element must implement to expose it share functionality (maybe something along the lines of |
The short url functionality will be available everywhere, so we shouldn't have to worry about the empty state. One thing to consider here is that we can't draw the sharing boundaries on applications themselves since some sharing options will be defined by plugins but will actually appear on other applications (e.g. pdf reporting). Your idea about plugins declaring "focus" could be helpful here. |
There's a number of things to think of here. First off, we don't want to be blindly grouping things together based on an action. That's to say, we shouldn't shove things into the Share section just because they're moving data from one point to another. Everything could be considered "sharing" in that sense. In terms of API design, I agree with @epixa about starting off with the centralization of what we currently have, and then moving to an API that spans apps, plugins, and Kibana core. I'll need to dig deeper into Kibana architecture for that; I'll try and create a document about the architecture - a drawing if anything - outlining how the different components interact. In terms of "what" can be shared, I presume the API should involve exposing a pure function that, if present, takes parameters like Taking @uboness' idea of using // A `thing` can have sharing options
thing[Symbol.for('kibana.sharing')] = (route) => {
const csv = {
title: 'Download as CSV File',
icon: 'https://imgur.com/....',
render (container, data) => {
// <- attach some HTML into the (empty) container
// <- the generated DOM should have events that handle the actual sharing
// <- an API could be provided to `render` that facilitates common tasks related to manipulating `data`
}
};
return [csv];
}; Things I'm unsure about are:
|
I think the share menu should be somewhat minimal in what it shows... potentially just the action item (e.g. "Export as a Report", "Share Dashboard Link", "Export as CSV", etc...). Next to that (and I know I might get some heat of this, but screw it), I think it's time to consider lightbox style dialogs. When the user clicks on one of the share items, depending on the action, we can potentially open up a lightbox dialog where the user can continue "configuring" the action. For example, When the user clicks "Export as a Report", we can open up a dialog where the user can configure the report (perhaps the format, name, etc...). Same goes for "Share Dashboard Link", we can open up a dialog where we show the link an the user can copy it (similar to how google docs sharing works). The whole "single share button" idea was largely inspired by apple sharing functionality (which works across their OSs). The nice thing about it, is that it's simple. |
It should probably be up to the receiver of the "share event" to decide how to react to it. Maybe we could provide a common lightbox element for the common, simple cases, but some apps will probably want the option of transitioning to a new page. To continue the native app analogy, some apps have simple pop ups when you share to them (think Google Inbox, Instapaper) while some transition to the full app (think Mail app, browser). |
++ |
Untagging design, I think the design aspect of it has already been fleshed out with the new K7 stuff. But having a way to add export plugins is still valid I think. The embeddable API and pluggable panel actions gives a place for export types on a single visualization, but not at the dashboard level. That being said, dashboard should itself be an embeddable, so we could use that implementation layer - only the UI layer doesn't fit well in the context menu if you are on the dashboard app. There is a similar problem with visualizations. The context menu panel actions make sense on the visualize app as well, but where to expose them? Embedding a visualization inside the panel chrome on the visualize app would look bad. So when we are thinking about the Embeddable API (#19875) we may want to think of a way to extend the UI representation of the pluggable panel actions so that it doesn't have to appear in the panel context menu, but the top nav... or something else... |
This has been implemented now via the new Share API and also the Embeddable API. I will close this issue since we have a solid first version, and further discussion how the Embeddable API looks should take place in the above linked issue by Stacey. |
`v89.1.0`⏩`v90.0.0` The majority of changes in this PR come from: - **EuiContextMenu** being converted to Emotion (elastic/eui#7312). If your usage of `EuiContextMenu` was significantly affected, we recommend pulling down this PR and QAing it locally. - `defaultProps` being removed from some very widespread components, particularly **EuiButton**, in anticipation of React's upcoming deprecation. (elastic/eui@b7dc9b4) **NOTE**: This only affected Enzyme snapshots, and did not affect production behavior. [Commits](https://github.com/elastic/kibana/pull/170179/commits) have been broken up by component changes as well as types of changes. --- ## [`90.0.0`](https://github.com/elastic/eui/tree/v90.0.0) - Updated the `eventColor` prop on `EuiCommentEvent` to apply the color to the entire comment header. ([#7288](elastic/eui#7288)) - Updated `EuiBasicTable` and `EuiInMemoryTable` to support a new controlled selection API: `selection.selected` ([#7321](elastic/eui#7321)) **Bug fixes** - Fixed controlled `EuiFieldNumbers` not correctly updating native validity state ([#7291](elastic/eui#7291)) - Fixed `EuiListGroupItem` to pass `style` props to the wrapping `<li>` element alongside `className` and `css`. All other props will be passed to the underlying content. ([#7298](elastic/eui#7298)) - Fixed `EuiListGroupItem`'s non-transitioned transform on hover/focus ([#7298](elastic/eui#7298)) - Fixed `EuiDataGrid`s with `gridStyle.stripes` sometimes showing buggy row striping after being sorted ([#7301](elastic/eui#7301)) - Fixed `EuiDataGrid`'s `gridStyle.rowClasses` API to not conflict with `gridStyle.stripes` if dynamically updated ([#7301](elastic/eui#7301)) - Fixed `EuiDataGrid`'s `gridStyle.rowClasses` API to support multiple space-separated classes ([#7301](elastic/eui#7301)) - Fixed `EuiInputPopover` not calling `onPanelResize` callback prop ([#7305](elastic/eui#7305)) - Fixed `EuiDualRange` incorrectly positioning highlights when rendered with `showInput="inputWithPopover"` ([#7305](elastic/eui#7305)) - Fixed `EuiTabs` incorrectly wrapping text when it should instead either scroll or truncate ([#7309](elastic/eui#7309)) - `EuiContextMenu` now renders text colors correctly when used within an `EuiBottomBar` ([#7312](elastic/eui#7312)) - Fixed the width of `EuiSuperDatePicker`'s Absolute date picker ([#7313](elastic/eui#7313)) - Fixed `EuiDataGrid` cells visually cutting off overflowing content a little too quickly ([#7320](elastic/eui#7320)) **Deprecations** - Deprecated `EuiBasicTable` and `EuiInMemoryTable`'s ref `setSelection` API. Use the new `selection.selected` API instead. ([#7321](elastic/eui#7321)) **Breaking changes** - Removed `EuiPageTemplate_Deprecated`, `EuiPageSideBar_Deprecated`, and `EuiPageContent*_Deprecated` ([#7265](elastic/eui#7265)) - Removed the `ghost` color option from `EuiButton`, `EuiButtonEmpty`, and `EuiButtonIcon`. Use an `<EuiThemeProvider colorMode="dark">` wrapper and `color="text"` instead. ([#7296](elastic/eui#7296)) **Dependency updates** - Updated `refractor` to v3.6.0 ([#7127](elastic/eui#7127)) - Updated `rehype-raw` to v5.1.0 ([#7127](elastic/eui#7127)) - Updated `vfile` to v4.2.1 ([#7127](elastic/eui#7127)) **Accessibility** - `EuiContextMenu` now correctly respects reduced motion preferences ([#7312](elastic/eui#7312)) - `EuiAccordion`s no longer attempt to focus child content when the accordion is externally opened via `forceState`, but will continue to focus expanded content when users click the toggle button. ([#7314](elastic/eui#7314)) **CSS-in-JS conversions** - Converted `EuiContextMenu`, `EuiContextMenuPanel`, and `EuiContextMenuItem` to Emotion; Removed `$euiContextMenuWidth` ([#7312](elastic/eui#7312))
We have an inconsistent experience when it comes to the various methods that you can use to "share" what you're currently looking at in Kibana with other people. The short link and embed functionality are both present under the "share" link in the top bar, but things like creating a PDF of a visualization or exporting a search result as a CSV, both of which are sharing options in their own right, are not being implemented there. All of those options should be available in the same place, and I think the top bar is that best place to anchor that functionality.
First, we'd need to update the "share" UI to support many more sharing options. I sketched out my proposal for that interface.
When you click share, all available sharing options for the current page slide down:
When you click one of the sharing options, the rest disappear (maybe slide off to the right?), the selected option gets anchored to the left side, and that specific option's sharing functionality appears to the right of that:
When the interface itself supports other sharing options, then we can add an integration point to the sharing component so that plugins can add their own sharing options to specific pages within Kibana.
/cc @kimchy @uboness @alt74
The text was updated successfully, but these errors were encountered: