Skip to content

Conversation

@nreese
Copy link
Contributor

@nreese nreese commented Feb 13, 2019

This PR prepares the inspectorAdapters for embeddables.

inspectorAdapters can not be a singleton because there could be multiple map instances in a Dashboard. Each embedded map instance must have its own inspectorAdapters instance.

The PR puts inspectorAdapters in the store so its accessible by all connected components. Redux just uses react Context under the covers to pass state to connected components. Context allows non serializable objects. Using the store was a simpler solution then adding another Context wrapper around GisMap. I isolated the non serializable redux state in its own tree to minimize the location of non serializable state to a single location.

return false;
}

destroy() {
Copy link
Contributor Author

@nreese nreese Feb 13, 2019

Choose a reason for hiding this comment

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

duplicate implementation of AbstractESSource.destroy not needed

@nreese nreese added v8.0.0 v7.2.0 Team:Geo Former Team Label for Geo Team. Now use Team:Presentation labels Feb 13, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis

@elasticmachine
Copy link
Contributor

💔 Build Failed

@nreese nreese mentioned this pull request Feb 14, 2019
8 tasks
Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

This PR looks bigger than it really is. Tested in chrome, works good.

Thanks!


getInspectorAdapters() {
return this._inspectorAdapters;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

So we need to introduce this method? Could a layer-instance keep a reference to the _inspectorAdapters.

I'd add this._inspectorAdapters = inspectorAdapters to the AbstractLayer constructor, which takes a second argument, just like AbstractSource

Not 100% sure, but I wouldn't expand the interface of sources, just so we can pull a reference to the inspectoradapter back up in the layers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Summing up our chat, I am going to leave as is since Layer does not need access to inspectorAdapters except in one isolated condition - when the VectorLayer creates LeftInnerJoin. In this case, VectorLayer never uses inspectorAdapters, it just needs access to inspectorAdapters to pass to the LeftInnerJoin constructor.

Adding inspectorAdapters to Layer constructor would spider web out since layers are created all over the place

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese nreese merged commit 98fdd1a into elastic:master Feb 15, 2019
nreese added a commit to nreese/kibana that referenced this pull request Feb 15, 2019
…pter instance (elastic#31009)

* [Maps] replace singleton inspectorAdapters with per map inspector adapter instance

* pass inspectorAdapters to all source constructors in renderEditor

* rename non_serializable_kibana_instances to non_serializable_instances, fix test jest test broken by import
nreese added a commit that referenced this pull request Feb 15, 2019
…pter instance (#31009) (#31281)

* [Maps] replace singleton inspectorAdapters with per map inspector adapter instance

* pass inspectorAdapters to all source constructors in renderEditor

* rename non_serializable_kibana_instances to non_serializable_instances, fix test jest test broken by import
@nreese nreese added the release_note:skip Skip the PR/issue when compiling release notes label Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.2.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants