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

[Region Map] Shim new Platform #40966

Merged
merged 15 commits into from
Jul 26, 2019
Merged

[Region Map] Shim new Platform #40966

merged 15 commits into from
Jul 26, 2019

Conversation

gospodarsky
Copy link

@gospodarsky gospodarsky commented Jul 12, 2019

Summary

First step of migrating to the new Platform

What was done in this PR:

  • Have a new platform-style plugin definition in typescript, with a setup method returning the public contract (see data plugin as an example). This needs to be exported from the top-level /server and/or /public directory, e.g. export foo = new Plugin.setup()
  • Be broken into logical "services", each with a service definition class (see data plugin as an example)
  • Register the visualization via the "visualizations" plugin's types service.
  • Have all static exports done from the top level plugin definition

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@lukeelmers lukeelmers added the [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation label Jul 22, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis

@alexwizp alexwizp changed the title [Region Map] Shim new platform [WIP][Region Map] Shim new platform Jul 23, 2019
@alexwizp alexwizp added the WIP Work in progress label Jul 23, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@alexwizp alexwizp self-assigned this Jul 24, 2019
@alexwizp alexwizp added v7.4.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes and removed WIP Work in progress release_note:enhancement labels Jul 24, 2019
@alexwizp alexwizp changed the title [WIP][Region Map] Shim new platform [Tile Map] Shim new Platform Jul 24, 2019
import { toastNotifications } from 'ui/notify';
import regionMapVisParamsTemplate from './region_map_vis_params.html';
import { mapToLayerWithId } from './util';
import '../../tile_map/public/editors/wms_options';

// TODO: reference to TILE_MAP plugin should be removed
import { ORIGIN } from '../../../../legacy/core_plugins/tile_map/common/origin';
Copy link
Contributor

@alexwizp alexwizp Jul 24, 2019

Choose a reason for hiding this comment

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

@lukeelmers @nreese
In this PR I've marked all places where we do an import from tile_map plugin. Not sure that we need to fix it now because in future we are going to create one common plugin for tile_map and region_map

Copy link
Member

Choose a reason for hiding this comment

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

I agree this is probably outside the scope of this PR.

We could open another PR that exports it (and any other stuff imported from it) from tile_map/public/index if you think it will make it easier to remember later.

But I don't think it's critical to address right now unless @nreese feels otherwise.

@elastic elastic deleted a comment from elasticmachine Jul 24, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

src/legacy/core_plugins/region_map/public/plugin.ts Outdated Show resolved Hide resolved
import { toastNotifications } from 'ui/notify';
import regionMapVisParamsTemplate from './region_map_vis_params.html';
import { mapToLayerWithId } from './util';
import '../../tile_map/public/editors/wms_options';

// TODO: reference to TILE_MAP plugin should be removed
import { ORIGIN } from '../../../../legacy/core_plugins/tile_map/common/origin';
Copy link
Member

Choose a reason for hiding this comment

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

I agree this is probably outside the scope of this PR.

We could open another PR that exports it (and any other stuff imported from it) from tile_map/public/index if you think it will make it easier to remember later.

But I don't think it's critical to address right now unless @nreese feels otherwise.

import { TileMapTooltipFormatter } from './tooltip_formatter';

// TODO: reference to TILE_MAP plugin should be removed
import { BaseMapsVisualizationProvider } from '../../tile_map/public/base_maps_visualization';
Copy link
Member

Choose a reason for hiding this comment

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

This is another thing we could potentially export directly from tile_map/public

Copy link
Contributor

Choose a reason for hiding this comment

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

We could open another PR that exports it (and any other stuff imported from it) from tile_map/public/index if you think it will make it easier to remember later.

Yes, that can be addressed in another PR. Maybe tile map and region map should be in the same plugin if region map needs a bunch of stuff from tile map but that can be considered in another PR as well

Copy link
Member

Choose a reason for hiding this comment

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

@nreese @thomasneirynck Yeah our idea in the new platform migration plans was to have a single vis_type_maps plugin that could register both of the maps visualizations since they are sharing some code. But y'all would probably be better judges of the feasibility of that. In the interim we can just keep them shimmed separately like this.

@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.

thx @Avinar-24

I tested this and looks good to me, but not comfortable enough to speak to the actual changes wrt new platform.

setupDOM('512px', '512px');

imageComparator = new ImageComparator();
vis = new Vis(indexPattern, {
type: 'region_map'
type: 'tile_map'
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing. This was nasty. This just used to work because it was using the vis-object only for the configuration params when calling new CoordinateMapsVisualization(domNode, vis).

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

LGTM in terms of new platform prep!

Edit: let's wait for a final approval from @thomasneirynck or @nreese though

import { TileMapTooltipFormatter } from './tooltip_formatter';

// TODO: reference to TILE_MAP plugin should be removed
import { BaseMapsVisualizationProvider } from '../../tile_map/public/base_maps_visualization';
Copy link
Member

Choose a reason for hiding this comment

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

@nreese @thomasneirynck Yeah our idea in the new platform migration plans was to have a single vis_type_maps plugin that could register both of the maps visualizations since they are sharing some code. But y'all would probably be better judges of the feasibility of that. In the interim we can just keep them shimmed separately like this.

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.

lgtm

@lukeelmers @Avinar-24 I like the idea of single plugin registering both region and coordinate map visualizations. +1 on separate PR for that.

@alexwizp alexwizp merged commit f84f07b into elastic:master Jul 26, 2019
alexwizp pushed a commit to alexwizp/kibana that referenced this pull request Jul 26, 2019
* Migrate Region Map to New Platform

* Replace Vis Factory

* fix plugin name - work in progress

* code cleanup

* fix tests for tile_map

* fix PR comments

* fix PR comments
alexwizp added a commit that referenced this pull request Jul 26, 2019
* Migrate Region Map to New Platform

* Replace Vis Factory

* fix plugin name - work in progress

* code cleanup

* fix tests for tile_map

* fix PR comments

* fix PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation Feature:NP Migration Feature:Region Map release_note:skip Skip the PR/issue when compiling release notes v7.4.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants