Skip to content

Commit

Permalink
[maps] support null description in saved object (elastic#162145)
Browse files Browse the repository at this point in the history
Part of elastic#162069

> This happens in maps too and possibly other SOs that have null
description (not sure if it were ever possible to have null description
in maps.) It seems from the SOs that Bhavya sent that it was possible
for visualizations. With this schema change the bug if fixed
elastic#162106

> Not sure if it makes sense to also do it in maps. @nreese wdyt?

Add support for null description in maps saved object to be consistent
with visualize saved objects.

### test instructions
1) Install web logs sample data set
2) export map
3) manually change ndjson, changing `description:""` to
`description:null`
4) reimport map saved object
5) verify map can be opened

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
2 people authored and Devon Thomson committed Aug 1, 2023
1 parent 2e3adf4 commit e0cab80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
const mapAttributesSchema = schema.object(
{
title: schema.string(),
description: schema.maybe(schema.string()),
description: schema.maybe(schema.nullable(schema.string())),
mapStateJSON: schema.maybe(schema.string()),
layerListJSON: schema.maybe(schema.string()),
uiStateJSON: schema.maybe(schema.string()),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/fixtures/kbn_archiver/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

{
"attributes": {
"description": "",
"description": null,
"layerListJSON": "[{\"id\":\"n1t6f\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"sourceDescriptor\":{\"id\":\"62eca1fc-fe42-11e8-8eb2-f2801f1b9fd1\",\"type\":\"ES_SEARCH\",\"geoField\":\"geometry\",\"limit\":2048,\"filterByMapBounds\":false,\"showTooltip\":true,\"tooltipProperties\":[\"name\"],\"applyGlobalQuery\":false,\"indexPatternRefName\":\"layer_1_source_index_pattern\",\"scalingType\":\"LIMIT\"},\"visible\":true,\"temporary\":false,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"fieldMetaOptions\":{\"isEnabled\":false,\"sigma\":3},\"field\":{\"label\":\"max(prop1) group by meta_for_geo_shapes*.runtime_shape_name\",\"name\":\"__kbnjoin__max_of_prop1__855ccb86-fe42-11e8-8eb2-f2801f1b9fd1\",\"origin\":\"join\"},\"color\":\"Blues\"}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}}},\"temporary\":true,\"previousStyle\":null},\"type\":\"VECTOR\",\"joins\":[{\"leftField\":\"name\",\"right\":{\"id\":\"855ccb86-fe42-11e8-8eb2-f2801f1b9fd1\",\"indexPatternTitle\":\"meta_for_geo_shapes*\",\"term\":\"runtime_shape_name\",\"metrics\":[{\"type\":\"max\",\"field\":\"prop1\"}],\"applyGlobalQuery\":true,\"indexPatternRefName\":\"layer_1_join_0_index_pattern\",\"type\":\"ES_TERM_SOURCE\"}}]}]",
"mapStateJSON": "{\"zoom\":3.02,\"center\":{\"lon\":77.33426,\"lat\":-0.04647},\"timeFilters\":{\"from\":\"now-17m\",\"to\":\"now\",\"mode\":\"quick\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":1000},\"settings\":{\"autoFitToDataBounds\":false}}",
"title": "join example",
Expand Down

0 comments on commit e0cab80

Please sign in to comment.