Skip to content

Commit

Permalink
[Maps] EMS add data card (elastic#48678)
Browse files Browse the repository at this point in the history
* [Maps] EMS add data card

* review feedback

* use EMS abbr in card title
  • Loading branch information
nreese committed Oct 22, 2019
1 parent ff0ebd5 commit 4e317e4
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions src/legacy/core_plugins/kibana/server/tutorials/ems/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';

export function emsBoundariesSpecProvider(server) {
function addBasePath(url) {
const basePath = server.config().get('server.basePath');
return `${basePath.length > 0 ? `${basePath}` : ''}${url}`;
}

return {
id: 'emsBoundaries',
name: i18n.translate('kbn.server.tutorials.ems.nameTitle', {
defaultMessage: 'EMS Boundaries',
}),
category: TUTORIAL_CATEGORY.OTHER,
shortDescription: i18n.translate('kbn.server.tutorials.ems.shortDescription', {
defaultMessage: 'Administrative boundaries from Elastic Maps Service.',
}),
longDescription: i18n.translate('kbn.server.tutorials.ems.longDescription', {
defaultMessage: '[Elastic Maps Service (EMS)](https://www.elastic.co/elastic-maps-service) \
hosts tile layers and vector shapes of administrative boundaries. \
Indexing EMS administrative boundaries in Elasticsearch allows for search on boundary property fields.',
}),
euiIconType: 'emsApp',
completionTimeMinutes: 1,
previewImagePath: '/plugins/kibana/home/tutorial_resources/ems/boundaries_screenshot.png',
onPrem: {
instructionSets: [
{
instructionVariants: [
{
id: 'EMS',
instructions: [
{
title: i18n.translate('kbn.server.tutorials.ems.downloadStepTitle', {
defaultMessage: 'Download Elastic Maps Service boundaries',
}),
textPre: i18n.translate('kbn.server.tutorials.ems.downloadStepText', {
defaultMessage: '1. Navigate to Elastic Maps Service [landing page]({emsLandingPageUrl}).\n\
2. In the left sidebar, select an administrative boundary.\n\
3. Click `Download GeoJSON` button.',
values: {
emsLandingPageUrl: server.config().get('map.emsLandingPageUrl'),
},
}),
},
{
title: i18n.translate('kbn.server.tutorials.ems.uploadStepTitle', {
defaultMessage: 'Index Elastic Maps Service boundaries',
}),
textPre: i18n.translate('kbn.server.tutorials.ems.uploadStepText', {
defaultMessage: '1. Open [Elastic Maps]({newMapUrl}).\n\
2. Click `Add layer`, then select `Upload GeoJSON`.\n\
3. Upload the GeoJSON file and click `Import file`.',
values: {
newMapUrl: addBasePath('/app/maps#/map')
}
}),
}
]
}
]
}
]
},
};
}
2 changes: 2 additions & 0 deletions src/legacy/core_plugins/kibana/server/tutorials/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import { iptablesLogsSpecProvider } from './iptables_logs';
import { ciscoLogsSpecProvider } from './cisco_logs';
import { envoyproxyLogsSpecProvider } from './envoyproxy_logs';
import { couchdbMetricsSpecProvider } from './couchdb_metrics';
import { emsBoundariesSpecProvider } from './ems';

export function registerTutorials(server) {
server.registerTutorial(systemLogsSpecProvider);
Expand Down Expand Up @@ -135,4 +136,5 @@ export function registerTutorials(server) {
server.registerTutorial(ciscoLogsSpecProvider);
server.registerTutorial(envoyproxyLogsSpecProvider);
server.registerTutorial(couchdbMetricsSpecProvider);
server.registerTutorial(emsBoundariesSpecProvider);
}

0 comments on commit 4e317e4

Please sign in to comment.