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

Move response/request and editor handler registration to uiExports #12766

Merged
merged 2 commits into from
Jul 13, 2017

Conversation

stacey-gammon
Copy link
Contributor

No description provided.

…stryProvider appropriately

A bit of a tacky solution but once embeddable handlers PR is checked
in, I can move this visualize specific code over to the visualize
embeddable handler and pull it out of dashboard.
Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

Full screen mode works fine for me, but maybe I'm missing something?

@stacey-gammon stacey-gammon changed the title Directly import visualize file to ensure VisRequestHandlersRegistry is filled Move response/request and editor handler registration to uiExports Jul 11, 2017
@stacey-gammon
Copy link
Contributor Author

Updated based on feedback from @spalger, doing this the right way, so no plugins have to reach into another plugin to import code manually.

This has the potential to break other plugins, though we tried to sift through all of them to ensure no other areas required the new additions to the uses clause.

cc machine learning (@sophiec20)

@tsullivan
Copy link
Member

I don't spot any issues with the code, but it's hard to know what I'm checking for here. Even though I can see the issue that has a reference to this PR, it would be nice to give some description on how to test this.

@spalger
Copy link
Contributor

spalger commented Jul 12, 2017

@tsullivan the only way to test it really is to try and use the editors/visualizations. When things build and the tests pass it's working.

Copy link
Member

@pickypg pickypg left a comment

Choose a reason for hiding this comment

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

LGTM

@pickypg
Copy link
Member

pickypg commented Jul 12, 2017

By the way, I'm assuming this fixes the UI Settings Service issue where it dies because the internal savedObjectsClient is null / undefined.

TypeError: Cannot read property 'get' of undefined
 proc  [kibana]     at /var/lib/jenkins/workspace/.../kibana/src/ui/ui_settings/ui_settings_service.js:117:26
 proc  [kibana]     at undefined.next (native)
 proc  [kibana]     at step (/var/lib/jenkins/workspace/.../kibana/src/ui/ui_settings/ui_settings_service.js:2:1)
 proc  [kibana]     at /var/lib/jenkins/workspace/.../kibana/src/ui/ui_settings/ui_settings_service.js:2:1

@pickypg
Copy link
Member

pickypg commented Jul 12, 2017

And I was able to test this branch with the change that was causing that issue and it does indeed fix it! Woohoo. Doubly LGTM.

import _ from 'lodash';
import angular from 'angular';
import defaultEditorTemplate from './default.html';

import { VisEditorTypesRegistryProvider } from 'ui/registry/vis_editor_types';

Copy link
Member

Choose a reason for hiding this comment

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

this might be problematic ....
right now someone might import the default editor (or any of the other things registered) into his code, which will register a duplicate with registryProvider ? (not sure does registryProvider allow duplicates ? what will happen in that case?) should either check for this scenario, or not export anything (so importing of this module is not possible, it should only be accessed thru registry

Copy link
Contributor

Choose a reason for hiding this comment

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

Importing the module won't cause the code to execute twice. As long as the register call is only in one place it will be fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Either way, there shouldn't be any reason to import the default editor, ideally consumers will only import the editors register and depend on all editors so that they can be pluggable. If consumers import a specific editor they aren't pluggable.

Copy link
Member

Choose a reason for hiding this comment

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

same is true for requestHandlers and responseHandlers

@spalger
Copy link
Contributor

spalger commented Jul 13, 2017

LGTM

@epixa epixa merged commit 18c9ea4 into elastic:master Jul 13, 2017
@epixa
Copy link
Contributor

epixa commented Jul 13, 2017

@stacey-gammon I didn't backport this because it wasn't labeled as such. Let me know if I should

@stacey-gammon stacey-gammon deleted the fill-vistypes-registry branch October 24, 2017 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants