diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md index d7f159ad6f627..6e50afedbe0b2 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md @@ -211,7 +211,11 @@ readonly links: { uptimeDurationAnomaly: string; }>; readonly alerting: Record; - readonly maps: Record; + readonly maps: Readonly<{ + guide: string; + importGeospatialPrivileges: string; + gdalTutorial: string; + }>; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 7bdf149491ebc..a9330ce499cac 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -347,6 +347,7 @@ export class DocLinksService { maps: { guide: `${KIBANA_DOCS}maps.html`, importGeospatialPrivileges: `${KIBANA_DOCS}import-geospatial-data.html#import-geospatial-privileges`, + gdalTutorial: `${ELASTIC_WEBSITE_URL}blog/how-to-ingest-geospatial-data-into-elasticsearch-with-gdal`, }, monitoring: { alertsKibana: `${KIBANA_DOCS}kibana-alerts.html`, @@ -735,7 +736,11 @@ export interface DocLinksStart { uptimeDurationAnomaly: string; }>; readonly alerting: Record; - readonly maps: Record; + readonly maps: Readonly<{ + guide: string; + importGeospatialPrivileges: string; + gdalTutorial: string; + }>; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 2e75d3f1ba035..593a02a16c15a 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -682,7 +682,11 @@ export interface DocLinksStart { uptimeDurationAnomaly: string; }>; readonly alerting: Record; - readonly maps: Record; + readonly maps: Readonly<{ + guide: string; + importGeospatialPrivileges: string; + gdalTutorial: string; + }>; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; diff --git a/src/plugins/custom_integrations/common/index.ts b/src/plugins/custom_integrations/common/index.ts index f00b4c39405d5..7881a4a0ca880 100755 --- a/src/plugins/custom_integrations/common/index.ts +++ b/src/plugins/custom_integrations/common/index.ts @@ -45,6 +45,7 @@ export const INTEGRATION_CATEGORY_DISPLAY = { language_client: 'Language client', upload_file: 'Upload a file', website_search: 'Website search', + geo: 'Geo', }; /** diff --git a/test/api_integration/apis/custom_integration/integrations.ts b/test/api_integration/apis/custom_integration/integrations.ts index 036eb2ef33c78..4d3915f5f2294 100644 --- a/test/api_integration/apis/custom_integration/integrations.ts +++ b/test/api_integration/apis/custom_integration/integrations.ts @@ -22,7 +22,7 @@ export default function ({ getService }: FtrProviderContext) { expect(resp.body).to.be.an('array'); - expect(resp.body.length).to.be(34); + expect(resp.body.length).to.be(35); // Test for sample data card expect(resp.body.findIndex((c: { id: string }) => c.id === 'sample_data_all')).to.be.above( diff --git a/x-pack/plugins/maps/kibana.json b/x-pack/plugins/maps/kibana.json index 2aa2e4a756490..59b86dc6e6394 100644 --- a/x-pack/plugins/maps/kibana.json +++ b/x-pack/plugins/maps/kibana.json @@ -25,6 +25,7 @@ "presentationUtil" ], "optionalPlugins": [ + "customIntegrations", "home", "savedObjectsTagging", "charts", diff --git a/x-pack/plugins/maps/public/assets/gdal_logo.svg b/x-pack/plugins/maps/public/assets/gdal_logo.svg new file mode 100644 index 0000000000000..7753b9558cea2 --- /dev/null +++ b/x-pack/plugins/maps/public/assets/gdal_logo.svg @@ -0,0 +1,129 @@ + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/maps/server/plugin.ts b/x-pack/plugins/maps/server/plugin.ts index b98f7a8d55e03..b35f680df457c 100644 --- a/x-pack/plugins/maps/server/plugin.ts +++ b/x-pack/plugins/maps/server/plugin.ts @@ -39,6 +39,8 @@ import { EMSSettings } from '../common/ems_settings'; import { PluginStart as DataPluginStart } from '../../../../src/plugins/data/server'; import { EmbeddableSetup } from '../../../../src/plugins/embeddable/server'; import { embeddableMigrations } from './embeddable_migrations'; +import { CustomIntegrationsPluginSetup } from '../../../../src/plugins/custom_integrations/server'; +import { registerIntegrations } from './register_integrations'; interface SetupDeps { features: FeaturesPluginSetupContract; @@ -47,6 +49,7 @@ interface SetupDeps { licensing: LicensingPluginSetup; mapsEms: MapsEmsPluginSetup; embeddable: EmbeddableSetup; + customIntegrations?: CustomIntegrationsPluginSetup; } export interface StartDeps { @@ -159,7 +162,7 @@ export class MapsPlugin implements Plugin { // @ts-ignore setup(core: CoreSetup, plugins: SetupDeps) { - const { usageCollection, home, licensing, features, mapsEms } = plugins; + const { usageCollection, home, licensing, features, mapsEms, customIntegrations } = plugins; const mapsEmsConfig = mapsEms.config; const config$ = this._initializerContext.config.create(); @@ -178,6 +181,10 @@ export class MapsPlugin implements Plugin { this._initHomeData(home, core.http.basePath.prepend, emsSettings); } + if (customIntegrations) { + registerIntegrations(core, customIntegrations); + } + features.registerKibanaFeature({ id: APP_ID, name: i18n.translate('xpack.maps.featureRegistry.mapsFeatureName', { diff --git a/x-pack/plugins/maps/server/register_integrations.ts b/x-pack/plugins/maps/server/register_integrations.ts new file mode 100644 index 0000000000000..8832c746f6db8 --- /dev/null +++ b/x-pack/plugins/maps/server/register_integrations.ts @@ -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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { CoreSetup } from 'kibana/server'; +import { CustomIntegrationsPluginSetup } from '../../../../src/plugins/custom_integrations/server'; +import { APP_ID } from '../common/constants'; + +export function registerIntegrations( + core: CoreSetup, + customIntegrations: CustomIntegrationsPluginSetup +) { + customIntegrations.registerCustomIntegration({ + id: 'ingest_with_gdal', + title: i18n.translate('xpack.maps.registerIntegrations.gdal.integrationTitle', { + defaultMessage: 'GDAL', + }), + description: i18n.translate('xpack.maps.registerIntegrations.gdal.integrationDescription', { + defaultMessage: + 'Upload shapefiles and ingest from relational databases such as PostGIS or Oracle Spatial with GDAL.', + }), + uiInternalPath: + 'https://www.elastic.co/blog/how-to-ingest-geospatial-data-into-elasticsearch-with-gdal', + icons: [ + { + type: 'svg', + src: core.http.basePath.prepend(`/plugins/${APP_ID}/assets/gdal_logo.svg`), + }, + ], + categories: ['upload_file', 'geo'], + shipper: 'other', + isBeta: false, + }); +} diff --git a/x-pack/plugins/maps/server/tutorials/ems/index.ts b/x-pack/plugins/maps/server/tutorials/ems/index.ts index 47cb5476c4b90..2285371444fc7 100644 --- a/x-pack/plugins/maps/server/tutorials/ems/index.ts +++ b/x-pack/plugins/maps/server/tutorials/ems/index.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { TutorialsCategory } from '../../../../../../src/plugins/home/server'; -import { getNewMapPath } from '../../../common/constants'; +import { getNewMapPath, APP_ID } from '../../../common/constants'; export function emsBoundariesSpecProvider({ emsLandingPageUrl, @@ -75,9 +75,9 @@ Indexing EMS administrative boundaries in Elasticsearch allows for search on bou }), euiIconType: 'emsApp', completionTimeMinutes: 1, - previewImagePath: '/plugins/maps/assets/boundaries_screenshot.png', + previewImagePath: `/plugins/${APP_ID}/assets/boundaries_screenshot.png`, onPrem: instructions, elasticCloud: instructions, - integrationBrowserCategories: ['upload_file'], + integrationBrowserCategories: ['upload_file', 'geo'], }); }