mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
parent
af7f42083a
commit
92ae5baadd
11 changed files with 26 additions and 26 deletions
|
@ -26,9 +26,9 @@ import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pa
|
|||
import * as visModule from 'ui/vis';
|
||||
import { ImageComparator } from 'test_utils/image_comparator';
|
||||
import worldJson from './world.json';
|
||||
import EMS_CATALOGUE from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_manifest_6.6.json';
|
||||
import EMS_FILES from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_files_6.6.json';
|
||||
import EMS_TILES from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_tiles_6.6.json';
|
||||
import EMS_CATALOGUE from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_manifest.json';
|
||||
import EMS_FILES from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_files.json';
|
||||
import EMS_TILES from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_tiles.json';
|
||||
|
||||
import initialPng from './initial.png';
|
||||
import toiso3Png from './toiso3.png';
|
||||
|
|
|
@ -92,7 +92,7 @@ const unescapeTemplateVars = url => {
|
|||
//this is not the default locale from Kibana, but the default locale supported by the Elastic Maps Service
|
||||
const DEFAULT_LANGUAGE = 'en';
|
||||
|
||||
export class EMSClientV66 {
|
||||
export class EMSClient {
|
||||
|
||||
EMS_LOAD_TIMEOUT = 32000;
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ import initial from './initial.png';
|
|||
import blues from './blues.png';
|
||||
import shadedGeohashGrid from './shadedGeohashGrid.png';
|
||||
import heatmapRaw from './heatmap_raw.png';
|
||||
import EMS_CATALOGUE from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_manifest_6.6.json';
|
||||
import EMS_FILES from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_files_6.6.json';
|
||||
import EMS_TILES from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_tiles_6.6.json';
|
||||
import EMS_CATALOGUE from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_manifest.json';
|
||||
import EMS_FILES from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_files.json';
|
||||
import EMS_TILES from '../../../../../ui/public/vis/__tests__/map/ems_mocks/sample_tiles.json';
|
||||
|
||||
function mockRawData() {
|
||||
const stack = [dummyESResponse];
|
||||
|
|
|
@ -243,8 +243,8 @@ export default () => Joi.object({
|
|||
}))
|
||||
})).default([])
|
||||
}).default(),
|
||||
manifestServiceUrl: Joi.string().default('https://catalogue.maps.elastic.co/v6.6/manifest'),
|
||||
emsLandingPageUrl: Joi.string().default('https://maps.elastic.co/v6.7'),
|
||||
manifestServiceUrl: Joi.string().default('https://catalogue.maps.elastic.co/v7.0/manifest'),
|
||||
emsLandingPageUrl: Joi.string().default('https://maps.elastic.co/v7.0'),
|
||||
}).default(),
|
||||
|
||||
i18n: Joi.object({
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
*/
|
||||
|
||||
import expect from 'expect.js';
|
||||
import EMS_CATALOGUE from './ems_mocks/sample_manifest_6.6.json';
|
||||
import EMS_FILES from './ems_mocks/sample_files_6.6.json';
|
||||
import EMS_TILES from './ems_mocks/sample_tiles_6.6.json';
|
||||
import EMS_CATALOGUE from './ems_mocks/sample_manifest.json';
|
||||
import EMS_FILES from './ems_mocks/sample_files.json';
|
||||
import EMS_TILES from './ems_mocks/sample_tiles.json';
|
||||
|
||||
|
||||
import { EMSClientV66 } from '../../../../../legacy/core_plugins/tile_map/common/ems_client';
|
||||
import { EMSClient } from '../../../../../legacy/core_plugins/tile_map/common/ems_client';
|
||||
|
||||
describe('ems_client', () => {
|
||||
|
||||
|
@ -37,7 +37,7 @@ describe('ems_client', () => {
|
|||
|
||||
|
||||
const tileService = tiles[0];
|
||||
expect(tileService.getUrlTemplate()).to.be('https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=6.x.x');
|
||||
expect(tileService.getUrlTemplate()).to.be('https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=7.x.x');
|
||||
|
||||
expect (tileService.getHTMLAttribution()).to.be('<p>© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors | <a href="https://www.elastic.co/elastic-maps-service">Elastic Maps Service</a></p>\n');
|
||||
expect (tileService.getMinZoom()).to.be(0);
|
||||
|
@ -55,14 +55,14 @@ describe('ems_client', () => {
|
|||
|
||||
const tilesBefore = await emsClient.getTMSServices();
|
||||
const urlBefore = tilesBefore[0].getUrlTemplate();
|
||||
expect(urlBefore).to.be('https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=6.x.x');
|
||||
expect(urlBefore).to.be('https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=7.x.x');
|
||||
|
||||
emsClient.addQueryParams({
|
||||
'foo': 'bar'
|
||||
});
|
||||
let tiles = await emsClient.getTMSServices();
|
||||
let url = tiles[0].getUrlTemplate();
|
||||
expect(url).to.be('https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=6.x.x&foo=bar');
|
||||
expect(url).to.be('https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=7.x.x&foo=bar');
|
||||
|
||||
emsClient.addQueryParams({
|
||||
'foo': 'schmoo',
|
||||
|
@ -70,7 +70,7 @@ describe('ems_client', () => {
|
|||
});
|
||||
tiles = await emsClient.getTMSServices();
|
||||
url = tiles[0].getUrlTemplate();
|
||||
expect(url).to.be('https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=6.x.x&foo=schmoo&bar=foo');
|
||||
expect(url).to.be('https://tiles-stage.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=7.x.x&foo=schmoo&bar=foo');
|
||||
|
||||
|
||||
});
|
||||
|
@ -127,7 +127,7 @@ describe('ems_client', () => {
|
|||
{ name: 'name', description: 'nom', type: 'property' } ]);
|
||||
|
||||
expect(layer.getDefaultFormatType()).to.be('geojson');
|
||||
expect(layer.getDefaultFormatUrl()).to.be('https://vector-staging.maps.elastic.co/files/world_countries_v1.geo.json?elastic_tile_service_tos=agree&my_app_version=6.x.x&foo=bar');
|
||||
expect(layer.getDefaultFormatUrl()).to.be('https://vector-staging.maps.elastic.co/files/world_countries_v1.geo.json?elastic_tile_service_tos=agree&my_app_version=7.x.x&foo=bar');
|
||||
|
||||
|
||||
});
|
||||
|
@ -181,9 +181,9 @@ describe('ems_client', () => {
|
|||
|
||||
function getEMSClient(options = {}) {
|
||||
|
||||
const emsClient = new EMSClientV66({
|
||||
const emsClient = new EMSClient({
|
||||
language: 'en',
|
||||
kbnVersion: '6.x.x',
|
||||
kbnVersion: '7.x.x',
|
||||
manifestServiceUrl: 'https://foobar',
|
||||
htmlSanitizer: x => x,
|
||||
landingPageUrl: 'https://landing.foobar',
|
||||
|
|
|
@ -21,9 +21,9 @@ import expect from 'expect.js';
|
|||
import ngMock from 'ng_mock';
|
||||
import url from 'url';
|
||||
|
||||
import EMS_CATALOGUE from './ems_mocks/sample_manifest_6.6.json';
|
||||
import EMS_FILES from './ems_mocks/sample_files_6.6.json';
|
||||
import EMS_TILES from './ems_mocks/sample_tiles_6.6.json';
|
||||
import EMS_CATALOGUE from './ems_mocks/sample_manifest.json';
|
||||
import EMS_FILES from './ems_mocks/sample_files.json';
|
||||
import EMS_TILES from './ems_mocks/sample_tiles.json';
|
||||
import { ORIGIN } from '../../../../../legacy/core_plugins/tile_map/common/origin';
|
||||
|
||||
describe('service_settings (FKA tilemaptest)', function () {
|
||||
|
|
|
@ -21,7 +21,7 @@ import { uiModules } from '../../modules';
|
|||
import _ from 'lodash';
|
||||
import MarkdownIt from 'markdown-it';
|
||||
import { ORIGIN } from '../../../../legacy/core_plugins/tile_map/common/origin';
|
||||
import { EMSClientV66 } from '../../../../legacy/core_plugins/tile_map/common/ems_client';
|
||||
import { EMSClient } from '../../../../legacy/core_plugins/tile_map/common/ems_client';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
const markdownIt = new MarkdownIt({
|
||||
|
@ -42,7 +42,7 @@ uiModules.get('kibana')
|
|||
constructor() {
|
||||
|
||||
this._showZoomMessage = true;
|
||||
this._emsClient = new EMSClientV66({
|
||||
this._emsClient = new EMSClient({
|
||||
language: i18n.getLocale(),
|
||||
kbnVersion: kbnVersion,
|
||||
manifestServiceUrl: mapConfig.manifestServiceUrl,
|
||||
|
|
|
@ -17,7 +17,7 @@ export function initRoutes(server, licenseUid) {
|
|||
const serverConfig = server.config();
|
||||
const mapConfig = serverConfig.get('map');
|
||||
|
||||
const emsClient = new server.plugins.tile_map.ems_client.EMSClientV66({
|
||||
const emsClient = new server.plugins.tile_map.ems_client.EMSClient({
|
||||
language: i18n.getLocale(),
|
||||
kbnVersion: serverConfig.get('pkg.version'),
|
||||
manifestServiceUrl: mapConfig.manifestServiceUrl,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue