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] replace angular serviceSettings service with EmsClient #32725

Merged
merged 2 commits into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion x-pack/plugins/maps/public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import 'react-vis/dist/style.css';

import 'mapbox-gl/dist/mapbox-gl.css';

import 'ui/vis/map/service_settings';
import './angular/services/gis_map_saved_object_loader';
import './angular/map_controller';
import listingTemplate from './angular/listing_ng_wrapper.html';
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/maps/public/kibana_services.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { getRequestInspectorStats, getResponseInspectorStats } from 'ui/courier/
export const timeService = timefilter;
export let indexPatternService;
export let SearchSource;
export let emsServiceSettings;

export async function fetchSearchSourceAndRecordWithInspector({ searchSource, requestId, requestName, requestDesc, inspectorAdapters }) {
const inspectorRequest = inspectorAdapters.requests.start(
Expand Down Expand Up @@ -40,5 +39,4 @@ uiModules.get('app/maps').run(($injector) => {
indexPatternService = $injector.get('indexPatterns');
const Private = $injector.get('Private');
SearchSource = Private(SearchSourceProvider);
emsServiceSettings = $injector.get('serviceSettings');
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { AbstractVectorSource } from '../vector_source';
import React from 'react';
import { GIS_API_PATH, EMS_FILE } from '../../../../../common/constants';
import { emsServiceSettings } from '../../../../kibana_services';
import { getEmsVectorFilesMeta } from '../../../../meta';
import { EMSFileCreateSourceEditor } from './create_source_editor';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -68,7 +67,14 @@ export class EMSFileSource extends AbstractVectorSource {
}

async getImmutableProperties() {
const emsLink = await emsServiceSettings.getEMSHotLink({ id: this._descriptor.id });
let emsLink;
try {
const emsVectorFileMeta = await this._getEmsVectorFileMeta();
emsLink = emsVectorFileMeta.emsLink;
} catch(error) {
// ignore error if EMS layer id could not be found
}

return [
{
label: getDataSourceLabel(),
Expand All @@ -79,7 +85,8 @@ export class EMSFileSource extends AbstractVectorSource {
defaultMessage: `Layer`,
}),
value: this._descriptor.id,
link: emsLink }
link: emsLink
}
];
}

Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/maps/server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ export function initRoutes(server, licenseUid) {
fields: fileLayer.getFieldsInLanguage(),
url: fileLayer.getDefaultFormatUrl(),
format: format, //legacy: format and meta are split up
meta: meta //legacy, format and meta are split up
meta: meta, //legacy, format and meta are split up,
emsLink: fileLayer.getEMSHotLink()
};
});

Expand Down