Skip to content

Conversation

@nreese
Copy link
Contributor

@nreese nreese commented Feb 19, 2019

This PR updates EmbeddableMetadata to allow an embeddable to support multiple index patterns. The Maps application is working on a new Embeddable implementation. A map embeddable could include 0 to many index patterns

@nreese nreese added Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.0.0 v7.2.0 labels Feb 19, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@nreese nreese requested a review from lukasolson February 19, 2019 22:55
@nreese nreese mentioned this pull request Feb 19, 2019
8 tasks
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

if (indexPattern) {
this.panelIndexPatternMapping[panelId] = indexPattern;
const embeddableMetadata = getEmbeddableMetadata(store.getState(), panelId);
if (embeddableMetadata.indexPatterns) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could getEmbeddableMetadata return null (even though this wasn't handled in the previous version)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elasticmachine
Copy link
Contributor

💔 Build Failed

@nreese
Copy link
Contributor Author

nreese commented Feb 20, 2019

@lizozom Looks like TS linter does not like _.compact. Any ideas how to resolve? If not, then I will just use indexPattern ? [indexPattern] : []

ERROR kibana failed
16:50:35       src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.ts:73:36 - error TS2345: Argument of type '{ onEmbeddableStateChanged: OnEmbeddableStateChanged; savedVisualization: VisSavedObject; editUrl: string; loader: VisualizeLoader; indexPatterns: (StaticIndexPattern | undefined)[]; }' is not assignable to parameter of type 'VisualizeEmbeddableConfiguration'.
16:50:35         Types of property 'indexPatterns' are incompatible.
16:50:35           Type '(StaticIndexPattern | undefined)[]' is not assignable to type 'StaticIndexPattern[]'.
16:50:35             Type 'StaticIndexPattern | undefined' is not assignable to type 'StaticIndexPattern'.
16:50:35               Type 'undefined' is not assignable to type 'StaticIndexPattern'.
16:50:35 
16:50:35        73     return new VisualizeEmbeddable({
16:50:35                                              ~
16:50:35        74       onEmbeddableStateChanged,
16:50:35           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:50:35       ... 
16:50:35        78       indexPatterns,
16:50:35           ~~~~~~~~~~~~~~~~~~~~
16:50:35        79     });
16:50:35           ~~~~~

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese nreese merged commit 7192689 into elastic:master Feb 22, 2019
nreese added a commit to nreese/kibana that referenced this pull request Feb 22, 2019
…ic#31538)

* Update embeddables metadata to support multiple index patterns

* ts lint errors

* another try at ts lint errors

* fix dashboard_state tests

* use lodash compact to remove undefined

* revert _.compact to make TS linter happy

* rename simulateNewEmbeddableWithIndexPattern => simulateNewEmbeddableWithIndexPatterns
nreese added a commit that referenced this pull request Feb 22, 2019
… (#31820)

* Update embeddables metadata to support multiple index patterns

* ts lint errors

* another try at ts lint errors

* fix dashboard_state tests

* use lodash compact to remove undefined

* revert _.compact to make TS linter happy

* rename simulateNewEmbeddableWithIndexPattern => simulateNewEmbeddableWithIndexPatterns
@timroes timroes added the release_note:skip Skip the PR/issue when compiling release notes label Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.2.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants