kibana/x-pack/plugins/enterprise_search
Byron Hulcher 57e619be07
[App Search] Migrate Create Engine view (#89816)
* New CreateEngine view component

* Add CreateEngine to index router

* Add Layout-level components for CreateEngine

* Static create engine view

* Add new POST route for engines API endpoint

* Logic for Create Engine view WIP tests failing

* Fix enterpriseSearchRequestHandler path

* Use setQueuedSuccessMessage after engine has been created

* Use exact path for CREATE_ENGINES_PATH (but EngineRouter logic is still firing??)

* Add TODO note

* Put CreateEngine inside the common App Search Layout

* Fix CreateEngineLogic jest tests

* Move create engine view to /create_engine from /engines/new

* Add Create an Engine button to Engines Overview

* Missing FlashMessages on EngineOverview

* Fix test for CreateEngine route

* Fix strong'd text in santized name note

* Use local constant for Supported Languages

* Disable submit button when name is empty

* Bad conflict fix

* Lint nits

* Improve CreateEngineLogic tests

* Improve EngineOverview tests

* Disable EnginesOverview header responsiveness

* Moving CreateEngine route

* create_engine/CreateEngine -> engine_creation/EngineCreation

* Use static values for tests

* Fixing constants, better casing, better ID names, i18ning dropdown labels

* Removing unused imports

* Fix EngineCreation tests

* Fix Engines EmptyState tests

* Fix EnginesOverview tests

* Lint fixes

* Reset mocks after tests

* Update MockRouter properties

* Revert newline change

* Lint fix
2021-02-11 08:38:30 -05:00
..
common Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
public [App Search] Migrate Create Engine view (#89816) 2021-02-11 08:38:30 -05:00
server [App Search] Migrate Create Engine view (#89816) 2021-02-11 08:38:30 -05:00
jest.config.js Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
jest.sh
kibana.json
README.md
tsconfig.json [Enterprise Search] Migrate Kibana plugin to TS project references (#87683) 2021-01-29 11:43:34 -06:00

Enterprise Search

Overview

This plugin's goal is to provide a Kibana user interface to the Enterprise Search solution's products (App Search and Workplace Search). In it's current MVP state, the plugin provides the following with the goal of gathering user feedback and raising product awareness:

  • App Search: A basic engines overview with links into the product.
  • Workplace Search: A simple app overview with basic statistics, links to the sources, users (if standard auth), and product settings.

Development

  1. When developing locally, Enterprise Search should be running locally alongside Kibana on localhost:3002.
  2. Update config/kibana.dev.yml with enterpriseSearch.host: 'http://localhost:3002'
  3. For faster QA/development, run Enterprise Search on elasticsearch-native auth and log in as the elastic superuser on Kibana.

Kea

Enterprise Search uses Kea.js to manage our React/Redux state for us. Kea state is handled in our *Logic files and exposes values and actions for our components to get and set state with.

Advanced Kea usage

For the most part, we stick to the functionality described in Kea's core concepts. However, in some files, we also take advantage of props and events, as well as manually mounting some shared logic files on plugin init outside of React.

Debugging Kea

To debug Kea state in-browser, Kea recommends Redux Devtools. To facilitate debugging, we use the path key with snake_cased paths. The path key should always end with the logic filename (e.g. ['enterprise_search', 'some_logic']) to make it easy for devs to quickly find/jump to files via IDE tooling.

Testing

Unit tests

Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing

Jest tests can be run directly from the x-pack/plugins/enterprise_search folder. This also works for any subfolders or subcomponents.

yarn test:jest
yarn test:jest --watch

Unfortunately coverage collection does not work as automatically, and requires using our handy jest.sh script if you want to run tests on a specific folder and only get coverage numbers for that folder:

# Running the jest.sh script from the `x-pack/plugins/enterprise_search` folder (vs. kibana root)
# will save you time and allow you to Tab to complete folder dir names
sh jest.sh {YOUR_COMPONENT_DIR}
sh jest.sh public/applications/shared/kibana
sh jest.sh server/routes/app_search

E2E tests

See our functional test runner README.