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

use savedObjectsClient to get index-patterns #25630

Merged
merged 2 commits into from
Nov 15, 2018
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Nov 14, 2018

fixes #25389

Index patterns were getting loaded via a canvas web service /api/canvas/es_indices. Under the covers, es_indices was quering directly against the kibana elasticsearch index.

This PR removes the es_indices web service and just uses the savedObjectsClient

@nreese nreese added bug Fixes for quality problems that affect the customer experience v7.0.0 Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v6.6.0 v6.5.1 labels Nov 14, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@nreese nreese requested a review from cqliu1 November 14, 2018 01:43
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger spalger added v6.5.1 and removed v6.5.1 labels Nov 14, 2018
Copy link
Contributor

@cqliu1 cqliu1 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

We're also using a canvas web service (/api/canvas/es_fields) to retrieve the fields of a given index. Can we use the savedObjectsClient for getting the fields as well?

It's not a blocker for this PR, but we should make the same change for getFields.

@nreese
Copy link
Contributor Author

nreese commented Nov 15, 2018

We're also using a canvas web service (/api/canvas/es_fields) to retrieve the fields of a given index. Can we use the savedObjectsClient for getting the fields as well?

Not without some extra leg work. Kibana uses the indexPatterns service to get the list of fields for an index-pattern. This service is still coupled with angular.

The GIS application is using this solution to access the index patterns service in react

export let indexPatternService;

uiModules.get('app/gis').run(($injector) => {
  indexPatternService = $injector.get('indexPatterns');
});

Then react code can import the service like this

import { indexPatternService } from '../../../kibana_services';

indexPattern = await indexPatternService.get(indexPatternId);

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v6.5.2 v6.6.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate index patterns shown for esdocs
4 participants