From 7d15a161e5d64463ef99e0e4dcf3e00f5b831cea Mon Sep 17 00:00:00 2001 From: scottybollinger Date: Wed, 18 Nov 2020 11:02:44 -0600 Subject: [PATCH] [Workplace Search] Port Box changes from ent-search --- .../components/shared/assets/box.svg | 2 +- .../workplace_search/constants.ts | 3 ++ .../applications/workplace_search/routes.ts | 3 ++ .../views/content_sources/source_data.tsx | 41 +++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/assets/box.svg b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/assets/box.svg index 1e7324d9581a7..827f8cf0a55ec 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/assets/box.svg +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/assets/box.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/constants.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/constants.ts index 4e093f472d562..1846115d73900 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/constants.ts @@ -55,6 +55,9 @@ export const SOURCE_STATUSES = { }; export const SOURCE_NAMES = { + BOX: i18n.translate('xpack.enterpriseSearch.workplaceSearch.sources.sourceNames.box', { + defaultMessage: 'Box', + }), CONFLUENCE: i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.sources.sourceNames.confluence', { defaultMessage: 'Confluence' } 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 6099a42e6d7cb..419ae1cbfbc07 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 @@ -21,6 +21,7 @@ export const PRIVATE_SOURCES_DOCS_URL = `${DOCUMENT_PERMISSIONS_DOCS_URL}#source 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 BOX_DOCS_URL = `${DOCS_PREFIX}/workplace-search-box-connector.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`; @@ -59,6 +60,7 @@ 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_BOX_PATH = `${SOURCES_PATH}/add/box`; 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`; @@ -93,6 +95,7 @@ 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_BOX_PATH = `${ORG_SETTINGS_CONNECTORS_PATH}/box/edit`; 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`; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx index dff9895dd84f9..882c3861922e7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx @@ -7,6 +7,7 @@ import { i18n } from '@kbn/i18n'; import { + ADD_BOX_PATH, ADD_CONFLUENCE_PATH, ADD_CONFLUENCE_SERVER_PATH, ADD_DROPBOX_PATH, @@ -24,6 +25,7 @@ import { ADD_SLACK_PATH, ADD_ZENDESK_PATH, ADD_CUSTOM_PATH, + EDIT_BOX_PATH, EDIT_CONFLUENCE_PATH, EDIT_CONFLUENCE_SERVER_PATH, EDIT_DROPBOX_PATH, @@ -41,6 +43,7 @@ import { EDIT_SLACK_PATH, EDIT_ZENDESK_PATH, EDIT_CUSTOM_PATH, + BOX_DOCS_URL, CONFLUENCE_DOCS_URL, CONFLUENCE_SERVER_DOCS_URL, GITHUB_ENTERPRISE_DOCS_URL, @@ -82,6 +85,44 @@ const connectStepDescription = { }; export const staticSourceData = [ + { + name: SOURCE_NAMES.BOX, + serviceType: 'box', + addPath: ADD_BOX_PATH, + editPath: EDIT_BOX_PATH, + configuration: { + isPublicKey: false, + hasOauthRedirect: true, + needsBaseUrl: false, + documentationUrl: BOX_DOCS_URL, + applicationPortalUrl: 'https://app.box.com/developers/console', + }, + sourceDescription: i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.sources.sourceDescriptions.box', + { + defaultMessage: + '{sourceName} is a cloud-based storage service for organizations of all sizes. Create, store, share and automatically synchronize documents across your desktop and web.', + values: { sourceName: SOURCE_NAMES.BOX }, + } + ), + connectStepDescription: connectStepDescription.files, + objTypes: [SOURCE_OBJ_TYPES.ALL_FILES], + features: { + basicOrgContext: [ + FeatureIds.SyncFrequency, + FeatureIds.SyncedItems, + FeatureIds.GlobalAccessPermissions, + ], + basicOrgContextExcludedFeatures: [FeatureIds.DocumentLevelPermissions], + platinumOrgContext: [FeatureIds.SyncFrequency, FeatureIds.SyncedItems], + platinumPrivateContext: [ + FeatureIds.Private, + FeatureIds.SyncFrequency, + FeatureIds.SyncedItems, + ], + }, + accountContextOnly: false, + }, { name: SOURCE_NAMES.CONFLUENCE, serviceType: 'confluence_cloud',