Skip to content

Commit e9c1b01

Browse files
[Maps] Support by value saved objects. (#82486) (#83091)
* [Maps] saved objects by value * inject references when unwrapping * clean up map embeddable initialize * use attribute service to load savedMap * clean up * remove clear ui since each route has its own store instance * save * update for API changes * pass input to stateTransfer * remove map saved object loader * remove unused store_operations * add saved objects to recently accessed * provide default description * break originatingApp connection when not returnToOrigin * clean up file structure * clean up adding help menu * use SavedMap in map_embeddable to remove dupicated load attributes code * clean up * restore imports * clean up breadcrumbs to match lens * fix check for duplicate title * tslint * make title map saved object attribute required * fix jest tests * fix logic for hasSaveAndReturnConfig to not show save and return button with new map and allowByValueEmbeddables disabled * tslint * fix functional test by triggering MapApp render after save * rename map_app_container to map_page * move MapApp and redux connector into folder * review feedback * use MAP_PATH constant * update by reference saved object on save and return * cleanup breadcrumbs and title * properly handle deleted map saved objects * tslint cleanup Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent a6dc55f commit e9c1b01

File tree

54 files changed

+1347
-1116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1347
-1116
lines changed

x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/EmbeddedMap.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export function EmbeddedMapComponent() {
7777
);
7878

7979
const input: MapEmbeddableInput = {
80+
attributes: { title: '' },
8081
id: uuid.v4(),
8182
filters: mapFilters,
8283
refreshConfig: {

x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_map.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export function savedMap(): ExpressionFunctionDefinition<
8383
return {
8484
type: EmbeddableExpressionType,
8585
input: {
86+
attributes: { title: '' },
8687
id: args.id,
8788
filters: getQueryFilters(filters),
8889
timeRange: args.timerange || defaultTimeRange,

x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { MapEmbeddableInput } from '../../../../../../plugins/maps/public/embedd
99
import { fromExpression, Ast } from '@kbn/interpreter/common';
1010

1111
const baseSavedMapInput = {
12+
attributes: { title: '' },
1213
id: 'embeddableId',
1314
filters: [],
1415
isLayerTOCOpen: false,

x-pack/plugins/maps/common/i18n_getters.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export function getAppTitle() {
1515
});
1616
}
1717

18+
export function getMapEmbeddableDisplayName() {
19+
return i18n.translate('xpack.maps.embeddableDisplayName', {
20+
defaultMessage: 'map',
21+
});
22+
}
23+
1824
export function getDataSourceLabel() {
1925
return i18n.translate('xpack.maps.source.dataSourceLabel', {
2026
defaultMessage: 'Data source',

x-pack/plugins/maps/common/map_saved_object_type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { SavedObject } from '../../../../src/core/types/saved_objects';
99

1010
export type MapSavedObjectAttributes = {
11-
title?: string;
11+
title: string;
1212
description?: string;
1313
mapStateJSON?: string;
1414
layerListJSON?: string;

x-pack/plugins/maps/kibana.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"uiActions",
1313
"navigation",
1414
"visualizations",
15+
"dashboard",
1516
"embeddable",
1617
"mapsLegacy",
1718
"usageCollection",

x-pack/plugins/maps/public/actions/layer_actions.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ import { addLayer } from './layer_actions';
88
import { LayerDescriptor } from '../../common/descriptor_types';
99
import { LICENSED_FEATURES } from '../licensed_features';
1010

11+
jest.mock('../kibana_services', () => {
12+
return {
13+
getMapsCapabilities() {
14+
return { save: true };
15+
},
16+
};
17+
});
18+
1119
const getStoreMock = jest.fn();
1220
const dispatchMock = jest.fn();
1321

x-pack/plugins/maps/public/actions/map_actions.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ jest.mock('./data_request_actions', () => {
1010
syncDataForAllLayers: () => {},
1111
};
1212
});
13+
jest.mock('../kibana_services', () => {
14+
return {
15+
getMapsCapabilities() {
16+
return { save: true };
17+
},
18+
};
19+
});
1320

1421
import { mapExtentChanged, setMouseCoordinates, setQuery } from './map_actions';
1522

x-pack/plugins/maps/public/connected_components/toolbar_overlay/toolbar_overlay.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
import React from 'react';
88
import { shallow } from 'enzyme';
99

10+
jest.mock('../../kibana_services', () => {
11+
return {
12+
getMapsCapabilities() {
13+
return { save: true };
14+
},
15+
};
16+
});
17+
1018
// @ts-ignore
1119
import { ToolbarOverlay } from './toolbar_overlay';
1220

x-pack/plugins/maps/public/connected_components/widget_overlay/layer_control/layer_toc/toc_entry/view.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
import React from 'react';
88
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
99

10+
jest.mock('../../../../../kibana_services', () => {
11+
return {
12+
getMapsCapabilities() {
13+
return { save: true };
14+
},
15+
};
16+
});
17+
1018
import { TOCEntry } from './view';
1119

1220
const LAYER_ID = '1';

0 commit comments

Comments
 (0)