-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New Enterprise Search Kibana plugin #66922
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
Merged
cee-chen
merged 49 commits into
elastic:master
from
cee-chen:feature/enterprise-search-plugin
Jul 9, 2020
Merged
Changes from 42 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
c107ccb
Initial App Search in Kibana plugin work
cee-chen 7f47c8a
Update URL casing to match Kibana best practices
cee-chen ad1f754
Register App Search plugin in Home Feature Catalogue
cee-chen 852b9e6
Add custom App Search in Kibana logo
cee-chen 68a4b10
Fix appSearch.host config setting to be optional
cee-chen fe6eac1
Rename plugin to Enterprise Search
cee-chen c79af1a
Set up React Router URL structure
cee-chen cbae563
Convert showSetupGuide action/flag to a React Router link
cee-chen 0e7fd50
Implement Kibana Chrome breadcrumbs
cee-chen b3c564e
Added server unit tests (#2)
JasonStoltz 0c083e1
Refactor top-level Kibana props to a global context state
cee-chen 1719a9d
Added unit tests for public (#4)
JasonStoltz c6393ed
Add UI telemetry tracking to AS in Kibana (#5)
constancecchen c8e3d99
Implement remaining unit tests (#7)
constancecchen a45d65e
Address larger tech debt/TODOs (#8)
constancecchen 8eee7fd
Per telemetry team feedback, rename usageCollection telemetry mapping…
cee-chen 75cfd89
Update Setup Guide installation instructions (#9)
constancecchen 90e8aae
[Refactor] DRY out route test helper
cee-chen f987781
[Refactor] Rename public/test_utils to public/__mocks__
cee-chen 7883a23
Add platinum licensing check to Meta Engines table/call (#11)
constancecchen 4f83c5c
Update plugin to use new Kibana nav + URL update (#12)
constancecchen 6d9c1c4
Add create_first_engine_button telemetry tracking to EmptyState
cee-chen af15936
Switch plugin URLs back to /app/enterprise_search/app_search
cee-chen 9f3645d
Add i18n formatted messages / translations (#13)
constancecchen 7e886e0
Update EngineOverviewHeader to disable button on prop
cee-chen 3454568
Address review feedback (#14)
constancecchen fc19404
E2E testing (#6)
JasonStoltz 0cd9668
Add README and CODEOWNERS (#15)
constancecchen e366a4a
Fix Typescript errors (#16)
constancecchen fbdcc61
Fixed TS warnings in E2E tests (#17)
JasonStoltz 931ed8d
Feedback: Convert static CSS values to EUI variables where possible
cee-chen 520408b
Feedback: Flatten nested CSS where possible
cee-chen bef0ef5
Refactor out components shared with Workplace Search (#18)
constancecchen 176313e
Update copy per feedback from copy team
cee-chen f920bd4
Address various telemetry issues
cee-chen 2a14b5d
Disable plugin access if a normal user does not have access to App Se…
constancecchen b1bf08a
Public URL support for Elastic Cloud (#21)
constancecchen 0d0ca9c
Fix failing feature control tests
cee-chen a74b5e6
Address PR feedback
cee-chen 972adcf
Casing feedback: change all plugin registration IDs from snake_case t…
cee-chen 9e52680
Misc security feedback
cee-chen 15a8b15
Security feedback: add warn logging to telemetry collector
cee-chen 9c6acdd
Address feedback from Pierre
cee-chen 3b715b5
PR feedback
cee-chen d72e988
Fix telemetry API call returning 415 on Chrome
cee-chen d6740f2
Fix failing tests
scottybollinger f305f11
Update Enterprise Search functional tests (without host) to run on CI
cee-chen 2fbde3a
Merge branch 'master' into feature/enterprise-search-plugin
elasticmachine 8ce4486
Address PR feedback from Pierre
cee-chen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # 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 its current MVP state, the plugin provides a basic engines overview from App Search with the goal of gathering user feedback and raising product awareness. | ||
|
|
||
| ## 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](https://www.elastic.co/guide/en/app-search/current/security-and-users.html#app-search-self-managed-security-and-user-management-elasticsearch-native-realm) and log in as the `elastic` superuser on Kibana. | ||
|
|
||
| ## Testing | ||
|
|
||
| ### Unit tests | ||
|
|
||
| From `kibana-root-folder/x-pack`, run: | ||
|
|
||
| ```bash | ||
| yarn test:jest plugins/enterprise_search | ||
| ``` | ||
|
|
||
| ### E2E tests | ||
|
|
||
| See [our functional test runner README](../../test/functional_enterprise_search). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| export const ENGINES_PAGE_SIZE = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "id": "enterpriseSearch", | ||
| "version": "kibana", | ||
| "kibanaVersion": "kibana", | ||
| "requiredPlugins": ["home", "features", "licensing"], | ||
| "configPath": ["enterpriseSearch"], | ||
| "optionalPlugins": ["usageCollection", "security"], | ||
| "server": true, | ||
| "ui": true | ||
| } |
13 changes: 13 additions & 0 deletions
13
x-pack/plugins/enterprise_search/public/applications/__mocks__/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| export { mockHistory } from './react_router_history.mock'; | ||
| export { mockKibanaContext } from './kibana_context.mock'; | ||
| export { mockLicenseContext } from './license_context.mock'; | ||
| export { mountWithContext, mountWithKibanaContext } from './mount_with_context.mock'; | ||
| export { shallowWithIntl } from './shallow_with_i18n.mock'; | ||
|
|
||
| // Note: shallow_usecontext must be imported directly as a file |
17 changes: 17 additions & 0 deletions
17
x-pack/plugins/enterprise_search/public/applications/__mocks__/kibana_context.mock.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import { httpServiceMock } from 'src/core/public/mocks'; | ||
|
|
||
| /** | ||
| * A set of default Kibana context values to use across component tests. | ||
| * @see enterprise_search/public/index.tsx for the KibanaContext definition/import | ||
| */ | ||
| export const mockKibanaContext = { | ||
| http: httpServiceMock.createSetupContract(), | ||
| setBreadcrumbs: jest.fn(), | ||
| enterpriseSearchUrl: 'http://localhost:3002', | ||
cee-chen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/enterprise_search/public/applications/__mocks__/license_context.mock.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import { licensingMock } from '../../../../licensing/public/mocks'; | ||
|
|
||
| export const mockLicenseContext = { | ||
| license: licensingMock.createLicense(), | ||
| }; |
49 changes: 49 additions & 0 deletions
49
x-pack/plugins/enterprise_search/public/applications/__mocks__/mount_with_context.mock.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
| import { mount } from 'enzyme'; | ||
|
|
||
| import { I18nProvider } from '@kbn/i18n/react'; | ||
| import { KibanaContext } from '../'; | ||
| import { mockKibanaContext } from './kibana_context.mock'; | ||
| import { LicenseContext } from '../shared/licensing'; | ||
| import { mockLicenseContext } from './license_context.mock'; | ||
|
|
||
| /** | ||
| * This helper mounts a component with all the contexts/providers used | ||
| * by the production app, while allowing custom context to be | ||
| * passed in via a second arg | ||
| * | ||
| * Example usage: | ||
| * | ||
| * const wrapper = mountWithContext(<Component />, { enterpriseSearchUrl: 'someOverride', license: {} }); | ||
| */ | ||
| export const mountWithContext = (children: React.ReactNode, context?: object) => { | ||
| return mount( | ||
| <I18nProvider> | ||
| <KibanaContext.Provider value={{ ...mockKibanaContext, ...context }}> | ||
| <LicenseContext.Provider value={{ ...mockLicenseContext, ...context }}> | ||
| {children} | ||
| </LicenseContext.Provider> | ||
| </KibanaContext.Provider> | ||
| </I18nProvider> | ||
| ); | ||
| }; | ||
|
|
||
| /** | ||
| * This helper mounts a component with just the default KibanaContext - | ||
| * useful for isolated / helper components that only need this context | ||
| * | ||
| * Same usage/override functionality as mountWithContext | ||
| */ | ||
| export const mountWithKibanaContext = (children: React.ReactNode, context?: object) => { | ||
| return mount( | ||
| <KibanaContext.Provider value={{ ...mockKibanaContext, ...context }}> | ||
| {children} | ||
| </KibanaContext.Provider> | ||
| ); | ||
| }; |
25 changes: 25 additions & 0 deletions
25
x-pack/plugins/enterprise_search/public/applications/__mocks__/react_router_history.mock.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| /** | ||
| * NOTE: This variable name MUST start with 'mock*' in order for | ||
| * Jest to accept its use within a jest.mock() | ||
| */ | ||
| export const mockHistory = { | ||
| createHref: jest.fn(({ pathname }) => `/enterprise_search${pathname}`), | ||
| push: jest.fn(), | ||
| location: { | ||
| pathname: '/current-path', | ||
| }, | ||
| }; | ||
|
|
||
| jest.mock('react-router-dom', () => ({ | ||
| useHistory: jest.fn(() => mockHistory), | ||
| })); | ||
|
|
||
| /** | ||
| * For example usage, @see public/applications/shared/react_router_helpers/eui_link.test.tsx | ||
| */ |
40 changes: 40 additions & 0 deletions
40
x-pack/plugins/enterprise_search/public/applications/__mocks__/shallow_usecontext.mock.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| /** | ||
| * NOTE: These variable names MUST start with 'mock*' in order for | ||
| * Jest to accept its use within a jest.mock() | ||
| */ | ||
| import { mockKibanaContext } from './kibana_context.mock'; | ||
| import { mockLicenseContext } from './license_context.mock'; | ||
|
|
||
| jest.mock('react', () => ({ | ||
| ...(jest.requireActual('react') as object), | ||
| useContext: jest.fn(() => ({ ...mockKibanaContext, ...mockLicenseContext })), | ||
| })); | ||
|
|
||
| /** | ||
| * Example usage within a component test using shallow(): | ||
| * | ||
| * import '../../../test_utils/mock_shallow_usecontext'; // Must come before React's import, adjust relative path as needed | ||
| * | ||
| * import React from 'react'; | ||
| * import { shallow } from 'enzyme'; | ||
| * | ||
| * // ... etc. | ||
| */ | ||
|
|
||
| /** | ||
| * If you need to override the default mock context values, you can do so via jest.mockImplementation: | ||
| * | ||
| * import React, { useContext } from 'react'; | ||
| * | ||
| * // ... etc. | ||
| * | ||
| * it('some test', () => { | ||
| * useContext.mockImplementationOnce(() => ({ enterpriseSearchUrl: 'someOverride' })); | ||
| * }); | ||
| */ |
30 changes: 30 additions & 0 deletions
30
x-pack/plugins/enterprise_search/public/applications/__mocks__/shallow_with_i18n.mock.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
| import { shallow } from 'enzyme'; | ||
| import { I18nProvider } from '@kbn/i18n/react'; | ||
| import { IntlProvider } from 'react-intl'; | ||
|
|
||
| const intlProvider = new IntlProvider({ locale: 'en', messages: {} }, {}); | ||
| const { intl } = intlProvider.getChildContext(); | ||
|
|
||
| /** | ||
| * This helper shallow wraps a component with react-intl's <I18nProvider> which | ||
| * fixes "Could not find required `intl` object" console errors when running tests | ||
| * | ||
| * Example usage (should be the same as shallow()): | ||
| * | ||
| * const wrapper = shallowWithIntl(<Component />); | ||
| */ | ||
| export const shallowWithIntl = (children: React.ReactNode) => { | ||
| const context = { context: { intl } }; | ||
|
|
||
| return shallow(<I18nProvider>{children}</I18nProvider>, context) | ||
| .childAt(0) | ||
| .dive(context) | ||
| .shallow(); | ||
| }; |
3 changes: 3 additions & 0 deletions
3
x-pack/plugins/enterprise_search/public/applications/app_search/assets/engine.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+89.9 KB
...ins/enterprise_search/public/applications/app_search/assets/getting_started.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
x-pack/plugins/enterprise_search/public/applications/app_search/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
...plugins/enterprise_search/public/applications/app_search/assets/meta_engine.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.