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] Convert AbstractSource and AbstractLayer to TS #63533

Merged
merged 31 commits into from
Apr 22, 2020

Conversation

thomasneirynck
Copy link
Contributor

Converts source and layer to .ts modules.

This will greatly help navigation in IDEs, and make extending easier.

@thomasneirynck thomasneirynck added 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 14, 2020
@elasticmachine
Copy link
Contributor

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

@thomasneirynck thomasneirynck added the release_note:skip Skip the PR/issue when compiling release notes label Apr 14, 2020
@thomasneirynck thomasneirynck requested a review from a team as a code owner April 15, 2020 18:43
@thomasneirynck thomasneirynck removed the WIP Work in progress label Apr 15, 2020
case HeatmapLayer.type:
return new HeatmapLayer({ layerDescriptor, source });
case BlendedVectorLayer.type:
return new BlendedVectorLayer({ layerDescriptor, source });
return new BlendedVectorLayer({ layerDescriptor, source, joins: [] });
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does BlendedVectorLayer take joins? BlendedVectorLayer does not support joins so this seams like a strange thing to expose in the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

consequence of requiring VectorLayerArguments as param. Can create new param-type

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just make joins optional?

x-pack/plugins/maps/public/layers/sources/source.ts Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/layers/sources/source.ts Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/layers/sources/source.ts Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/layers/styles/abstract_style.ts Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/layers/styles/abstract_style.ts Outdated Show resolved Hide resolved
x-pack/plugins/maps/public/layers/styles/abstract_style.ts Outdated Show resolved Hide resolved
@kindsun
Copy link
Contributor

kindsun commented Apr 16, 2020

Thank you so much for doing all of this! Just left some minor comments

@thomasneirynck
Copy link
Contributor Author

@elasticmachine merge upstream

@thomasneirynck
Copy link
Contributor Author

@elasticmachine merge upstream

@@ -20,6 +20,7 @@ export interface IESSource extends IVectorSource {
limit: number,
initialSearchContext?: object
): Promise<SearchSource>;
loadStylePropsMeta(args: unknown): Promise<unknown>; // todo
Copy link
Contributor

Choose a reason for hiding this comment

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

args are

layerName: string, 
style: VectorStyle, 
dynamicStyleProps: IDynamicStyleProperty[], 
registerCancelCallback: (requestToken: symbol, callback: () => void): void, 
nextMeta: VectorSourceRequestMeta

return type is

RangeFieldMeta | CategoryFieldMeta

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the signature. the return type is actually a raw ES response. Will leave typing of that for another PR, since it bloats scope.

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

@@ -0,0 +1,60 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this file be renamed to style.ts since it contains IStyle

@@ -60,6 +60,7 @@ export class VectorStyle extends AbstractStyle {

constructor(descriptor = {}, source, layer) {
super();
descriptor = descriptor === null ? {} : descriptor;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed since function arguments defaults descriptor to {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a null value doesn't fallback to the default

@thomasneirynck
Copy link
Contributor Author

I'm unable to reproduce these functional test errors locally (https://kibana-ci.elastic.co/job/elastic+kibana+pipeline-pull-request/41853/).

? re-basing with master again ?

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

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.

None yet

5 participants