-
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 "Exists" functionality to options list #143762
[Dashboard] [Controls] Add "Exists" functionality to options list #143762
Conversation
3814148
to
cd9c222
Compare
6c39445
to
a323772
Compare
Pinging @elastic/kibana-presentation (Team:Presentation) |
{existsSelected | ||
? OptionsListStrings.control.getExcludeExists() | ||
: OptionsListStrings.control.getNegate()} | ||
</span>{' '} |
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.
Tried to add this space using CSS :after
, but then this messes with the screen reader because the title of the button becomes "DOES NOTExist"
- so, need to add the space explicitly here instead.
409adbf
to
5927369
Compare
3eb07d4
to
b1bbfc8
Compare
c8ca893
to
20a1dd2
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.
Design LGTM, great job! Exciting to see controls getting closer to filter pills.
a0b14fd
to
8f255b4
Compare
8f255b4
to
0318b0a
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.
Tested this locally and all of the test cases I could think of worked properly, including any weird settings on the chain, and turning on and off the exists capabilities in various selection states. ✅
Code wise, the new organization of the Options List Popover into 3 components looks great! It's much more organized, and is a good foundation for adding even more features & complexity to the Options List. ✅
Also great looking unit test and functional test coverage! ✅
src/plugins/controls/public/options_list/components/options_list_control.test.tsx
Show resolved
Hide resolved
test/functional/apps/dashboard_elements/controls/control_group_chaining.ts
Show resolved
Hide resolved
src/plugins/controls/public/services/options_list/options_list_service.ts
Outdated
Show resolved
Hide resolved
'common', | ||
'header', | ||
]); | ||
|
||
const DASHBOARD_NAME = 'Test Options List Control'; | ||
|
||
describe('Dashboard options list integration', () => { | ||
const newDocuments: Array<{ index: string; id: string }> = []; | ||
|
||
const addDocument = async (index: string, document: 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.
It's too bad there isn't a helper for this function. Do other functional tests that you've seen use the console to add docs?
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 actually wasn't able to find any tests that add new documents except those that are literally testing the console 😅 So I just came up with my own way of doing it
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.
There's a first time for everything I guess! If we find ourselves having to do this more and more, we should create our own helper then maybe.
@@ -429,7 +496,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { | |||
}); | |||
|
|||
it('Does not mark selections invalid with Query', async () => { | |||
await queryBar.setQuery('isDog : false '); | |||
await queryBar.setQuery('NOT animal.keyword : "dog" '); |
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.
Agreed, no reason to also test scripted fields here as well.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
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 #140700
Closes #139932
@elastic/kibana-docs Refer to #143762 (comment)
@elastic/kibana-design Refer to discussion starting at #143762 (comment)
Summary
This PR adds the ability for the options list control to be used as an
exists
filter for a given field.Screen.Recording.2022-10-25.at.2.58.41.PM.mov
The
exists
option list entry will show up at all times, even during search, unless one of the following conditions is met:exists
option is not selected and"Show only selected"
is selected in the dropdown"Allow exists query"
toggle is set tofalse
in the create/edit control flyoutScreen.Recording.2022-10-26.at.9.49.09.AM.mov
As part of this, I performed a refactor of the
OptionsListPopover
component because, with the addition of both theexclude
andexists
functionality, the logic was starting to get extremely difficult to follow. This included making it so that the search bar auto focuses when the popover is open.How to Test
Testing general
exists
/does not exist
queries:always exists
) and two, which has a value 57 times (sometimes exists
). Verify that, when creating a control for these fields, you get the expected results for theexists
anddoes not exist
queries.Flaky Test Runner
control_group_chaining.ts
options_list.ts
Checklist
Delete any items that are not applicable to this PR.
For maintainers