Skip to content
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

[Input Controls] Options List Embeddable, Factory & Frame #106877

Merged
merged 27 commits into from
Aug 10, 2021

Conversation

ThomThomson
Copy link
Contributor

@ThomThomson ThomThomson commented Jul 27, 2021

Summary

This PR is a follow-up to #103512, which is intended to be merged into master.

This re-creates the options list component as an embeddable, with a couple notable improvements over the initial design

  • The embeddable takes an async fetchData method, which is passed in. In storybook this is a stub, and it can be replaced with a real implementation inside of Kibana.
  • Embeddable input works as a public facing API only, where the component manages its own internal state for things like available options, searching, and selection.
  • The storybook implementation and the embeddable are totally separated now, such that no POC code will leak into the implementation.
  • Most design ideas from Design comments for initial OptionsList ThomThomson/kibana#8 have been implemented

For maintainers

@ThomThomson ThomThomson changed the title Controls/control frame [Input Controls] Options List Embeddable, Factory & Frame Jul 27, 2021
@ThomThomson ThomThomson added Feature:Dashboard Dashboard related features Feature:Input Control Input controls visualization release_note:skip Skip the PR/issue when compiling release notes v7.15.0 v8.0.0 Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort labels Jul 27, 2021
@ThomThomson ThomThomson marked this pull request as ready for review July 28, 2021 13:15
@ThomThomson ThomThomson requested review from a team as code owners July 28, 2021 13:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@ThomThomson
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Andrea is out this week. Is it safe to assume we can merge this, from a design perspective, and come back to additional tweaks after this is merged? From what I understood, this was big step along an iterative journey. (i.e. I'm considering just hitting approve for the SCSS changes)

@ThomThomson
Copy link
Contributor Author

@elasticmachine merge upstream

@ThomThomson
Copy link
Contributor Author

@ryankeairns, I was also out last week, but yes I believe now that the design PR has been merged in, this should be safe to merge from a design perspective! I will ask @andreadelrio to review & triple-check that though.

@andreadelrio
Copy link
Contributor

@ryankeairns, I was also out last week, but yes I believe now that the design PR has been merged in, this should be safe to merge from a design perspective! I will ask @andreadelrio to review & triple-check that though.

@ThomThomson This is looking good to me. I have a related PR up on the EUI repo fixing the issue of hiding the count when no selections have been made.

Copy link
Contributor

@poffdeluxe poffdeluxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Few small questions but the storybook demo is very neat! My one other thought is about where this lives. Is its home presentation util plugin permanently or is this where the POC is kinda being worked on and built out?

setAvailableOptions(newAvailableOptions);

if (toggleOff) selectedOptions.current.delete(item.label);
else selectedOptions.current.add(item.label);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the two line if-else here is a little hard to read but that might just be me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, some braces here might help readability!

})}
>
<EuiPopover
id="popoverExampleMultiSelect"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this id correct? I can't find a reference to it in this PR

Copy link
Contributor Author

@ThomThomson ThomThomson Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that's a leftover from copying from the EUI examples - will remove!

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / X-Pack Detection Engine API Integration Tests.x-pack/test/detection_engine_api_integration/security_and_spaces/tests/exception_operators_data_types/text·ts.detection engine api security and spaces enabled Detection exceptions data types and operators Rule exception operators for data type text "is not" operator will return 0 results if it cannot find what it is excluding

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 2 times on tracked branches: https://github.com/elastic/kibana/issues/107911

[00:00:00]       │
[00:00:00]         └-: detection engine api security and spaces enabled
[00:00:00]           └-> "before all" hook in "detection engine api security and spaces enabled"
[00:00:00]           └-: 
[00:00:00]             └-> "before all" hook in ""
[00:00:00]             └-: Detection exceptions data types and operators
[00:00:00]               └-> "before all" hook in "Detection exceptions data types and operators"
[00:00:00]               └-: 
[00:00:00]                 └-> "before all" hook in ""
[00:00:00]                 └-: Rule exception operators for data type text
[00:00:00]                   └-> "before all" hook in "Rule exception operators for data type text"
[00:00:00]                   └-: "is not" operator
[00:00:00]                     └-> "before all" hook for "will return 0 results if it cannot find what it is excluding"
[00:00:00]                     └-> will return 0 results if it cannot find what it is excluding
[00:00:00]                       └-> "before each" hook: global before each for "will return 0 results if it cannot find what it is excluding"
[00:00:00]                       └-> "before each" hook for "will return 0 results if it cannot find what it is excluding"
[00:00:00]                         │ info [o.e.x.i.a.TransportPutLifecycleAction] [node-01] adding index lifecycle policy [.siem-signals-default-migration-cleanup]
[00:00:00]                         │ info [o.e.x.i.a.TransportPutLifecycleAction] [node-01] adding index lifecycle policy [.siem-signals-default]
[00:00:00]                         │ info [o.e.c.m.MetadataIndexTemplateService] [node-01] adding index template [.siem-signals-default] for index patterns [.siem-signals-default-*]
[00:00:00]                         │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [.siem-signals-default-000001] creating index, cause [api], templates [.siem-signals-default], shards [1]/[1]
[00:00:00]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.siem-signals-default-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [.siem-signals-default]
[00:00:00]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.siem-signals-default-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] in policy [.siem-signals-default]
[00:00:00]                         │ info [o.e.x.i.a.TransportPutLifecycleAction] [node-01] adding index lifecycle policy [.lists-default]
[00:00:00]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.siem-signals-default-000001] from [{"phase":"hot","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] to [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}] in policy [.siem-signals-default]
[00:00:00]                         │ info [o.e.x.i.a.TransportPutLifecycleAction] [node-01] adding index lifecycle policy [.items-default]
[00:00:00]                         │ info [o.e.c.m.MetadataIndexTemplateService] [node-01] adding template [.lists-default] for index patterns [.lists-default-*]
[00:00:00]                         │ info [o.e.c.m.MetadataIndexTemplateService] [node-01] adding template [.items-default] for index patterns [.items-default-*]
[00:00:00]                         │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [.lists-default-000001] creating index, cause [api], templates [.lists-default], shards [1]/[1]
[00:00:00]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.lists-default-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [.lists-default]
[00:00:00]                         │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [.items-default-000001] creating index, cause [api], templates [.items-default], shards [1]/[1]
[00:00:01]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.lists-default-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] in policy [.lists-default]
[00:00:01]                         │ info [x-pack/test/functional/es_archives/rule_exceptions/text] Loading "mappings.json"
[00:00:01]                         │ info [x-pack/test/functional/es_archives/rule_exceptions/text] Loading "data.json"
[00:00:01]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.items-default-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [.items-default]
[00:00:01]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.lists-default-000001] from [{"phase":"hot","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] to [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}] in policy [.lists-default]
[00:00:01]                         │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [text] creating index, cause [api], templates [], shards [1]/[1]
[00:00:01]                         │ info [x-pack/test/functional/es_archives/rule_exceptions/text] Created index "text"
[00:00:01]                         │ debg [x-pack/test/functional/es_archives/rule_exceptions/text] "text" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:00:01]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.items-default-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] in policy [.items-default]
[00:00:01]                         │ info [x-pack/test/functional/es_archives/rule_exceptions/text] Indexed 4 docs into "text"
[00:00:01]                         │ info [o.e.x.i.IndexLifecycleTransition] [node-01] moving index [.items-default-000001] from [{"phase":"hot","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] to [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}] in policy [.items-default]
[00:00:01]                         │ info [x-pack/test/functional/es_archives/rule_exceptions/text_no_spaces] Loading "mappings.json"
[00:00:01]                         │ info [x-pack/test/functional/es_archives/rule_exceptions/text_no_spaces] Loading "data.json"
[00:00:01]                         │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [text_no_spaces] creating index, cause [api], templates [], shards [1]/[1]
[00:00:01]                         │ info [x-pack/test/functional/es_archives/rule_exceptions/text_no_spaces] Created index "text_no_spaces"
[00:00:01]                         │ debg [x-pack/test/functional/es_archives/rule_exceptions/text_no_spaces] "text_no_spaces" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:00:01]                         │ info [x-pack/test/functional/es_archives/rule_exceptions/text_no_spaces] Indexed 4 docs into "text_no_spaces"
[00:00:01]                       │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/zYro7t7gTj-KP1nukWW05w] update_mapping [_doc]
[00:00:06]                       │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/zYro7t7gTj-KP1nukWW05w] update_mapping [_doc]
[00:00:07]                       │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/zYro7t7gTj-KP1nukWW05w] update_mapping [_doc]
[00:00:10]                       │ proc [kibana]   log   [18:09:45.678] [info][eventLog][plugins] event logged: {"@timestamp":"2021-08-10T18:09:45.676Z","event":{"provider":"alerting","action":"execute-start","kind":"alert","category":["siem"],"start":"2021-08-10T18:09:45.676Z"},"kibana":{"saved_objects":[{"rel":"primary","type":"alert","id":"221150c0-fa06-11eb-bc55-dfca44238504","type_id":"siem.signals"}],"task":{"scheduled":"2021-08-10T18:09:45.394Z","schedule_delay":282000000},"server_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d"},"rule":{"id":"221150c0-fa06-11eb-bc55-dfca44238504","license":"basic","category":"siem.signals","ruleset":"siem"},"message":"alert execution start: \"221150c0-fa06-11eb-bc55-dfca44238504\"","ecs":{"version":"1.8.0"}}
[00:00:11]                       │ proc [kibana]   log   [18:09:46.490] [info][eventLog][plugins] event logged: {"@timestamp":"2021-08-10T18:09:45.676Z","event":{"provider":"alerting","action":"execute","kind":"alert","category":["siem"],"start":"2021-08-10T18:09:45.676Z","outcome":"failure","end":"2021-08-10T18:09:46.489Z","duration":813000000,"reason":"execute"},"kibana":{"saved_objects":[{"rel":"primary","type":"alert","id":"221150c0-fa06-11eb-bc55-dfca44238504","type_id":"siem.signals"}],"task":{"scheduled":"2021-08-10T18:09:45.394Z","schedule_delay":282000000},"alerting":{"status":"error"},"server_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d"},"rule":{"id":"221150c0-fa06-11eb-bc55-dfca44238504","license":"basic","category":"siem.signals","ruleset":"siem"},"message":"alert execution failure: siem.signals:221150c0-fa06-11eb-bc55-dfca44238504: 'Signal Testing Query'","error":{"message":"[siem-detection-engine-rule-status:24bfa7e0-fa06-11eb-bc55-dfca44238504]: version conflict, required seqNo [18], primary term [1]. current document has seqNo [19] and primary term [1]: version_conflict_engine_exception: [version_conflict_engine_exception] Reason: [siem-detection-engine-rule-status:24bfa7e0-fa06-11eb-bc55-dfca44238504]: version conflict, required seqNo [18], primary term [1]. current document has seqNo [19] and primary term [1]"},"ecs":{"version":"1.8.0"}}
[00:00:11]                       │ proc [kibana]   log   [18:09:46.508] [error][alerting][plugins] Executing Alert default:siem.signals:221150c0-fa06-11eb-bc55-dfca44238504 has resulted in Error: [siem-detection-engine-rule-status:24bfa7e0-fa06-11eb-bc55-dfca44238504]: version conflict, required seqNo [18], primary term [1]. current document has seqNo [19] and primary term [1]: version_conflict_engine_exception: [version_conflict_engine_exception] Reason: [siem-detection-engine-rule-status:24bfa7e0-fa06-11eb-bc55-dfca44238504]: version conflict, required seqNo [18], primary term [1]. current document has seqNo [19] and primary term [1], caused by: ""
[00:01:44]                       └- ✖ fail: detection engine api security and spaces enabled  Detection exceptions data types and operators  Rule exception operators for data type text "is not" operator will return 0 results if it cannot find what it is excluding
[00:01:44]                       │      Error: timed out waiting for function condition to be true within waitForRuleSuccessOrStatus
[00:01:44]                       │       at /dev/shm/workspace/parallel/20/kibana/x-pack/test/detection_engine_api_integration/utils.ts:785:9
[00:01:44]                       │ 
[00:01:44]                       │ 

Stack Trace

Error: timed out waiting for function condition to be true within waitForRuleSuccessOrStatus
    at /dev/shm/workspace/parallel/20/kibana/x-pack/test/detection_engine_api_integration/utils.ts:785:9

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great and works as expected!

Note to future selves:

  • add ability to clear options
  • add ability to view only selected options
  • add option to limit input width (i.e. so 1 input doesn't go full width)

@ThomThomson ThomThomson merged commit faf6482 into elastic:master Aug 10, 2021
ThomThomson added a commit to ThomThomson/kibana that referenced this pull request Aug 10, 2021
…6877)

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
Co-authored-by: andreadelrio <delrio.andre@gmail.com>
ThomThomson added a commit that referenced this pull request Aug 10, 2021
…108101)

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
Co-authored-by: andreadelrio <delrio.andre@gmail.com>

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
Co-authored-by: andreadelrio <delrio.andre@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dashboard Dashboard related features Feature:Input Control Input controls visualization impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants