From 94e850dcb52bfbcd8850a5aef6d96eef303a179f Mon Sep 17 00:00:00 2001 From: Jedrzej Blaszyk Date: Fri, 7 Jul 2023 10:51:11 +0200 Subject: [PATCH] [Enterprise Search] Add Google Drive connector tile to content UI (#161359) ## Summary This adds Google Drive connector tile to Enterprise Search. ### Preview Google drive connector documentation link: https://www.elastic.co/guide/en/enterprise-search/master/connectors-google-drive.html Tile view: Screenshot 2023-07-06 at 16 18 33 Google Drive configuration - we only require service account JSON: Screenshot 2023-07-06 at 16 20 03 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- packages/kbn-doc-links/src/get_doc_links.ts | 1 + packages/kbn-doc-links/src/types.ts | 1 + .../enterprise_search/common/connectors/connectors.ts | 10 ++++++++++ .../components/search_index/connector/constants.ts | 6 ++++++ .../public/applications/shared/doc_links/doc_links.ts | 3 +++ .../applications/shared/icons/connector_icons.ts | 2 ++ 6 files changed, 23 insertions(+) diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 3b28dafbcd761..def26211291d6 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -139,6 +139,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { connectorsDropbox: `${ENTERPRISE_SEARCH_DOCS}connectors-dropbox.html`, connectorsContentExtraction: `${ENTERPRISE_SEARCH_DOCS}connectors-content-extraction.html`, connectorsGoogleCloudStorage: `${ENTERPRISE_SEARCH_DOCS}connectors-google-cloud.html`, + connectorsGoogleDrive: `${ENTERPRISE_SEARCH_DOCS}connectors-google-drive.html`, connectorsJira: `${ENTERPRISE_SEARCH_DOCS}connectors-jira.html`, connectorsMicrosoftSQL: `${ENTERPRISE_SEARCH_DOCS}connectors-ms-sql.html`, connectorsMongoDB: `${ENTERPRISE_SEARCH_DOCS}connectors-mongodb.html`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index b8f15cbde68ca..c4fdc8657e2ac 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -123,6 +123,7 @@ export interface DocLinks { readonly connectorsContentExtraction: string; readonly connectorsDropbox: string; readonly connectorsGoogleCloudStorage: string; + readonly connectorsGoogleDrive: string; readonly connectorsJira: string; readonly connectorsMicrosoftSQL: string; readonly connectorsMongoDB: string; diff --git a/x-pack/plugins/enterprise_search/common/connectors/connectors.ts b/x-pack/plugins/enterprise_search/common/connectors/connectors.ts index 34562ed68f36a..30b8186c0053d 100644 --- a/x-pack/plugins/enterprise_search/common/connectors/connectors.ts +++ b/x-pack/plugins/enterprise_search/common/connectors/connectors.ts @@ -58,6 +58,16 @@ export const CONNECTOR_DEFINITIONS: ConnectorServerSideDefinition[] = [ }), serviceType: 'google_cloud_storage', }, + { + iconPath: 'google_drive.svg', + isBeta: true, + isNative: false, + keywords: ['google', 'drive', 'connector'], + name: i18n.translate('xpack.enterpriseSearch.content.nativeConnectors.googleDrive.name', { + defaultMessage: 'Google Drive', + }), + serviceType: 'google_drive', + }, { iconPath: 'mongodb.svg', isBeta: false, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts index 0f1603ea4fe0d..24b9d342f52d4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts @@ -43,6 +43,12 @@ export const CONNECTORS_DICT: Record = { externalDocsUrl: 'https://cloud.google.com/storage/docs', icon: CONNECTOR_ICONS.google_cloud_storage, }, + google_drive: { + docsUrl: docLinks.connectorsGoogleDrive, + externalAuthDocsUrl: 'https://cloud.google.com/iam/docs/service-account-overview', + externalDocsUrl: 'https://developers.google.com/drive', + icon: CONNECTOR_ICONS.google_drive, + }, jira: { docsUrl: docLinks.connectorsJira, externalAuthDocsUrl: '', diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts index 2861c8032e0a3..c61deecb811d0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts @@ -68,6 +68,7 @@ class DocLinks { public connectorsContentExtraction: string; public connectorsDropbox: string; public connectorsGoogleCloudStorage: string; + public connectorsGoogleDrive: string; public connectorsJira: string; public connectorsMicrosoftSQL: string; public connectorsMongoDB: string; @@ -223,6 +224,7 @@ class DocLinks { this.connectorsClients = ''; this.connectorsDropbox = ''; this.connectorsGoogleCloudStorage = ''; + this.connectorsGoogleDrive = ''; this.connectorsJira = ''; this.connectorsMicrosoftSQL = ''; this.connectorsMongoDB = ''; @@ -380,6 +382,7 @@ class DocLinks { this.connectorsDropbox = docLinks.links.enterpriseSearch.connectorsDropbox; this.connectorsGoogleCloudStorage = docLinks.links.enterpriseSearch.connectorsGoogleCloudStorage; + this.connectorsGoogleDrive = docLinks.links.enterpriseSearch.connectorsGoogleDrive; this.connectorsJira = docLinks.links.enterpriseSearch.connectorsJira; this.connectorsMicrosoftSQL = docLinks.links.enterpriseSearch.connectorsMicrosoftSQL; this.connectorsMongoDB = docLinks.links.enterpriseSearch.connectorsMongoDB; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/icons/connector_icons.ts b/x-pack/plugins/enterprise_search/public/applications/shared/icons/connector_icons.ts index cb7871bbe9f02..5533e6e5d3d3c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/icons/connector_icons.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/icons/connector_icons.ts @@ -11,6 +11,7 @@ import custom from '../../../assets/source_icons/custom.svg'; import dropbox from '../../../assets/source_icons/dropbox.svg'; import github from '../../../assets/source_icons/github.svg'; import google_cloud_storage from '../../../assets/source_icons/google_cloud_storage.svg'; +import google_drive from '../../../assets/source_icons/google_drive.svg'; import jira_cloud from '../../../assets/source_icons/jira_cloud.svg'; import mongodb from '../../../assets/source_icons/mongodb.svg'; import microsoft_sql from '../../../assets/source_icons/mssql.svg'; @@ -31,6 +32,7 @@ export const CONNECTOR_ICONS = { dropbox, github, google_cloud_storage, + google_drive, jira_cloud, microsoft_sql, mongodb,