From fe915824316167b626bcd4c1a500758faf3653e7 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 13:49:35 -0500 Subject: [PATCH 01/15] Add routes --- .../applications/workplace_search/routes.ts | 105 +++++++++++++++++- 1 file changed, 102 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts index d9798d1f30cfc..bbf51cb8417da 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts @@ -4,9 +4,108 @@ * you may not use this file except in compliance with the Elastic License. */ -export const ORG_SOURCES_PATH = '/org/sources'; -export const USERS_PATH = '/org/users'; -export const ORG_SETTINGS_PATH = '/org/settings'; export const SETUP_GUIDE_PATH = '/setup_guide'; +// TODO: Find a way to get this here correctly in Kibana. +export const PRODUCT_VERSION = '7.10'; + +export const LEAVE_FEEDBACK_EMAIL = 'support@elastic.co'; +export const LEAVE_FEEDBACK_URL = `mailto:${LEAVE_FEEDBACK_EMAIL}?Subject=Elastic%20Workplace%20Search%20Feedback`; + +export const DOCS_PREFIX = `https://www.elastic.co/guide/en/workplace-search/${PRODUCT_VERSION}`; +export const ENT_SEARCH_DOCS_PREFIX = `https://www.elastic.co/guide/en/enterprise-search/${PRODUCT_VERSION}`; +export const DOCUMENT_PERMISSIONS_DOCS_URL = `${DOCS_PREFIX}/workplace-search-sources-document-permissions.html`; +export const DOCUMENT_PERMISSIONS_SYNC_DOCS_URL = `${DOCUMENT_PERMISSIONS_DOCS_URL}#sources-permissions-synchronizing`; +export const PRIVATE_SOURCES_DOCS_URL = `${DOCUMENT_PERMISSIONS_DOCS_URL}#sources-permissions-org-private`; +export const EXTERNAL_IDENTITIES_DOCS_URL = `${DOCS_PREFIX}/workplace-search-external-identities-api.html`; +export const SECURITY_DOCS_URL = `${DOCS_PREFIX}/workplace-search-security.html`; +export const SMTP_DOCS_URL = `${DOCS_PREFIX}/workplace-search-smtp-mailer.html`; +export const CONFLUENCE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-confluence-cloud-connector.html`; +export const CONFLUENCE_SERVER_DOCS_URL = `${DOCS_PREFIX}/workplace-search-confluence-server-connector.html`; +export const DROPBOX_DOCS_URL = `${DOCS_PREFIX}/workplace-search-dropbox-connector.html`; +export const GITHUB_DOCS_URL = `${DOCS_PREFIX}/workplace-search-github-connector.html`; +export const GITHUB_ENTERPRISE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-github-connector.html`; +export const GMAIL_DOCS_URL = `${DOCS_PREFIX}/workplace-search-gmail-connector.html`; +export const GOOGLE_DRIVE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-google-drive-connector.html`; +export const JIRA_DOCS_URL = `${DOCS_PREFIX}/workplace-search-jira-cloud-connector.html`; +export const JIRA_SERVER_DOCS_URL = `${DOCS_PREFIX}/workplace-search-jira-server-connector.html`; +export const ONE_DRIVE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-onedrive-connector.html`; +export const SALESFORCE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-salesforce-connector.html`; +export const SERVICE_NOW_DOCS_URL = `${DOCS_PREFIX}/workplace-search-servicenow-connector.html`; +export const SHARE_POINT_DOCS_URL = `${DOCS_PREFIX}/workplace-search-sharepoint-online-connector.html`; +export const SLACK_DOCS_URL = `${DOCS_PREFIX}/workplace-search-slack-connector.html`; +export const ZENDESK_DOCS_URL = `${DOCS_PREFIX}/workplace-search-zendesk-connector.html`; +export const CUSTOM_SOURCE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-custom-api-sources.html`; +export const CUSTOM_API_DOCS_URL = `${DOCS_PREFIX}/workplace-search-custom-sources-api.html`; +export const CUSTOM_API_DOCUMENT_PERMISSIONS_DOCS_URL = `${CUSTOM_SOURCE_DOCS_URL}#custom-api-source-document-level-access-control`; +export const ENT_SEARCH_LICENSE_MANAGEMENT = `${ENT_SEARCH_DOCS_PREFIX}/license-management.html`; + +export const ORG_PATH = '/org'; + +export const ROLE_MAPPINGS_PATH = `${ORG_PATH}/role-mappings`; +export const ROLE_MAPPING_PATH = `${ROLE_MAPPINGS_PATH}/:roleId`; +export const ROLE_MAPPING_NEW_PATH = `${ROLE_MAPPINGS_PATH}/new`; + +export const USERS_PATH = `${ORG_PATH}/users`; +export const SECURITY_PATH = `${ORG_PATH}/security`; + +export const GROUPS_PATH = `${ORG_PATH}/groups`; +export const GROUP_PATH = `${GROUPS_PATH}/:groupId`; +export const GROUP_SOURCE_PRIORITIZATION_PATH = `${GROUPS_PATH}/:groupId/source-prioritization`; + +export const SOURCES_PATH = '/sources'; +export const ORG_SOURCES_PATH = `${ORG_PATH}${SOURCES_PATH}`; + +export const SOURCE_ADDED_PATH = `${SOURCES_PATH}/added`; +export const ADD_SOURCE_PATH = `${SOURCES_PATH}/add`; +export const ADD_CONFLUENCE_PATH = `${SOURCES_PATH}/add/confluence-cloud`; +export const ADD_CONFLUENCE_SERVER_PATH = `${SOURCES_PATH}/add/confluence-server`; +export const ADD_DROPBOX_PATH = `${SOURCES_PATH}/add/dropbox`; +export const ADD_GITHUB_ENTERPRISE_PATH = `${SOURCES_PATH}/add/github-enterprise-server`; +export const ADD_GITHUB_PATH = `${SOURCES_PATH}/add/github`; +export const ADD_GMAIL_PATH = `${SOURCES_PATH}/add/gmail`; +export const ADD_GOOGLE_DRIVE_PATH = `${SOURCES_PATH}/add/google-drive`; +export const ADD_JIRA_PATH = `${SOURCES_PATH}/add/jira-cloud`; +export const ADD_JIRA_SERVER_PATH = `${SOURCES_PATH}/add/jira-server`; +export const ADD_ONE_DRIVE_PATH = `${SOURCES_PATH}/add/one-drive`; +export const ADD_SALESFORCE_PATH = `${SOURCES_PATH}/add/salesforce`; +export const ADD_SERVICE_NOW_PATH = `${SOURCES_PATH}/add/service-now`; +export const ADD_SHARE_POINT_PATH = `${SOURCES_PATH}/add/share-point`; +export const ADD_SLACK_PATH = `${SOURCES_PATH}/add/slack`; +export const ADD_ZENDESK_PATH = `${SOURCES_PATH}/add/zendesk`; +export const ADD_CUSTOM_PATH = `${SOURCES_PATH}/add/custom`; + +export const PERSONAL_SETTINGS_PATH = '/settings'; + +export const SOURCE_DETAILS_PATH = `${SOURCES_PATH}/:sourceId`; +export const SOURCE_CONTENT_PATH = `${SOURCES_PATH}/:sourceId/content`; +export const SOURCE_SCHEMAS_PATH = `${SOURCES_PATH}/:sourceId/schemas`; +export const SOURCE_DISPLAY_SETTINGS_PATH = `${SOURCES_PATH}/:sourceId/display-settings`; +export const SOURCE_SETTINGS_PATH = `${SOURCES_PATH}/:sourceId/settings`; +export const REINDEX_JOB_PATH = `${SOURCES_PATH}/:sourceId/schema-errors/:activeReindexJobId`; + +export const DISPLAY_SETTINGS_SEARCH_RESULT_PATH = `${SOURCE_DISPLAY_SETTINGS_PATH}/`; +export const DISPLAY_SETTINGS_RESULT_DETAIL_PATH = `${SOURCE_DISPLAY_SETTINGS_PATH}/result-detail`; + +export const ORG_SETTINGS_PATH = `${ORG_PATH}/settings`; +export const ORG_SETTINGS_CUSTOMIZE_PATH = `${ORG_SETTINGS_PATH}/customize`; +export const ORG_SETTINGS_CONNECTORS_PATH = `${ORG_SETTINGS_PATH}/connectors`; +export const ORG_SETTINGS_OAUTH_APPLICATION_PATH = `${ORG_SETTINGS_PATH}/oauth`; +export const EDIT_CONFLUENCE_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/confluence-cloud/edit`; +export const EDIT_CONFLUENCE_SERVER_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/confluence-server/edit`; +export const EDIT_DROPBOX_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/dropbox/edit`; +export const EDIT_GITHUB_ENTERPRISE_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/github-enterprise-server/edit`; +export const EDIT_GITHUB_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/github/edit`; +export const EDIT_GMAIL_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/gmail/edit`; +export const EDIT_GOOGLE_DRIVE_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/google-drive/edit`; +export const EDIT_JIRA_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/jira-cloud/edit`; +export const EDIT_JIRA_SERVER_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/jira-server/edit`; +export const EDIT_ONE_DRIVE_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/one-drive/edit`; +export const EDIT_SALESFORCE_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/salesforce/edit`; +export const EDIT_SERVICE_NOW_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/service-now/edit`; +export const EDIT_SHARE_POINT_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/share-point/edit`; +export const EDIT_SLACK_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/slack/edit`; +export const EDIT_ZENDESK_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/zendesk/edit`; +export const EDIT_CUSTOM_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/custom/edit`; + export const getSourcePath = (sourceId: string): string => `${ORG_SOURCES_PATH}/${sourceId}`; From 822d0b3906d34620c8a7a81235168b3ce146ff02 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 14:14:13 -0500 Subject: [PATCH 02/15] Add version for use in doc link --- .../public/applications/shared/version.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 x-pack/plugins/enterprise_search/public/applications/shared/version.ts diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/version.ts b/x-pack/plugins/enterprise_search/public/applications/shared/version.ts new file mode 100644 index 0000000000000..e29ad8a9f866b --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/version.ts @@ -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 { SemVer } from 'semver'; +import pkg from '../../../../package.json'; + +export const CURRENT_VERSION = new SemVer(pkg.version as string); +export const CURRENT_MAJOR_VERSION = CURRENT_VERSION.major; From 1a531c4db4858e49f6d25a86a148e3ef57acd5f7 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 14:14:29 -0500 Subject: [PATCH 03/15] Set up basic router layout + WorkplaceSearchNav --- .../public/applications/shared/version.ts | 2 +- .../components/layout/index.ts | 7 ++ .../components/layout/nav.test.tsx | 22 ++++++ .../components/layout/nav.tsx | 75 +++++++++++++++++++ .../workplace_search/index.test.tsx | 2 +- .../applications/workplace_search/index.tsx | 37 +++++++-- .../applications/workplace_search/routes.ts | 9 +-- 7 files changed, 140 insertions(+), 14 deletions(-) create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/index.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.test.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.tsx diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/version.ts b/x-pack/plugins/enterprise_search/public/applications/shared/version.ts index e29ad8a9f866b..e851bc6f057ae 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/version.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/version.ts @@ -5,7 +5,7 @@ */ import { SemVer } from 'semver'; -import pkg from '../../../../package.json'; +import pkg from '../../../../../../package.json'; export const CURRENT_VERSION = new SemVer(pkg.version as string); export const CURRENT_MAJOR_VERSION = CURRENT_VERSION.major; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/index.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/index.ts new file mode 100644 index 0000000000000..41861a8ee2dc5 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/index.ts @@ -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 { WorkplaceSearchNav } from './nav'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.test.tsx new file mode 100644 index 0000000000000..0e85d8467cff0 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.test.tsx @@ -0,0 +1,22 @@ +/* + * 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 '../../../__mocks__/shallow_usecontext.mock'; +import React from 'react'; +import { shallow } from 'enzyme'; + +import { SideNav, SideNavLink } from '../../../shared/layout'; +import { WorkplaceSearchNav } from './'; + +describe('WorkplaceSearchNav', () => { + it('renders', () => { + const wrapper = shallow(); + + expect(wrapper.find(SideNav)).toHaveLength(1); + expect(wrapper.find(SideNavLink).first().prop('to')).toEqual('/'); + expect(wrapper.find(SideNavLink).last().prop('to')).toEqual('http://localhost:3002/ws/search'); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.tsx new file mode 100644 index 0000000000000..bb02d9d3d76b0 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.tsx @@ -0,0 +1,75 @@ +/* + * 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, { useContext } from 'react'; +import { i18n } from '@kbn/i18n'; + +import { EuiSpacer } from '@elastic/eui'; + +import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants'; +import { KibanaContext, IKibanaContext } from '../../../index'; +import { SideNav, SideNavLink } from '../../../shared/layout'; + +import { + ORG_SOURCES_PATH, + SOURCES_PATH, + SECURITY_PATH, + ROLE_MAPPINGS_PATH, + GROUPS_PATH, + ORG_SETTINGS_PATH, +} from '../../routes'; + +export const WorkplaceSearchNav: React.FC = () => { + const { enterpriseSearchUrl } = useContext(KibanaContext) as IKibanaContext; + const legacyUrl = (path: string) => `${enterpriseSearchUrl}/ws#${path}`; + + // TODO: icons + // TODO: do we need links to personal dashboard? eweb link? (prob ask bearwood) + return ( + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.overview', { + defaultMessage: 'Overview', + })} + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.sources', { + defaultMessage: 'Sources', + })} + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.groups', { + defaultMessage: 'Groups', + })} + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.roleMappings', { + defaultMessage: 'Role Mappings', + })} + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.security', { + defaultMessage: 'Security', + })} + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.settings', { + defaultMessage: 'Settings', + })} + + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.personalDashboard', { + defaultMessage: 'View my personal dashboard', + })} + + + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.search', { + defaultMessage: 'Go to search application', + })} + + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx index 743080d965c36..fa7543b4883da 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx @@ -15,7 +15,7 @@ import { Overview } from './components/overview'; import { WorkplaceSearch } from './'; -describe('Workplace Search Routes', () => { +describe('Workplace', () => { describe('/', () => { it('redirects to Setup Guide when enterpriseSearchUrl is not set', () => { (useContext as jest.Mock).mockImplementationOnce(() => ({ enterpriseSearchUrl: '' })); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx index cfa70ea29eca8..9d0cd0d8a27eb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx @@ -5,7 +5,7 @@ */ import React, { useContext } from 'react'; -import { Route, Redirect } from 'react-router-dom'; +import { Route, Redirect, Switch } from 'react-router-dom'; import { Provider } from 'react-redux'; import { Store } from 'redux'; import { getContext, resetContext } from 'kea'; @@ -15,6 +15,8 @@ resetContext({ createStore: true }); const store = getContext().store as Store; import { KibanaContext, IKibanaContext } from '../index'; +import { Layout } from '../shared/layout'; +import { WorkplaceSearchNav } from './components/layout/nav'; import { SETUP_GUIDE_PATH } from './routes'; @@ -23,14 +25,35 @@ import { Overview } from './components/overview'; export const WorkplaceSearch: React.FC = () => { const { enterpriseSearchUrl } = useContext(KibanaContext) as IKibanaContext; + if (!enterpriseSearchUrl) + return ( + + + + + + + {/* Kibana displays a blank page on redirect if this isn't included */} + + + ); + return ( - - {!enterpriseSearchUrl ? : } - - - - + + + + + + }> + + + + + + + + ); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts index bbf51cb8417da..70b12912d0cc7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts @@ -4,16 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -export const SETUP_GUIDE_PATH = '/setup_guide'; +import { CURRENT_MAJOR_VERSION } from '../shared/version'; -// TODO: Find a way to get this here correctly in Kibana. -export const PRODUCT_VERSION = '7.10'; +export const SETUP_GUIDE_PATH = '/setup_guide'; export const LEAVE_FEEDBACK_EMAIL = 'support@elastic.co'; export const LEAVE_FEEDBACK_URL = `mailto:${LEAVE_FEEDBACK_EMAIL}?Subject=Elastic%20Workplace%20Search%20Feedback`; -export const DOCS_PREFIX = `https://www.elastic.co/guide/en/workplace-search/${PRODUCT_VERSION}`; -export const ENT_SEARCH_DOCS_PREFIX = `https://www.elastic.co/guide/en/enterprise-search/${PRODUCT_VERSION}`; +export const DOCS_PREFIX = `https://www.elastic.co/guide/en/workplace-search/${CURRENT_MAJOR_VERSION}`; +export const ENT_SEARCH_DOCS_PREFIX = `https://www.elastic.co/guide/en/enterprise-search/${CURRENT_MAJOR_VERSION}`; export const DOCUMENT_PERMISSIONS_DOCS_URL = `${DOCS_PREFIX}/workplace-search-sources-document-permissions.html`; export const DOCUMENT_PERMISSIONS_SYNC_DOCS_URL = `${DOCUMENT_PERMISSIONS_DOCS_URL}#sources-permissions-synchronizing`; export const PRIVATE_SOURCES_DOCS_URL = `${DOCUMENT_PERMISSIONS_DOCS_URL}#sources-permissions-org-private`; From ede987271702e6dbcea1dce7483da3a202425145 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 14:17:28 -0500 Subject: [PATCH 04/15] Update views to account for Layout --- .../components/error_state/error_state.tsx | 16 +++++------ .../components/overview/overview.tsx | 28 +++++++++---------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx index e1114986d2244..907f7e4d9e9ce 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx @@ -5,7 +5,7 @@ */ import React from 'react'; -import { EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui'; +import { EuiPageContent } from '@elastic/eui'; import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants'; import { ErrorStatePrompt } from '../../../shared/error_state'; @@ -15,16 +15,14 @@ import { ViewContentHeader } from '../shared/view_content_header'; export const ErrorState: React.FC = () => { return ( - + <> - - - - - - - + + + + + ); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx index 2c3e78b404d42..33bb4add44eca 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx @@ -5,7 +5,7 @@ */ import React, { useContext, useEffect } from 'react'; -import { EuiPage, EuiPageBody, EuiSpacer } from '@elastic/eui'; +import { EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { useActions, useValues } from 'kea'; @@ -71,22 +71,20 @@ export const Overview: React.FC = () => { const headerDescription = hideOnboarding ? HEADER_DESCRIPTION : ONBOARDING_HEADER_DESCRIPTION; return ( - + <> - - } - /> - {!hideOnboarding && } - - - - - - + } + /> + {!hideOnboarding && } + + + + + ); }; From 0da8efc9f7c0e7698ddcbbbe1704d268bc0126ba Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 14:31:13 -0500 Subject: [PATCH 05/15] Move version to common folder --- .../{public/applications/shared => common}/version.ts | 0 .../public/applications/workplace_search/routes.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename x-pack/plugins/enterprise_search/{public/applications/shared => common}/version.ts (100%) diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/version.ts b/x-pack/plugins/enterprise_search/common/version.ts similarity index 100% rename from x-pack/plugins/enterprise_search/public/applications/shared/version.ts rename to x-pack/plugins/enterprise_search/common/version.ts diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts index 70b12912d0cc7..993a1a378e738 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CURRENT_MAJOR_VERSION } from '../shared/version'; +import { CURRENT_MAJOR_VERSION } from '../../../common/version'; export const SETUP_GUIDE_PATH = '/setup_guide'; From dde4e07130ad87003c2244bc7716f67390ec003f Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 15:41:32 -0500 Subject: [PATCH 06/15] Fix version path --- x-pack/plugins/enterprise_search/common/version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/common/version.ts b/x-pack/plugins/enterprise_search/common/version.ts index e851bc6f057ae..e29ad8a9f866b 100644 --- a/x-pack/plugins/enterprise_search/common/version.ts +++ b/x-pack/plugins/enterprise_search/common/version.ts @@ -5,7 +5,7 @@ */ import { SemVer } from 'semver'; -import pkg from '../../../../../../package.json'; +import pkg from '../../../../package.json'; export const CURRENT_VERSION = new SemVer(pkg.version as string); export const CURRENT_MAJOR_VERSION = CURRENT_VERSION.major; From 02e00b57abfc7eada883a764686f479ac97fce53 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 15:44:51 -0500 Subject: [PATCH 07/15] Remove product button No longer needed since we have all top-level app links in Kibana as a part of this PR --- .../components/overview/overview.tsx | 7 +--- .../components/shared/product_button/index.ts | 7 ---- .../product_button/product_button.test.tsx | 38 ----------------- .../shared/product_button/product_button.tsx | 41 ------------------- 4 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/index.ts delete mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx delete mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx index 33bb4add44eca..eb3736d3446f6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx @@ -18,7 +18,6 @@ import { OverviewLogic, IOverviewActions, IOverviewValues } from './overview_log import { ErrorState } from '../error_state'; import { Loading } from '../shared/loading'; -import { ProductButton } from '../shared/product_button'; import { ViewContentHeader } from '../shared/view_content_header'; import { OnboardingSteps } from './onboarding_steps'; @@ -75,11 +74,7 @@ export const Overview: React.FC = () => { - } - /> + {!hideOnboarding && } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/index.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/index.ts deleted file mode 100644 index c41e27bacb892..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * 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 { ProductButton } from './product_button'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx deleted file mode 100644 index 429a2c509813d..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 '../../../../__mocks__/shallow_usecontext.mock'; - -import React from 'react'; -import { shallow } from 'enzyme'; -import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; - -import { ProductButton } from './'; - -jest.mock('../../../../shared/telemetry', () => ({ - sendTelemetry: jest.fn(), - SendAppSearchTelemetry: jest.fn(), -})); -import { sendTelemetry } from '../../../../shared/telemetry'; - -describe('ProductButton', () => { - it('renders', () => { - const wrapper = shallow(); - - expect(wrapper.find(EuiButton)).toHaveLength(1); - expect(wrapper.find(FormattedMessage)).toHaveLength(1); - }); - - it('sends telemetry on create first engine click', () => { - const wrapper = shallow(); - const button = wrapper.find(EuiButton); - - button.simulate('click'); - expect(sendTelemetry).toHaveBeenCalled(); - (sendTelemetry as jest.Mock).mockClear(); - }); -}); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx deleted file mode 100644 index 5b86e14132e0f..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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, { useContext } from 'react'; - -import { EuiButton, EuiButtonProps, EuiLinkProps } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; - -import { sendTelemetry } from '../../../../shared/telemetry'; -import { KibanaContext, IKibanaContext } from '../../../../index'; - -export const ProductButton: React.FC = () => { - const { enterpriseSearchUrl, http } = useContext(KibanaContext) as IKibanaContext; - - const buttonProps = { - fill: true, - iconType: 'popout', - 'data-test-subj': 'launchButton', - } as EuiButtonProps & EuiLinkProps; - buttonProps.href = `${enterpriseSearchUrl}/ws`; - buttonProps.target = '_blank'; - buttonProps.onClick = () => - sendTelemetry({ - http, - product: 'workplace_search', - action: 'clicked', - metric: 'header_launch_button', - }); - - return ( - - - - ); -}; From d7b0ec05c70e2bce47c504ff2c47a3c0070cbd38 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 15:57:07 -0500 Subject: [PATCH 08/15] You know, for search --- .../public/applications/workplace_search/index.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx index fa7543b4883da..a4af405247f83 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx @@ -15,7 +15,7 @@ import { Overview } from './components/overview'; import { WorkplaceSearch } from './'; -describe('Workplace', () => { +describe('Workplace Search', () => { describe('/', () => { it('redirects to Setup Guide when enterpriseSearchUrl is not set', () => { (useContext as jest.Mock).mockImplementationOnce(() => ({ enterpriseSearchUrl: '' })); From ae43e4df56f2770413ade6e16812266f83d7cbe2 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 15:57:39 -0500 Subject: [PATCH 09/15] Remove comment --- .../applications/workplace_search/components/layout/nav.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.tsx index bb02d9d3d76b0..8f8edc61620ab 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/nav.tsx @@ -26,7 +26,6 @@ export const WorkplaceSearchNav: React.FC = () => { const legacyUrl = (path: string) => `${enterpriseSearchUrl}/ws#${path}`; // TODO: icons - // TODO: do we need links to personal dashboard? eweb link? (prob ask bearwood) return ( From ba0535187e732b1a5560f9cdd31a87b76fa9c4f1 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 12 Aug 2020 16:19:57 -0500 Subject: [PATCH 10/15] Remove unused i18n properties from JSON Tests were failing after removing component: https://kibana-ci.elastic.co/job/elastic+kibana+pipeline-pull-request/67797/execution/node/382/log/ --- x-pack/plugins/translations/translations/ja-JP.json | 1 - x-pack/plugins/translations/translations/zh-CN.json | 1 - 2 files changed, 2 deletions(-) diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index e5cd46b330ca8..8cb1c9f1a354a 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -6873,7 +6873,6 @@ "xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.description": "検索できるように、同僚をこの組織に招待します。", "xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.title": "ユーザーと招待", "xpack.enterpriseSearch.workplaceSearch.overviewUsersCard.title": "検索できるように、同僚を招待しました。", - "xpack.enterpriseSearch.workplaceSearch.productCta": "Workplace Searchの起動", "xpack.enterpriseSearch.workplaceSearch.productName": "Workplace Search", "xpack.enterpriseSearch.workplaceSearch.recentActivity.title": "最近のアクティビティ", "xpack.enterpriseSearch.workplaceSearch.recentActivitySourceLink.linkLabel": "ソースを表示", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index b273f6cc81baf..28c5a7d5138b9 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -6874,7 +6874,6 @@ "xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.description": "邀请同事加入此组织以便一同搜索。", "xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.title": "用户和邀请", "xpack.enterpriseSearch.workplaceSearch.overviewUsersCard.title": "很好,您已邀请同事一同搜索。", - "xpack.enterpriseSearch.workplaceSearch.productCta": "启动 Workplace Search", "xpack.enterpriseSearch.workplaceSearch.productName": "Workplace Search", "xpack.enterpriseSearch.workplaceSearch.recentActivity.title": "最近活动", "xpack.enterpriseSearch.workplaceSearch.recentActivitySourceLink.linkLabel": "查看源", From cd174323aab136cb6ed28a93aac92076b4c89b38 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Fri, 14 Aug 2020 12:26:54 -0500 Subject: [PATCH 11/15] Revert button and i18n copy removal This reverts commit ba0535187e732b1a5560f9cdd31a87b76fa9c4f1. --- .../components/overview/overview.tsx | 7 +++- .../components/shared/product_button/index.ts | 7 ++++ .../product_button/product_button.test.tsx | 38 +++++++++++++++++ .../shared/product_button/product_button.tsx | 41 +++++++++++++++++++ .../translations/translations/ja-JP.json | 1 + .../translations/translations/zh-CN.json | 1 + 6 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/index.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx index eb3736d3446f6..33bb4add44eca 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx @@ -18,6 +18,7 @@ import { OverviewLogic, IOverviewActions, IOverviewValues } from './overview_log import { ErrorState } from '../error_state'; import { Loading } from '../shared/loading'; +import { ProductButton } from '../shared/product_button'; import { ViewContentHeader } from '../shared/view_content_header'; import { OnboardingSteps } from './onboarding_steps'; @@ -74,7 +75,11 @@ export const Overview: React.FC = () => { - + } + /> {!hideOnboarding && } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/index.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/index.ts new file mode 100644 index 0000000000000..c41e27bacb892 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/index.ts @@ -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 { ProductButton } from './product_button'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx new file mode 100644 index 0000000000000..429a2c509813d --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx @@ -0,0 +1,38 @@ +/* + * 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 '../../../../__mocks__/shallow_usecontext.mock'; + +import React from 'react'; +import { shallow } from 'enzyme'; +import { EuiButton } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; + +import { ProductButton } from './'; + +jest.mock('../../../../shared/telemetry', () => ({ + sendTelemetry: jest.fn(), + SendAppSearchTelemetry: jest.fn(), +})); +import { sendTelemetry } from '../../../../shared/telemetry'; + +describe('ProductButton', () => { + it('renders', () => { + const wrapper = shallow(); + + expect(wrapper.find(EuiButton)).toHaveLength(1); + expect(wrapper.find(FormattedMessage)).toHaveLength(1); + }); + + it('sends telemetry on create first engine click', () => { + const wrapper = shallow(); + const button = wrapper.find(EuiButton); + + button.simulate('click'); + expect(sendTelemetry).toHaveBeenCalled(); + (sendTelemetry as jest.Mock).mockClear(); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx new file mode 100644 index 0000000000000..5b86e14132e0f --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx @@ -0,0 +1,41 @@ +/* + * 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, { useContext } from 'react'; + +import { EuiButton, EuiButtonProps, EuiLinkProps } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; + +import { sendTelemetry } from '../../../../shared/telemetry'; +import { KibanaContext, IKibanaContext } from '../../../../index'; + +export const ProductButton: React.FC = () => { + const { enterpriseSearchUrl, http } = useContext(KibanaContext) as IKibanaContext; + + const buttonProps = { + fill: true, + iconType: 'popout', + 'data-test-subj': 'launchButton', + } as EuiButtonProps & EuiLinkProps; + buttonProps.href = `${enterpriseSearchUrl}/ws`; + buttonProps.target = '_blank'; + buttonProps.onClick = () => + sendTelemetry({ + http, + product: 'workplace_search', + action: 'clicked', + metric: 'header_launch_button', + }); + + return ( + + + + ); +}; diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 8cb1c9f1a354a..e5cd46b330ca8 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -6873,6 +6873,7 @@ "xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.description": "検索できるように、同僚をこの組織に招待します。", "xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.title": "ユーザーと招待", "xpack.enterpriseSearch.workplaceSearch.overviewUsersCard.title": "検索できるように、同僚を招待しました。", + "xpack.enterpriseSearch.workplaceSearch.productCta": "Workplace Searchの起動", "xpack.enterpriseSearch.workplaceSearch.productName": "Workplace Search", "xpack.enterpriseSearch.workplaceSearch.recentActivity.title": "最近のアクティビティ", "xpack.enterpriseSearch.workplaceSearch.recentActivitySourceLink.linkLabel": "ソースを表示", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 28c5a7d5138b9..b273f6cc81baf 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -6874,6 +6874,7 @@ "xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.description": "邀请同事加入此组织以便一同搜索。", "xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.title": "用户和邀请", "xpack.enterpriseSearch.workplaceSearch.overviewUsersCard.title": "很好,您已邀请同事一同搜索。", + "xpack.enterpriseSearch.workplaceSearch.productCta": "启动 Workplace Search", "xpack.enterpriseSearch.workplaceSearch.productName": "Workplace Search", "xpack.enterpriseSearch.workplaceSearch.recentActivity.title": "最近活动", "xpack.enterpriseSearch.workplaceSearch.recentActivitySourceLink.linkLabel": "查看源", From b3ba9ed48e2347f13fabaeda8a278d9cc87c1796 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Fri, 14 Aug 2020 12:30:05 -0500 Subject: [PATCH 12/15] Move Overview out of layout to hide nav For now, the route for groups was added to avoid having comment out the code. Will add the groups component in a future PR --- .../public/applications/workplace_search/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx index 9d0cd0d8a27eb..4b6ad9b6d3725 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx @@ -44,10 +44,14 @@ export const WorkplaceSearch: React.FC = () => { + + + }> - + + {/* Will replace with groups component subsequent PR */} From d0b39a6d249735da375b2956afaffa23b1eaa8cd Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Fri, 14 Aug 2020 12:50:27 -0500 Subject: [PATCH 13/15] Revert layout changes to Overview Since there is no nav, the padding was missing and the view looked off. Reverting to the 7.9, centered column view --- .../components/overview/overview.tsx | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx index 33bb4add44eca..2c3e78b404d42 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx @@ -5,7 +5,7 @@ */ import React, { useContext, useEffect } from 'react'; -import { EuiSpacer } from '@elastic/eui'; +import { EuiPage, EuiPageBody, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { useActions, useValues } from 'kea'; @@ -71,20 +71,22 @@ export const Overview: React.FC = () => { const headerDescription = hideOnboarding ? HEADER_DESCRIPTION : ONBOARDING_HEADER_DESCRIPTION; return ( - <> + - } - /> - {!hideOnboarding && } - - - - - + + } + /> + {!hideOnboarding && } + + + + + + ); }; From 7b9658e539da7b61435391d1631d5b03addf82b2 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Fri, 14 Aug 2020 13:22:03 -0500 Subject: [PATCH 14/15] Remove extra Overview component Was causing tests to fail --- .../public/applications/workplace_search/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx index 4b6ad9b6d3725..6470a3b78c5f1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx @@ -52,7 +52,7 @@ export const WorkplaceSearch: React.FC = () => { {/* Will replace with groups component subsequent PR */} - +
From d416fa8d837c2a409b399b6360829e75d5b96163 Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Fri, 14 Aug 2020 13:36:11 -0500 Subject: [PATCH 15/15] Revert error state to use EuiPage --- .../components/error_state/error_state.tsx | 18 +++++++++++------- .../components/overview/overview.tsx | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx index 907f7e4d9e9ce..53f3a7a274429 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx @@ -4,8 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ +// TODO: Remove EuiPage & EuiPageBody before exposing full app + import React from 'react'; -import { EuiPageContent } from '@elastic/eui'; +import { EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui'; import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants'; import { ErrorStatePrompt } from '../../../shared/error_state'; @@ -15,14 +17,16 @@ import { ViewContentHeader } from '../shared/view_content_header'; export const ErrorState: React.FC = () => { return ( - <> + - - - - - + + + + + + + ); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx index 2c3e78b404d42..b816eb2973207 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/overview/overview.tsx @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// TODO: Remove EuiPage & EuiPageBody before exposing full app + import React, { useContext, useEffect } from 'react'; import { EuiPage, EuiPageBody, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n';