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 embeddable] fix map layers disappear from map panel when using session storage to continue editing a dashboard #193629

Merged
merged 7 commits into from
Sep 23, 2024

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Sep 20, 2024

Closes #190468 and #193601

Dashboard unsaved changes for a panel are obtained from the embeddable comparator subject for each comparator. If comparator subject does not return a value, then this information is lost when returning to a dashboard with unsaved changes. This is why layers and filters where disappearing from a map when returning to a dashboard with unsaved changes. This PR resolves this issue by providing comparator subjects and setters for savedObjectId, attributes, and mapSettings.

PR also resolves issue of passing props from MapRenderer component into map embeddable. Instead of passing props via state, props should be passed from MapRenderer parent api.

…session storage to continue editing a dashboard
@nreese
Copy link
Contributor Author

nreese commented Sep 20, 2024

/ci

@nreese
Copy link
Contributor Author

nreese commented Sep 20, 2024

/ci

@nreese
Copy link
Contributor Author

nreese commented Sep 20, 2024

/ci

@nreese
Copy link
Contributor Author

nreese commented Sep 23, 2024

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Sep 23, 2024

/ci

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
maps 1236 1237 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 3.0MB 3.0MB +770.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
maps 28 27 -1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese marked this pull request as ready for review September 23, 2024 17:40
@nreese nreese requested a review from a team as a code owner September 23, 2024 17:40
@nreese nreese added release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Feature:Maps labels Sep 23, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nreese nreese added the backport:version Backport to applied version labels label Sep 23, 2024
@nickpeihl nickpeihl self-requested a review September 23, 2024 19:21
Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

code review and tested map layers and map filters are restored from session storage.

@@ -9,7 +9,7 @@ import type { LayerDescriptor } from '../../common/descriptor_types';
import type { CreateLayerDescriptorParams } from '../classes/sources/es_search_source';
import type { SampleValuesConfig, EMSTermJoinConfig } from '../ems_autosuggest';
import type { Props as PassiveMapProps } from '../lens/passive_map';
import type { Props as MapProps } from '../react_embeddable/map_renderer';
import type { Props as MapProps } from '../react_embeddable/map_renderer/map_renderer';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit, exporting from an index.ts file in the map_renderer directory would make these imports appear less duplicative. but I'm fine either way.

@nreese nreese merged commit a8ebc7f into elastic:main Sep 23, 2024
27 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 23, 2024
…session storage to continue editing a dashboard (elastic#193629)

Closes elastic#190468 and
elastic#193601

Dashboard unsaved changes for a panel are obtained from the embeddable
comparator subject for each comparator. If comparator subject does not
return a value, then this information is lost when returning to a
dashboard with unsaved changes. This is why layers and filters where
disappearing from a map when returning to a dashboard with unsaved
changes. This PR resolves this issue by providing comparator subjects
and setters for `savedObjectId`, `attributes`, and `mapSettings`.

PR also resolves issue of passing props from `MapRenderer` component
into map embeddable. Instead of passing props via state, props should be
passed from `MapRenderer` parent api.

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit a8ebc7f)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 23, 2024
…session storage to continue editing a dashboard (elastic#193629)

Closes elastic#190468 and
elastic#193601

Dashboard unsaved changes for a panel are obtained from the embeddable
comparator subject for each comparator. If comparator subject does not
return a value, then this information is lost when returning to a
dashboard with unsaved changes. This is why layers and filters where
disappearing from a map when returning to a dashboard with unsaved
changes. This PR resolves this issue by providing comparator subjects
and setters for `savedObjectId`, `attributes`, and `mapSettings`.

PR also resolves issue of passing props from `MapRenderer` component
into map embeddable. Instead of passing props via state, props should be
passed from `MapRenderer` parent api.

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit a8ebc7f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 23, 2024
…using session storage to continue editing a dashboard (#193629) (#193797)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[maps embeddable] fix map layers disappear from map panel when using
session storage to continue editing a dashboard
(#193629)](#193629)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-23T20:58:09Z","message":"[maps
embeddable] fix map layers disappear from map panel when using session
storage to continue editing a dashboard (#193629)\n\nCloses
#190468
and\r\nhttps://github.com//issues/193601\r\n\r\nDashboard
unsaved changes for a panel are obtained from the
embeddable\r\ncomparator subject for each comparator. If comparator
subject does not\r\nreturn a value, then this information is lost when
returning to a\r\ndashboard with unsaved changes. This is why layers and
filters where\r\ndisappearing from a map when returning to a dashboard
with unsaved\r\nchanges. This PR resolves this issue by providing
comparator subjects\r\nand setters for `savedObjectId`, `attributes`,
and `mapSettings`.\r\n\r\nPR also resolves issue of passing props from
`MapRenderer` component\r\ninto map embeddable. Instead of passing props
via state, props should be\r\npassed from `MapRenderer` parent
api.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"a8ebc7f4686e359e9893e7e6fed291711c38dad4","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","v9.0.0","Feature:Maps","v8.16.0","backport:version","v8.15.3"],"title":"[maps
embeddable] fix map layers disappear from map panel when using session
storage to continue editing a
dashboard","number":193629,"url":"https://github.com/elastic/kibana/pull/193629","mergeCommit":{"message":"[maps
embeddable] fix map layers disappear from map panel when using session
storage to continue editing a dashboard (#193629)\n\nCloses
#190468
and\r\nhttps://github.com//issues/193601\r\n\r\nDashboard
unsaved changes for a panel are obtained from the
embeddable\r\ncomparator subject for each comparator. If comparator
subject does not\r\nreturn a value, then this information is lost when
returning to a\r\ndashboard with unsaved changes. This is why layers and
filters where\r\ndisappearing from a map when returning to a dashboard
with unsaved\r\nchanges. This PR resolves this issue by providing
comparator subjects\r\nand setters for `savedObjectId`, `attributes`,
and `mapSettings`.\r\n\r\nPR also resolves issue of passing props from
`MapRenderer` component\r\ninto map embeddable. Instead of passing props
via state, props should be\r\npassed from `MapRenderer` parent
api.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"a8ebc7f4686e359e9893e7e6fed291711c38dad4"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193629","number":193629,"mergeCommit":{"message":"[maps
embeddable] fix map layers disappear from map panel when using session
storage to continue editing a dashboard (#193629)\n\nCloses
#190468
and\r\nhttps://github.com//issues/193601\r\n\r\nDashboard
unsaved changes for a panel are obtained from the
embeddable\r\ncomparator subject for each comparator. If comparator
subject does not\r\nreturn a value, then this information is lost when
returning to a\r\ndashboard with unsaved changes. This is why layers and
filters where\r\ndisappearing from a map when returning to a dashboard
with unsaved\r\nchanges. This PR resolves this issue by providing
comparator subjects\r\nand setters for `savedObjectId`, `attributes`,
and `mapSettings`.\r\n\r\nPR also resolves issue of passing props from
`MapRenderer` component\r\ninto map embeddable. Instead of passing props
via state, props should be\r\npassed from `MapRenderer` parent
api.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"a8ebc7f4686e359e9893e7e6fed291711c38dad4"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <[email protected]>
kibanamachine added a commit that referenced this pull request Sep 23, 2024
… using session storage to continue editing a dashboard (#193629) (#193796)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[maps embeddable] fix map layers disappear from map panel when using
session storage to continue editing a dashboard
(#193629)](#193629)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-23T20:58:09Z","message":"[maps
embeddable] fix map layers disappear from map panel when using session
storage to continue editing a dashboard (#193629)\n\nCloses
#190468
and\r\nhttps://github.com//issues/193601\r\n\r\nDashboard
unsaved changes for a panel are obtained from the
embeddable\r\ncomparator subject for each comparator. If comparator
subject does not\r\nreturn a value, then this information is lost when
returning to a\r\ndashboard with unsaved changes. This is why layers and
filters where\r\ndisappearing from a map when returning to a dashboard
with unsaved\r\nchanges. This PR resolves this issue by providing
comparator subjects\r\nand setters for `savedObjectId`, `attributes`,
and `mapSettings`.\r\n\r\nPR also resolves issue of passing props from
`MapRenderer` component\r\ninto map embeddable. Instead of passing props
via state, props should be\r\npassed from `MapRenderer` parent
api.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"a8ebc7f4686e359e9893e7e6fed291711c38dad4","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","v9.0.0","Feature:Maps","v8.16.0","backport:version","v8.15.3"],"title":"[maps
embeddable] fix map layers disappear from map panel when using session
storage to continue editing a
dashboard","number":193629,"url":"https://github.com/elastic/kibana/pull/193629","mergeCommit":{"message":"[maps
embeddable] fix map layers disappear from map panel when using session
storage to continue editing a dashboard (#193629)\n\nCloses
#190468
and\r\nhttps://github.com//issues/193601\r\n\r\nDashboard
unsaved changes for a panel are obtained from the
embeddable\r\ncomparator subject for each comparator. If comparator
subject does not\r\nreturn a value, then this information is lost when
returning to a\r\ndashboard with unsaved changes. This is why layers and
filters where\r\ndisappearing from a map when returning to a dashboard
with unsaved\r\nchanges. This PR resolves this issue by providing
comparator subjects\r\nand setters for `savedObjectId`, `attributes`,
and `mapSettings`.\r\n\r\nPR also resolves issue of passing props from
`MapRenderer` component\r\ninto map embeddable. Instead of passing props
via state, props should be\r\npassed from `MapRenderer` parent
api.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"a8ebc7f4686e359e9893e7e6fed291711c38dad4"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193629","number":193629,"mergeCommit":{"message":"[maps
embeddable] fix map layers disappear from map panel when using session
storage to continue editing a dashboard (#193629)\n\nCloses
#190468
and\r\nhttps://github.com//issues/193601\r\n\r\nDashboard
unsaved changes for a panel are obtained from the
embeddable\r\ncomparator subject for each comparator. If comparator
subject does not\r\nreturn a value, then this information is lost when
returning to a\r\ndashboard with unsaved changes. This is why layers and
filters where\r\ndisappearing from a map when returning to a dashboard
with unsaved\r\nchanges. This PR resolves this issue by providing
comparator subjects\r\nand setters for `savedObjectId`, `attributes`,
and `mapSettings`.\r\n\r\nPR also resolves issue of passing props from
`MapRenderer` component\r\ninto map embeddable. Instead of passing props
via state, props should be\r\npassed from `MapRenderer` parent
api.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"a8ebc7f4686e359e9893e7e6fed291711c38dad4"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Maps release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.15.2 v8.15.3 v8.16.0 v9.0.0
Projects
None yet
5 participants