Skip to content

Commit

Permalink
rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Jun 24, 2020
1 parent d9ce877 commit b9e9fd5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export const INDEX_SETTINGS_API_PATH = `${GIS_API_PATH}/indexSettings`;
export const FONTS_API_PATH = `${GIS_API_PATH}/fonts`;

const MAP_BASE_URL = `/${MAPS_APP_PATH}/${MAP_PATH}`;
export function createNewMapPath() {
export function getNewMapPath() {
return MAP_BASE_URL;
}
export function createMapPath(id: string) {
export function getExistingMapPath(id: string) {
return `${MAP_BASE_URL}/${id}`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
IContainer,
} from '../../../../../src/plugins/embeddable/public';
import '../index.scss';
import { createMapPath, MAP_SAVED_OBJECT_TYPE, APP_ICON } from '../../common/constants';
import { getExistingMapPath, MAP_SAVED_OBJECT_TYPE, APP_ICON } from '../../common/constants';
import { LayerDescriptor } from '../../common/descriptor_types';
import { MapEmbeddableInput } from './types';
import { lazyLoadMapModules } from '../lazy_load_bundle';
Expand Down Expand Up @@ -113,7 +113,7 @@ export class MapEmbeddableFactory implements EmbeddableFactoryDefinition {
{
layerList,
title: savedMap.title,
editUrl: getHttp().basePath.prepend(createMapPath(savedObjectId)),
editUrl: getHttp().basePath.prepend(getExistingMapPath(savedObjectId)),
indexPatterns,
editable: await this.isEditable(),
settings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { getIsLayerTOCOpen, getOpenTOCDetails } from '../../../selectors/ui_selectors';
import { copyPersistentState } from '../../../reducers/util';
import { extractReferences, injectReferences } from '../../../../common/migrations/references';
import { createMapPath, MAP_SAVED_OBJECT_TYPE } from '../../../../common/constants';
import { getExistingMapPath, MAP_SAVED_OBJECT_TYPE } from '../../../../common/constants';
import { getStore } from '../../store_operations';

export function createSavedGisMapClass(services) {
Expand Down Expand Up @@ -76,7 +76,7 @@ export function createSavedGisMapClass(services) {
}

getFullPath() {
return createMapPath(this.id);
return getExistingMapPath(this.id);
}

getLayerList() {
Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/maps/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getFlightsSavedObjects } from './sample_data/flights_saved_objects.js';
// @ts-ignore
import { getWebLogsSavedObjects } from './sample_data/web_logs_saved_objects.js';
import { registerMapsUsageCollector } from './maps_telemetry/collectors/register';
import { APP_ID, APP_ICON, MAP_SAVED_OBJECT_TYPE, createMapPath } from '../common/constants';
import { APP_ID, APP_ICON, MAP_SAVED_OBJECT_TYPE, getExistingMapPath } from '../common/constants';
import { mapSavedObjects, mapsTelemetrySavedObjects } from './saved_objects';
import { MapsXPackConfig } from '../config';
// @ts-ignore
Expand Down Expand Up @@ -58,7 +58,7 @@ export class MapsPlugin implements Plugin {

home.sampleData.addAppLinksToSampleDataset('ecommerce', [
{
path: createMapPath('2c9c1f60-1909-11e9-919b-ffe5949a18d2'),
path: getExistingMapPath('2c9c1f60-1909-11e9-919b-ffe5949a18d2'),
label: sampleDataLinkLabel,
icon: APP_ICON,
},
Expand All @@ -80,7 +80,7 @@ export class MapsPlugin implements Plugin {

home.sampleData.addAppLinksToSampleDataset('flights', [
{
path: createMapPath('5dd88580-1906-11e9-919b-ffe5949a18d2'),
path: getExistingMapPath('5dd88580-1906-11e9-919b-ffe5949a18d2'),
label: sampleDataLinkLabel,
icon: APP_ICON,
},
Expand All @@ -101,7 +101,7 @@ export class MapsPlugin implements Plugin {
home.sampleData.addSavedObjectsToSampleDataset('logs', getWebLogsSavedObjects());
home.sampleData.addAppLinksToSampleDataset('logs', [
{
path: createMapPath('de71f4f0-1902-11e9-919b-ffe5949a18d2'),
path: getExistingMapPath('de71f4f0-1902-11e9-919b-ffe5949a18d2'),
label: sampleDataLinkLabel,
icon: APP_ICON,
},
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/server/saved_objects/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { SavedObjectsType } from 'src/core/server';
import { APP_ICON, createMapPath } from '../../common/constants';
import { APP_ICON, getExistingMapPath } from '../../common/constants';
// @ts-ignore
import { migrations } from './migrations';

Expand All @@ -31,7 +31,7 @@ export const mapSavedObjects: SavedObjectsType = {
},
getInAppUrl(obj) {
return {
path: createMapPath(obj.id),
path: getExistingMapPath(obj.id),
uiCapabilitiesPath: 'maps.show',
};
},
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/server/tutorials/ems/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { i18n } from '@kbn/i18n';
import { TutorialsCategory } from '../../../../../../src/plugins/home/server';
import { createNewMapPath } from '../../../common/constants';
import { getNewMapPath } from '../../../common/constants';

export function emsBoundariesSpecProvider({
emsLandingPageUrl,
Expand Down Expand Up @@ -64,7 +64,7 @@ Indexing EMS administrative boundaries in Elasticsearch allows for search on bou
2. Click `Add layer`, then select `Upload GeoJSON`.\n\
3. Upload the GeoJSON file and click `Import file`.',
values: {
newMapUrl: prependBasePath(createNewMapPath()),
newMapUrl: prependBasePath(getNewMapPath()),
},
}),
},
Expand Down

0 comments on commit b9e9fd5

Please sign in to comment.