-
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
[Presentation Util] Shared toolbar component #94139
Conversation
ce80f02
to
51ae1ae
Compare
45c848b
to
847f278
Compare
c0c85a7
to
c80a919
Compare
4e8fd95
to
dc91fa6
Compare
Fixed ts errors Fixed tsconfig Fixed quick button background color Suggestions for more generic component; named slots projection Refactor toolbar in dashboard Fixed i18n ids Added button size to QuickButtonGroup Fixed add panel test subject Exported all sub components from solution toolbar Fixed library button data test subject Fixed style lint errors Spread remaining props on add from library button component Fixed prop type Added functional tests for dashboard quick buttons Use page object instead of test subject Fixed functional tests Renamed files Fixed toolbar components
dc91fa6
to
68613cf
Compare
Pinging @elastic/kibana-presentation (Team:Presentation) |
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.
operations - limits.yml LGTM
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.
The code looks super modular and well done!
Also tested in Chrome, and the shortcut buttons work really well and everything mostly seems to be working as expected.
One thing I did notice is that the unsaved changes badge appears if you navigate to an editor, then return to the dashboard with the back button or the cancel button. There shouldn't any unsaved changes in this state.
I'm not sure if this is in Master or not - but I checked and it works correctly in 7.12.
Edit turns out that I can reproduce this issue on master as well. I will investigate!
Edit 2 It turns out that this only happens when you have a map panel on a dashboard, I have created an issue
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 great! One small question but otherwise looks good
|
||
// required for dynamic import using React.lazy() | ||
// eslint-disable-next-line import/no-default-export | ||
export default PrimaryActionPopover; |
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.
A lot of these have the export default but are we using the React.lazy for these components? Do we still want to export them like this?
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.
Ah right, that's leftover from when I was trying to lazy load the components, but then Clint helped me realize that we probably shouldn't lazy load the toolbar. I'll remove the default export from all the solution toolbar components.
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 small SCSS comment below, but looks good otherwise. Approving so I don't hold you up.
@@ -0,0 +1,8 @@ | |||
.quickButtonGroup { | |||
.euiButtonGroup__buttons { |
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 it be possible to create/use a different class to avoid using EUI classes? Thanks!
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.
Actually, on second look, it appears that the related border-radius
style might not even be necessary, as EUI is already giving it this styling. If I'm not mistaken, I think this selector and style can be removed altogether.
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
@@ -84,6 +85,19 @@ class NewVisModal extends React.Component<TypeSelectionProps, TypeSelectionState | |||
return null; | |||
} | |||
|
|||
if (this.props.newVisType) { |
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 am so sorry but I dont get what we want to do. What kind of information has the newVisType prop. And why do we return null if it has a value? If we don't want to display the wizard, why do we use this component? 🤔
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.
So it turns out I didn't actually need to go through the new vis modal to add these visualizations, and instead use the embeddable state transfer service. I removed all the changes to the new vis modal.
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.
LGTM, thank you @cqliu1 for addressing all my feedback!
@@ -63,6 +63,7 @@ export interface VisualizeInput extends EmbeddableInput { | |||
query?: Query; | |||
filters?: Filter[]; | |||
timeRange?: TimeRange; | |||
newVisType?: string; |
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.
You can also remove this, right?
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.
Yep! Sorry I missed this line.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Related to #85666.
This moves the solution toolbar from the
dashboard
plugin into thepresentation_util
plugin and adds quick buttons to the toolbar in Dashboard.Significant changes:
panelToolbar
intopresentationUtil
plugin and renamed tosolutionToolbar
Markdown
andInput controls
were added to Dashboard toolbarpresentationUtil
plugin bundle size limit was increased because we added new toolbar components. The toolbar should be one of the first visible parts of the UI in Dashboard, so it shouldn't be lazy loaded.Checklist
Delete any items that are not applicable to this PR.
For maintainers