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] Cleanup sources #63175

Merged
merged 28 commits into from
Apr 13, 2020
Merged

Conversation

thomasneirynck
Copy link
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 [Deprecated-Use Team:Presentation]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
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
x-pack/plugins/maps/public/layers/sources/source.d.ts Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/layers/sources/source.d.ts Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/layers/layer.d.ts Outdated Show resolved Hide resolved
type LayerWizard = {
import { ISource } from './sources/source';

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

Choose a reason for hiding this comment

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

Copy link
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
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

Copy link
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
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
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 [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation 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