Skip to content

[Maps] Cleanup sources#63175

Merged
thomasneirynck merged 28 commits intoelastic:masterfrom
thomasneirynck:maps/ts_sources
Apr 13, 2020
Merged

[Maps] Cleanup sources#63175
thomasneirynck merged 28 commits intoelastic:masterfrom
thomasneirynck:maps/ts_sources

Conversation

@thomasneirynck
Copy link
Copy Markdown
Contributor

@thomasneirynck thomasneirynck commented Apr 9, 2020

The introduction of a new source-type in #62084 is is revealing a lot of dangling TS issues with sources and layers.

  • This PR intends to clearup some of the gaps in TS.
  • It also organizes the source-modules per source in a single directory to improve readability
  • converts the xyz_tms_source to typescript as a POC

@thomasneirynck thomasneirynck added discuss chore WIP Work in progress Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 v7.8.0 labels Apr 9, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@thomasneirynck thomasneirynck requested a review from a team as a code owner April 9, 2020 22:02
@thomasneirynck thomasneirynck added the release_note:skip Skip the PR/issue when compiling release notes label Apr 9, 2020
@thomasneirynck thomasneirynck requested review from kindsun and nreese April 9, 2020 22:03
type LayerWizard = {
import { ISource } from './sources/source';

export type PreviewSourceHandler = (source: ISource) => void;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if null is passed in explicitly, probably should make that explicit for now iso making it optional

export type PreviewSourceHandler = (source: ISource | null) => void;

@thomasneirynck thomasneirynck removed WIP Work in progress discuss labels Apr 12, 2020
@thomasneirynck thomasneirynck requested a review from nreese April 12, 2020 03:44
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

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

Copy link
Copy Markdown
Contributor

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


destroy(): void;
createDefaultLayer(): ILayer;
createDefaultLayer(options?: LayerDescriptor, mapColors?: string[]): ILayer;
Copy link
Copy Markdown
Contributor

@nreese nreese Apr 13, 2020

Choose a reason for hiding this comment

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

Should options also be Partial<LayerDescriptor> here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. Fwiw, I'd leave it for now. In the code, it's either omitted, or preceded by a Layer.createDescriptor call, which does the normalization.

@thomasneirynck thomasneirynck merged commit bbd501e into elastic:master Apr 13, 2020
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Apr 13, 2020
- Introduces additional TS typing for sources
- Organizes sources in sub-directories by type
- migrates XYZTMSSource to TS
thomasneirynck added a commit that referenced this pull request Apr 13, 2020
- Introduces additional TS typing for sources
- Organizes sources in sub-directories by type
- migrates XYZTMSSource to TS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants