-
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
[Lens] Duplicate layers #140603
[Lens] Duplicate layers #140603
Conversation
ee48c11
to
ecf8b99
Compare
@elasticmachine merge upstream |
51e84e9
to
2c25974
Compare
@@ -89,8 +89,6 @@ export type IndexPatternField = FieldSpec & { | |||
runtime?: boolean; | |||
}; | |||
|
|||
export type ErrorCallback = (e: { message: string }) => void; |
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.
not related to that PR, just a removing unused code
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@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.
Very nicely written code and I couldn't find any problems with the solution 👏🏼
I think recursively updating ids is fine and works well.
One nit UX thing is that maybe we should not allow to clone an empty layer? So when it's empty, let's not show the option or disable it. Do you think it'd be easy to add?
It's probably not hard to do, I just don't like that in this case, some layers will have a context menu and some only delete button(if they are empty) + there will be separate logic for annotations. |
# Conflicts: # x-pack/plugins/lens/public/visualizations/xy/visualization.tsx
…-ref HEAD~1..HEAD --fix'
Really nice work. I will be using the layer context menu when I address #8143, so it's nice to see it being added! WDYT about renaming the following files?
|
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.
Thanks for putting this together, @alexwizp. This looks lovely! I'm leaving you a few comments below for your review, but nothing worth holding you up over. Assuming you can address them, I'm approving now.
-
Similar to my code comment below, can we also remove the
index
number that is currently being appended to theDelete layer
andReset layer
actions? -
Can the content menu text for
Delete layer
andReset layer
be changed to red to match the icon? -
Can we change all
Reset layer
text toClear layer
? -
Regarding whether or not we should hide or disable the duplicate action when a layer has no dimensions populated, I think it's fine to leave it as it is currently (i.e. allow users to duplicate empty layers). It essentially just ends up functioning as if the user created a new visualization layer, so I don't see it harming the user experience to allow it.
...s/lens/public/editor_frame_service/editor_frame/config_panel/layer_buttons/layer_buttons.tsx
Outdated
Show resolved
Hide resolved
...s/public/editor_frame_service/editor_frame/config_panel/layer_buttons/clone_layer_button.tsx
Outdated
Show resolved
Hide resolved
…onfig_panel/layer_buttons/clone_layer_button.tsx Co-authored-by: Michael Marcialis <[email protected]>
…onfig_panel/layer_buttons/layer_buttons.tsx Co-authored-by: Michael Marcialis <[email protected]>
Thank you @andrewctate @MichaelMarcialis. Will apply your comments tomorrow morning |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: cc @alexwizp |
Closes: #132140
Describe the feature:
Added the ability to clone
Data
/Annotations
/Reference line
layersWhat was changed:
LayerButtons
component was added. If we have more than 2 actions, then aСontext Menu
appears;remove_layer_button.tsx
was refactored to work fromContext Menu
;renewIDs
) to renew ids';JEST
tests were added.Notes:
For visualizations that do not support working with layers, the design of the button has not changed.
Screens:
Data Layers
Screen.Recording.2022-09-16.at.18.00.37.mov
Screen.Recording.2022-09-16.at.18.02.51.mov
Screen.Recording.2022-09-16.at.18.04.03.mov