-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Share Modal #179037
Share Modal #179037
Conversation
Pinging @elastic/appex-sharedux (Team:SharedUX) |
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 👍 ran it locally with the share.new_version.enabled: true
flag. It is hidden behind that flag, so we are good to merge to main
as the old sharing menu is still the default.
Some small nits:
Not sure why we want the state management to be built into the tabbing modal.
Not necessary to address now, but for the future, in the Storybook stories would nice to have at least on story which has more than one tab, as the main feature this modal provides is tabbing.
Another nit, not to be addressed now, would be nice to break this up into a couple (or so) PRs. For example, the <TabbedModal>
could be its own PR.
|
||
| Export | Description | | ||
|---|---| | | ||
| `TabbedModal` | component that renders tab content within a modal in kibana. |
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.
nit
| `TabbedModal` | component that renders tab content within a modal in kibana. | |
| `TabbedModal` | component that renders tab content within a modal in Kibana. |
dispatch: Dispatch<IDispatchAction>; | ||
} | ||
|
||
const createStateContext = once(<T extends Array<ITabDeclaration<Record<string, any>>>>() => |
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.
Interesting use of once
to make the context creation lazy.
description?: string; | ||
'data-test-subj'?: string; | ||
content: IModalTabContent<S>; | ||
modalActionBtn: IModalTabActionBtn<S>; |
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.
Would be nice to make this modalActionBtn
optional. I cannot imagine that all tabs will need this.
export interface ITabDeclaration<S = {}> { | ||
id: string; | ||
name: string; | ||
initialState?: Partial<S>; |
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.
Regarding this initialState
, why do we build state management into the modal? What does it solve?
…-link-logic-rework' into rshen-embed-modal-link-logic-rework
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
## Summary This splits out the work created in #179037, so that we might have a smaller PR to be review that is also single purpose. This PR introduces the tabbed modal component, alongside visual API for constructing a modal with tabbed experience within Kibana. It mostly builds off the EUI modal component, with allowance to construct a modal declaratively, and also supports managing state for the modal. See `IModalTabDeclaration` At the moment this component is quite rudimentary and might be evolved, but as of now it has mostly been created to support the work for redesigning the share experience for dashboard, lens and canvas. It can be reviewed by through the shared_ux storybook; `yarn storybook shared_ux`. Examples for it's usage have also been included. ## Visuals <img width="598" alt="Screenshot 2024-03-28 at 12 07 01" src="https://github.com/elastic/kibana/assets/7893459/830752c8-73c9-435a-94cb-e28442b12941"> Co-authored-by: rshen91 <rshen@elastic.co>
Summary
This PR is based off of #176617, which in turn builds off of the generic tabbed modal component created here #176261.
Partially addresses https://github.com/elastic/kibana-team/issues/753
The PR introduces an alternate way of sharing a dashboard by consolidating the existing share options into a single place.
TO TEST
Set
share.new_version.enabled: true
in your kibana.dev.yml in order to see these changes.