kibana/x-pack/plugins
Byron Hulcher ea8c92b353
[App Search] Allow user to manage source engines through Kibana UX (#98866)
* New bulk create route for meta engine source engines

* New delete route for meta engine source engines

* Add removeSourceEngine and onSourceEngineRemove to SourceEnginesLogicActions

* New SourceEnginesTable component

* Use new SourceEnginesTable component in SourceEngines view

* Added closeAddSourceEnginesModal and openAddSourceEnginesModal to SourceEnginesLogic

* New AddSourceEnginesModal component

* New AddSourceEnginesButton component

* Add AddSourceEnginesButton and AddSourceEnginesModal to SourceEngines view

* Allow user to select source engines to add

* Add addSourceEngines and onSourceEnginesAdd to SourceEnginesLogic

* Submit new source engines when user saves from inside AddSourceEnginesModal

* Fix failing tests

* fix i18n

* Fix imports

* Use body instead of query params for source engines bulk create endpoint

* Tests for SouceEnginesLogic actions setIndexedEngines and fetchIndexedEngines

* Re-enabling two skipped tests

* Feedback: move source engine APIs to own file

- We generally organize routes/logic etc. by view, and since this is its own view, it can get its own file

* Misc UI polish

Table:
- Add EuiPageContent bordered panel (matches Curations & API logs which is a table in a panel)
- Remove bolding on engine name (matches rest of Kibana UI)
- Remove responsive false (we do want responsive tables in Kibana)

Modal:
- Remove EuiOverlayMask - per recent EUI changes, this now comes baked in with EuiModal
- Change description text to subdued to match other modals (e.g. Curations queries) in Kibana

* Misc i18n/copy tweaks

Modal:
- Add combobox placeholder text
- i18n cancel/save buttons
- inline i18n and change title casing to sentence casing

* Table refactors

- DRY out table columns shared with the main engines tables (title & formatting change slightly from the standalone UI, but this is fine / we should prefer Kibana standardization moving forward)
- Actions column changes
  - Give it a name - axe will throw issues for table column missing headings
  - Do not make actions a conditional empty array - we should opt to remove the column totally if there is no content present, otherwise screen readers will read out blank cells unnecessarily
  - Switch to icons w/ description tooltips to match the other Kibana tables
- Remove unnecessary sorting props (we don't have sorting enabled on any columns)

Tests
- Add describe block for organization
- Add missing coverage for window confirm branch and canManageMetaEngineSourceEngines branch

* Modal test fixes

- Remove unnecessary type casting
- Remove commented out line
- Fix missing onChange function coverage

* Modal: move unmemoized array iterations to Kea selectors

- more performant: kea selectors are memoized
- cleaner/less logic in views
- easier to write unit tests for

+ rename setSelectedEngineNamesToAdd to onAddEnginesSelection
+ remove unused selectors test code

* Modal: Add isLoading UX to submit button + value renames

- isLoading prevents double clicks/dupe events, and also provides a responsive UX hint that something is happening

- Var renames: there's only one modal on the page, being extra specific with the name isn't really necessary. If we ever add more than one to this view it would probably make sense to split up the logic files or do something else. Verbose modal names/states shouldn't necessarily be the answer

* Source Engines view test fixes

- Remove unused mock values/actions
- Move constants to within main describe
- Remove unhappy vs happy path describes - there aren't enough of either scenario to warrant the distinction
- add page actions describe block and fix skipped/mounted test by shallow diving into EuiPageHeader

* [Misc] Single components/index.ts export

For easier group importing

* Move all copy consts/strings to their own i18n constants file

* Refactor recursive fetchEngines fn to shared util

+ update MetaEnginesTableLogic to use new helper/DRY out code
+ write unit tests for just that helper
+ simplify other previous logic checks to just check that the fn was called + add mock

* Tests cleanup

- Move consts into top of describe blocks to match rest of codebase
- Remove logic comments for files that are only sourcing 1 logic file
- Modal:
  - shallow is fairly cheap and it's easier / more consistent w/ other tests to start a new wrapper every test
- Logic:
  - Remove unnecessarily EnginesLogic mocks
  - Remove mount() in beforeEach - it doesn't save us that many extra lines / better to be more consistent when starting tests that mount with values vs not
  - mock clearing in beforeEach to match rest of codebase
  - describe blocks: split up actions vs listeners, move selectors between the two
  - actions: fix tests that are in a describe() but not an it() (incorrect syntax)
  - Reducer/value checks: check against entire values obj to check for regressions or untested reducers & be consistent rest of codebase
  - listeners - DRY out beforeEach of success vs error paths, combine some tests that are a bit repetitive vs just having multiple assertions
- Logic comments:
  - Remove unnecessary comments (if we're not setting a response, it seems clear we're not using it)
  - Add extra business logic context explanation as to why we call re-initialize the engine

Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
2021-05-15 01:10:53 -04:00
..
actions [Alerting] Enabling import of rules and connectors (#99857) 2021-05-14 07:43:09 -07:00
alerting [Alerting] Enabling import of rules and connectors (#99857) 2021-05-14 07:43:09 -07:00
apm [APM][RUM] adjust data types for uiFilters and range in APM requests (#99257) 2021-05-14 14:10:18 -04:00
banners Do not mutate config in place during deprecations (#99629) 2021-05-11 05:41:48 -04:00
beats_management
canvas [Canvas] Remove unused legacy autocomplete component (#99215) 2021-05-13 15:24:40 -05:00
cases [Security Solution] Interim Host Isolation Case Commenting (#100092) 2021-05-14 14:40:24 -04:00
cloud Don't query for the current user on anonymous pages (#99511) 2021-05-06 17:04:56 -04:00
console_extensions
cross_cluster_replication [CCR] Unskip component integration tests (#99385) 2021-05-11 08:55:46 -04:00
dashboard_enhanced feat: 🎸 close drilldown manager on view mode switch (#99309) 2021-05-06 00:26:13 +02:00
dashboard_mode
data_enhanced [Search Sessions] Fix display of expired session state in management (#98915) 2021-05-04 12:02:17 +02:00
discover_enhanced
drilldowns
embeddable_enhanced
encrypted_saved_objects Sharing saved objects phase 3 (#94383) 2021-05-14 14:46:17 -04:00
enterprise_search [App Search] Allow user to manage source engines through Kibana UX (#98866) 2021-05-15 01:10:53 -04:00
event_log
features [Alerting] Export rules and connectors (#98802) 2021-05-05 11:33:01 -04:00
file_data_visualizer [ML] Data vizualizer: add choropleth map for index and file (#99434) 2021-05-11 13:40:06 -04:00
file_upload Introduce capabilities provider and switcher to file upload plugin (#96593) 2021-05-14 08:31:03 -04:00
fleet [Fleet] Fix error when searching for keys whose names have spaces (#100056) 2021-05-13 17:32:14 -04:00
global_search
global_search_bar Clearing the global search bar will reset suggestions (#88637) 2021-05-13 11:35:03 -04:00
global_search_providers
graph Unifying converting listing pages to new layout (#98651) 2021-05-06 18:31:20 -04:00
grokdebugger
index_lifecycle_management Reintroduce 96111: Provide guidance of "Custom" allocation behavior in ILM (#99007) 2021-05-03 12:29:57 -07:00
index_management [Index management] Add selected index count (#99652) 2021-05-11 14:10:34 +01:00
infra [Metrics UI] Replace date_histogram with date_range aggregation in threshold alert (#100004) 2021-05-14 13:57:34 -04:00
ingest_pipelines Added missing padding to the popover title and footer in 'Test documents' popover (#99921) 2021-05-14 16:56:31 +02:00
lens [Lens] Create managedReference type for formulas (#99729) 2021-05-14 17:07:21 -04:00
license_api_guard
license_management
licensing
lists [Security Solutions] Removes deprecation and more copied code between security solutions and lists plugin (#100150) 2021-05-14 16:56:08 -06:00
logstash
maps fix-typo: Use of than instead of then (#100030) 2021-05-13 17:35:38 -04:00
metrics_entities [Security Solutions] (Phase 1) Adds an application cache called metrics entities and integrates it within Security Solutions behind a feature flag (#96446) 2021-04-30 12:36:06 -06:00
ml Sharing saved objects phase 3 (#94383) 2021-05-14 14:46:17 -04:00
monitoring [Monitoring] Added missing cgroup memory (#99602) 2021-05-12 11:24:05 -04:00
observability [APM][RUM] adjust data types for uiFilters and range in APM requests (#99257) 2021-05-14 14:10:18 -04:00
osquery [Osquery] Fix Osquery plugin initialization (#99591) 2021-05-10 19:44:01 +02:00
painless_lab
remote_clusters [Remote clusters] Fixed skipped test for search bar (#97472) 2021-05-05 13:05:35 +02:00
reporting [Reporting] Relax save requirement for CSV reports (#99313) 2021-05-12 10:32:51 +02:00
rollup Use doc link services in rollups (#99137) 2021-05-10 10:01:19 -07:00
rule_registry [RAC] Decouple registry from alerts-as-data client (#98935) 2021-05-13 17:12:47 +02:00
runtime_fields
saved_objects_tagging
searchprofiler
security Sharing saved objects phase 3 (#94383) 2021-05-14 14:46:17 -04:00
security_solution [Security Solutions] Removes deprecation and more copied code between security solutions and lists plugin (#100150) 2021-05-14 16:56:08 -06:00
snapshot_restore [Snapshot and Restore] Remove box shadow from panels (#98292) 2021-04-30 12:30:36 -04:00
spaces Sharing saved objects phase 3 (#94383) 2021-05-14 14:46:17 -04:00
stack_alerts [Alerting UI] Fixing behavior when trying to render an Index Threshold visualization with invalid data (#99518) 2021-05-10 14:46:01 -04:00
task_manager Do not mutate config in place during deprecations (#99629) 2021-05-11 05:41:48 -04:00
telemetry_collection_xpack [Rollup] Fixes telemetry (#98639) 2021-05-06 17:41:54 +03:00
timelines
transform [ML] Transforms: Fix handling of fields with keyword mapping available (#98882) 2021-05-04 16:21:27 +02:00
translations Sharing saved objects phase 3 (#94383) 2021-05-14 14:46:17 -04:00
triggers_actions_ui [Alerting] Enabling import of rules and connectors (#99857) 2021-05-14 07:43:09 -07:00
ui_actions_enhanced Enable custom time ranges for saved searches (#99180) 2021-05-05 16:35:39 +02:00
upgrade_assistant Document plugin API for spaces and spacesOss (#98966) 2021-05-05 10:50:59 -04:00
uptime [Uptime] Improve accessibility labeling for FilterPopover component (#99714) 2021-05-14 17:14:18 -04:00
watcher [Watcher] Migrate to new ES client (#97260) 2021-04-30 10:44:08 +02:00
xpack_legacy