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

Consolidate cross-cutting concerns between region & coordinate maps in new maps_legacy plugin #64123

Merged
merged 16 commits into from
Apr 28, 2020

Conversation

kindsun
Copy link
Contributor

@kindsun kindsun commented Apr 21, 2020

Region, coordinate and to some degree Vega Maps have dependencies between each other. This inhibits moving each plugin to NP. This PR consolidates cross-cutting concerns in the new maps_legacy plugin making it easier to move these plugin to NP. This makes more sense now whereas it didn't in the past since there was no common plugin where these shared pieces might live. The following changes were made:

  • BaseMapsVisualization moved to maps_legacy
  • Factory function created for instantiating KibanaMap to reduce code and passing dependencies (such as the Kibana Toast Service) around needlessly
  • Constants moved to maps_legacy. We can re-evaluate if some of these should live in the region and coordinate maps once they're moved over, but for now we need to consolidate them and not be pulling them in from other legacy plugins
  • wms components moved to maps_legacy
  • Consolidate tooltip logic under maps_legacy
  • Remove $injector dependency and shims from from both legacy maps

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@kindsun kindsun marked this pull request as ready for review April 22, 2020 15:07
@kindsun kindsun requested a review from thomasneirynck April 22, 2020 15:07
@kindsun kindsun added the release_note:skip Skip the PR/issue when compiling release notes label Apr 22, 2020
@kindsun
Copy link
Contributor Author

kindsun commented Apr 22, 2020

@elasticmachine merge upstream

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.

overall, +1 on approach, thanks!

I think we're regression again on the license-issue wrt OSS visualizations.

If basic+ is installed, coordinate and region should zoom to larger zoom. It is no longer doing this. It seems like service-settings aren't correctly updated?

e.g. the manifests-call to EMS no longer include the license-key: https://tiles.maps.elastic.co/v7.8/manifest?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=

e.g Coordinate Maps:

image

The behavior in region-maps is slightly different. Here, the map can zoom beyond level 10, but we're not showing tiles.

It seems minZoom and maxZoom are undefined here:

minZoom: options.minZoom,
maxZoom: options.maxZoom,


export function getBaseMapsVis(core: CoreSetup) {
const getKibanaMap = getKibanaMapFactoryProvider(core);
const serviceSettings = new ServiceSettings();
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to make sure the serviceSettings get correctly initialized with min/max zoom/license?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good feedback! We were definitely missing the license here. Since it was a new/different instance of ServiceSettings, maps_legacy_licensing never injected the license in. I've defaulted instead to all plugins working with the same ServiceSettings instance as it was before.

I haven't modified how min/max zoom are set in this PR but that could be related to the above issue you mentioned where tiles aren't appearing past zoom level 10. This issue also exists on master and should be tackled as part of a separate fix. I've captured it here: #64573

@kindsun kindsun force-pushed the np-migrate-common-code-to-maps-legacy branch from 4f988a9 to bddea49 Compare April 27, 2020 13:28
@kindsun kindsun requested a review from thomasneirynck April 27, 2020 20:04
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

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.

+1

@kindsun kindsun merged commit 02cbd9c into elastic:master Apr 28, 2020
@kindsun kindsun deleted the np-migrate-common-code-to-maps-legacy branch April 28, 2020 16:41
kindsun pushed a commit to kindsun/kibana that referenced this pull request Apr 28, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Apr 29, 2020
* master: (60 commits)
  [SIEM] Create template timeline (elastic#63136)
  load react component lazily in so management section (elastic#64285)
  Cleanup .eslingignore and add target (elastic#64617)
  [Ingest] Support yaml variables in datasource (elastic#64459)
  typescript-ify portions of src/optimize (elastic#64688)
  [ngSanitize] add explicit dependencies to all uses of `ngSanitize` angular module (elastic#64546)
  Consolidate downloading plugin bundles to bootstrap script (elastic#64685)
  [Maps] disable edit layer button when flyout is open for add layer or map settings (elastic#64230)
  chore(NA): add async import into infra plugin to reduce apm bundle size (elastic#63292)
  [Maps] fix edit filter (elastic#64586)
  [SIEM][Detections] Adds large list support using REST endpoints
  Replace a number of any-ed styled(eui*) with accurate types (elastic#64555)
  [Endpoint] Recursive resolver children (elastic#61914)
  [ML] Fix new job wizard with multiple indices (elastic#64567)
  Use short URLs for legacy plugin deprecation warning (elastic#64540)
  [Uptime] Update uptime ml job id to limit to 64 char (elastic#64394)
  [Ingest] Fix GET /enrollment-api-keys/null error (elastic#64595)
  Consolidate cross-cutting concerns between region & coordinate maps in new maps_legacy plugin (elastic#64123)
  ES UI new platform cleanup (elastic#64332)
  [Event Log] use @timestamp field for queries (elastic#64391)
  ...
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 30, 2020
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

kindsun pushed a commit that referenced this pull request Apr 30, 2020
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 1, 2020
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:Coordinate Map Feature:NP Migration Feature:Region Map release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants