Skip to content
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

[Maps] Add gdal integration #118633

Merged
merged 9 commits into from
Nov 16, 2021
7 changes: 6 additions & 1 deletion src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,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`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though doc-links is not yet available server-side, adding the link here so it gets validated on release. This is the same approach we've taken with other data-integrations (e.g. language clients).

},
monitoring: {
alertsKibana: `${KIBANA_DOCS}kibana-alerts.html`,
Expand Down Expand Up @@ -737,7 +738,11 @@ export interface DocLinksStart {
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Record<string, string>;
readonly maps: Readonly<{
guide: string;
importGeospatialPrivileges: string;
gdalTutorial: string;
}>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/custom_integrations/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const INTEGRATION_CATEGORY_DISPLAY = {
language_client: 'Language client',
upload_file: 'Upload a file',
website_search: 'Website search',
geo: 'Geo',
};

/**
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/maps/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"presentationUtil"
],
"optionalPlugins": [
"customIntegrations",
"home",
"savedObjectsTagging",
"charts",
Expand Down
129 changes: 129 additions & 0 deletions x-pack/plugins/maps/public/assets/gdal_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion x-pack/plugins/maps/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -47,6 +49,7 @@ interface SetupDeps {
licensing: LicensingPluginSetup;
mapsEms: MapsEmsPluginSetup;
embeddable: EmbeddableSetup;
customIntegrations?: CustomIntegrationsPluginSetup;
}

export interface StartDeps {
Expand Down Expand Up @@ -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();

Expand All @@ -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', {
Expand Down
38 changes: 38 additions & 0 deletions x-pack/plugins/maps/server/register_integrations.ts
Original file line number Diff line number Diff line change
@@ -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: 'Upload geo data with GDAL',
thomasneirynck marked this conversation as resolved.
Show resolved Hide resolved
}),
description: i18n.translate('xpack.maps.registerIntegrations.gdal.integrationDescription', {
defaultMessage:
'Upload shapefiles or ingest from relational databases such as PostGIS and OracleSpatial',
thomasneirynck marked this conversation as resolved.
Show resolved Hide resolved
}),
uiInternalPath:
'https://www.elastic.co/blog/how-to-ingest-geospatial-data-into-elasticsearch-with-gdal',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we link to something inside the product instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet. We only have the blog post for now. It is not uncommon for the data-integrations page to link to blog posts, e.g. the Fleet announcements

I do agree that in-app documentation would be helpful.

icons: [
{
type: 'svg',
src: core.http.basePath.prepend(`/plugins/${APP_ID}/assets/gdal_logo.svg`),
},
],
categories: ['upload_file', 'geo'],
shipper: 'other',
isBeta: false,
});
}
6 changes: 3 additions & 3 deletions x-pack/plugins/maps/server/tutorials/ems/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'],
});
}