-
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
[Dashboard] [Controls] Add excludes
toggle to options list
#142780
[Dashboard] [Controls] Add excludes
toggle to options list
#142780
Conversation
6ad1ae6
to
1eb48a0
Compare
205ca04
to
3d442d7
Compare
c25a1a7
to
982b734
Compare
src/plugins/controls/public/options_list/components/options_list_editor_options.tsx
Show resolved
Hide resolved
src/plugins/controls/public/options_list/components/options_list_editor_options.tsx
Outdated
Show resolved
Hide resolved
faabab5
to
aeb6d28
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.
Amazing work! Looked through the code and left a few nits. Also ran it locally and tested out the new functionality. Everything is working great!
Really nice test coverage, both some unit tests and functional tests!
LGTM
export const ControlPanelDiffSystems: { | ||
[key in ControlGroupDiffSystem]: DiffSystem; | ||
} = { |
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.
Nice usage of function registry type architecture! It's temporary, but it's set up like a microcosm of the actual embeddable diffing system, so it'll be super easy to migrate over, even if we end up needing diffing systems for multiple control types in the meantime.
Note to self: I was thinking about when to move this into the embeddable, and I think it makes the most sense to do so when we tackle Control Group as a Panel
, so let's keep that in mind when we write up that issue.
src/plugins/controls/common/control_group/control_group_panel_diff_system.ts
Show resolved
Hide resolved
src/plugins/controls/common/control_group/control_group_panel_diff_system.ts
Outdated
Show resolved
Hide resolved
src/plugins/controls/common/control_group/control_group_panel_diff_system.ts
Outdated
Show resolved
Hide resolved
src/plugins/controls/public/options_list/components/options_list_control.tsx
Show resolved
Hide resolved
src/plugins/controls/public/options_list/embeddable/options_list_embeddable.tsx
Outdated
Show resolved
Hide resolved
@Heenawter @ThomThomson I have a UX question. What do you think about showing the red "NOT" in the input if the user has clicked "Exclude" but hasn't selected any values yet? On the pro side I think it could be beneficial in helping users discover the feature. On the (-) side, if they close the popover without making any selections, having a "NOT" in the input would be weird/confusing. |
@andreadelrio Yeah, not sure about this... I agree it would be nice for discoverability, but having I think we could change the wording to make this more clear, but I'm stumped on what that would look like 😆 |
Oh, I hadn't even thought about Any, that just makes everything more complex. After thinking about this some I think it's better to keep the behavior as is. |
971f7d9
to
9367369
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @Heenawter |
## Summary Adds the docs for the following: - #141824 Doc preview: https://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/get-started.html - #142780 Doc preview: https://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html - #143762 Doc preview: https://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
## Summary Adds the docs for the following: - elastic#141824 Doc preview: https://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/get-started.html - elastic#142780 Doc preview: https://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html - elastic#143762 Doc preview: https://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> (cherry picked from commit 9a26af6)
# Backport This will backport the following commits from `main` to `8.6`: - [[DOCS] Adds the 8.6 Presentation docs (#145474)](#145474) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kaarina Tungseth","email":"kaarina.tungseth@elastic.co"},"sourceCommit":{"committedDate":"2022-11-28T16:20:38Z","message":"[DOCS] Adds the 8.6 Presentation docs (#145474)\n\n## Summary\r\n\r\nAdds the docs for the following:\r\n\r\n- #141824\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/get-started.html\r\n\r\n- #142780\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html\r\n\r\n- #143762\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html\r\n\r\nCo-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>","sha":"9a26af6facafa9519ac624901805a1a65c8abb09","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","Team:Presentation","release_note:skip","v8.6.0","v8.7.0"],"number":145474,"url":"https://github.com/elastic/kibana/pull/145474","mergeCommit":{"message":"[DOCS] Adds the 8.6 Presentation docs (#145474)\n\n## Summary\r\n\r\nAdds the docs for the following:\r\n\r\n- #141824\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/get-started.html\r\n\r\n- #142780\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html\r\n\r\n- #143762\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html\r\n\r\nCo-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>","sha":"9a26af6facafa9519ac624901805a1a65c8abb09"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145474","number":145474,"mergeCommit":{"message":"[DOCS] Adds the 8.6 Presentation docs (#145474)\n\n## Summary\r\n\r\nAdds the docs for the following:\r\n\r\n- #141824\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/get-started.html\r\n\r\n- #142780\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html\r\n\r\n- #143762\r\nDoc preview:\r\nhttps://kibana_145474.docs-preview.app.elstc.co/guide/en/kibana/master/add-controls.html\r\n\r\nCo-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>","sha":"9a26af6facafa9519ac624901805a1a65c8abb09"}}]}] BACKPORT--> Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
Closes #140699
Closes #143671
Closes #136547
Closes #134369
Summary
This PR adds an
include/exclude
toggle to the popover of the options list so that users can exclude their selections rather than only allowing them to exclusively include their selections.Screen.Recording.2022-10-19.at.9.43.32.AM.mov
As part of this, this PR introduces a custom diffing system for options list panels, which were previously only compared using
deepEqual
. This comparison was insufficient because:undefined
was treated differently than selected options being an empty array, which caused [Dashboard] [Controls] Selecting option in view mode causes unsaved changes bug in edit mode #143671exclude
to the options list explicit input, which starts undefined - so, I had to make it so thatundefined
was treated the same asexclude
beingfalse
This PR also introduces a setting so that authors can disable this new option on a per-control basis - so, if they decide that they don't want their users to be able to exclude the control, or if it doesn't make sense that a specific field can be excluded, then they have the option to hide it.
Furthermore, this PR tidies up some low-hanging fruit with respect to the options list control, such as changing the copy and adding a tooltip for the "Ignore timeout" setting, cleaning up the mobile view, etc. These are each described further in the comments below.
Notes about Design Changes
The design of the options list popover was modified from the initial Figma designs in the following ways:
Because we still want to show the field's title rather than replacing it with
NOT
, I opted to simply prependNOT
to the selected options instead:Since the bottom right corner is normally reserved for "Apply" or "Confirm" buttons, @alexmarhaba had concerns about the location of the
Clear selections
button in the Figma designs. Therefore, I opted to leave theClear selections
button in the same location that it was previously - note, however, that there are plans to move this to a floating action once [Controls] Use Trigger / Actions Framework for Hover #143585 is resolved.Flaky Test Runner
Checklist
For maintainers