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] Map embeddable #31473

Merged
merged 30 commits into from
Mar 1, 2019
Merged

[Maps] Map embeddable #31473

merged 30 commits into from
Mar 1, 2019

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Feb 19, 2019

This PR registers mapEmbeddableFactoryProvider with EmbeddableFactoriesRegistryProvider allowing maps to be embedded any where embeddables are supported

Since there is no way to add map embeddables to a dashboard through the UI, testing is a little difficult. The best way is to run the functional tests and stop them once the ES archives have been loaded. Then open the dashboard "map embeddable example" and manually experiment with that dashboard.

screen shot 2019-02-26 at 11 29 58 am

@elasticmachine
Copy link
Contributor

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@nreese
Copy link
Contributor Author

nreese commented Feb 19, 2019

jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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 is real cool. Seeing the filters applied 🤤

Mostly cosmetic feedback.

There seems to be a bug, and we should fix this here.

window resizing doesn't 100% work

To reproduce:

  • open a dashboard, make sure the browser window only takes about half your screen
  • maximize the browser window
    --> the widgets on the dashboards stretch, but the mapbox-map stays in it's original size

image

x-pack/plugins/maps/public/embeddable/map_embeddable.js Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/embeddable/map_embeddable.js Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/embeddable/map_embeddable.js Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/embeddable/map_embeddable.js Outdated Show resolved Hide resolved
* @param {HTMLElement} domNode
* @param {ContainerState} containerState
*/
render(domNode, containerState) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if we should monitor this domNode for a resize (see other comment).

@nreese
Copy link
Contributor Author

nreese commented Mar 1, 2019

@thomasneirynck The resize bug is resolved now.

if (lastWidth === window.innerWidth
&& lastHeight === window.innerHeight && this._mbMap) {
this._mbMap.resize();
this._checker.on('resize', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, this is more clean too.

I don't think we need to wrap this in an animation-frame callback. It assumes we'd get resize events at a rate exceeding 60fps, and that mapbox would not be optimizing for map.resize() method calls internally. It'd suprise me if both were true. I think we should be fine just calling resize on each event.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thomasneirynck I have removed the animation frame. Looks like EUI has a ResizeObserver that we could use instead of ui/public/resize_checker. The problem is that ResizeObserver was only added in EUI 7.2.0 and Kibana is currently on EUI 7.1.0. I will make a separate PR to clean this up more and replace resize_checker (which is based on angular) with ResizeObserver once Kibana EUI has been upgraded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or, I can just revert the changes to this file and the resize issue can be completely addressed in a separate PR since resize_checker is going to be replaced anyways.

Copy link
Contributor

Choose a reason for hiding this comment

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

it's good to fix it here imho

OK with new PR where we migrate to eui's ResizeObserver later

Copy link
Contributor

Choose a reason for hiding this comment

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

There was some reason we needed this previously but I'm comfortable with getting rid of it and letting it re-emerge if necessary. Really might not be needed anymore.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@thomasneirynck thomasneirynck self-requested a review March 1, 2019 16:48
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.

🔨 tested in chrome

Copy link
Contributor

@kindsun kindsun left a comment

Choose a reason for hiding this comment

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

Tested in chromium (via tests technique suggested) and code review. Overall, a really neat feature. Nice work! lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants