-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Combine visualizations and visualize plugins #121550
Combine visualizations and visualize plugins #121550
Conversation
@@ -20,7 +20,7 @@ const mockServices = { | |||
}, | |||
}), | |||
capabilities: { | |||
visualize: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK capabilities are not coupled to the plugin id - I would like to keep it as visualize
if possible, I think this will cause a bunch of downstream problems.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@@ -124,7 +124,7 @@ export const applicationUsageSchema = { | |||
kibana: commonSchema, // It's a forward app so we'll likely never report it | |||
management: commonSchema, | |||
short_url_redirect: commonSchema, // It's a forward app so we'll likely never report it | |||
visualize: commonSchema, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s not change telemetry keys - the application we are tracking here is still “visualize”, everything else will cause problems
@@ -51,7 +51,7 @@ export const readOnlyUserRole: RoleType = { | |||
ml: ['read'], | |||
maps: ['read'], | |||
graph: ['read'], | |||
visualize: ['read'], | |||
visualizations: ['read'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
References the permission which is still “visualize”
@@ -140,7 +140,7 @@ export interface UsageData extends UsageStats { | |||
dev_tools?: number; | |||
advancedSettings?: number; | |||
infrastructure?: number; | |||
visualize?: number; | |||
visualizations?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
References the permission which is still “visualize “
@@ -285,7 +285,7 @@ export function getSpacesUsageCollector( | |||
description: 'The number of spaces which have this feature disabled.', | |||
}, | |||
}, | |||
visualize: { | |||
visualizations: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -7655,7 +7655,7 @@ | |||
"description": "The number of spaces which have this feature disabled." | |||
} | |||
}, | |||
"visualize": { | |||
"visualizations": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
public setup(core: CoreSetup) { | ||
this.logger.debug('visualize: Setup'); | ||
|
||
core.capabilities.registerProvider(capabilitiesProvider); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we don't need to register visualize capabilities
in visualizations
plugin?
@@ -66,3 +67,6 @@ export const [getOverlays, setOverlays] = createGetterSetter<OverlayStart>('Over | |||
export const [getChrome, setChrome] = createGetterSetter<ChromeStart>('Chrome'); | |||
|
|||
export const [getSpaces, setSpaces] = createGetterSetter<SpacesPluginStart>('Spaces', false); | |||
|
|||
export const [getVisEditorsRegistry, setVisEditorsRegistry] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that we need to add one more getterSetter
for that case. I've checked all places where we use it and looks like you can just add this service into
src/plugins/visualizations/public/plugin.ts
const services: VisualizeServices = {
Could you please check that?
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super small Presentation team changes LGTM!
It'll be a lot simpler and less confusing to have these two plugins combined into one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diana well done, it seems to work fine.
One proposal I have for easier navigation into the plugin is to rename the visualizations-->application
folder to `visualizations-->visualize_app' or a name that describes what this folder contains (actually the listing code and the visualize editor wrapper)
@@ -12,7 +12,8 @@ | |||
"references": [ | |||
{ "path": "../../core/tsconfig.json" }, | |||
{ "path": "../data/tsconfig.json" }, | |||
{ "path": "../visualize/tsconfig.json" }, | |||
{ "path": "../visualizations/tsconfig.json" }, | |||
{ "path": "../discover/tsconfig.json" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have we added the discover dependency here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -18,7 +18,7 @@ | |||
{ "path": "../../data/tsconfig.json" }, | |||
{ "path": "../../expressions/tsconfig.json" }, | |||
{ "path": "../../visualizations/tsconfig.json" }, | |||
{ "path": "../../visualize/tsconfig.json" }, | |||
{ "path": "../../dashboard/tsconfig.json" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding the dashboard dependency here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const STATE_STORAGE_KEY = '_a'; | ||
export const GLOBAL_STATE_STORAGE_KEY = '_g'; | ||
|
||
export const APP_NAME = 'visualize'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this constant to VISUALIZE_APP_NAME
as the current app is called visualizations and it can be confusing.
@@ -93,3 +113,30 @@ export interface VisEditorOptionsProps<VisParamType = unknown> { | |||
setValidity(isValid: boolean): void; | |||
setTouched(isTouched: boolean): void; | |||
} | |||
|
|||
export interface VisualizationServices extends CoreStart { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it used anywhere? We already have the VisualizeServices
on the application/types so it seems unnecessary. I would remove this type and move the VisualizeServices
to this file and export it from here as it is not used only from the application folder but it is used in many places of this plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's actually unnecessary, thanks for noticing!
…applicaion folder to visualize_app and APP_NAME to VISUALIZE_APP_NAME, revert types.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking mostly good to me, just two small things
src/plugins/visualizations/public/visualize_app/utils/get_top_nav_config.tsx
Show resolved
Hide resolved
@@ -372,18 +378,21 @@ export const getTopNavConfig = ( | |||
? [ | |||
{ | |||
id: 'save', | |||
iconType: showSaveAndReturn ? undefined : 'save', | |||
iconType: originatingApp ? undefined : 'save', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - old showSaveAndReturn
included the check of the savedvis id which is omitted here
description: i18n.translate('visualize.topNavMenu.saveVisualizationButtonAriaLabel', { | ||
defaultMessage: 'Save Visualization', | ||
}), | ||
emphasize: !originatingApp, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -2,7 +2,7 @@ | |||
"id": "visDefaultEditor", | |||
"version": "kibana", | |||
"ui": true, | |||
"optionalPlugins": ["visualize"], | |||
"optionalPlugins": ["visualizations"], | |||
"requiredBundles": ["kibanaUtils", "kibanaReact", "data", "fieldFormats", "discover", "esUiShared"], | |||
"owner": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the description from the other kibana.json
here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nvm, I get it now - just checking for originatingApp is right. No objections, lgtm, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanx for applying my suggestions Diana! LGTM!
# Conflicts: # .i18nrc.json
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Closes #113737
Summary
Merged
visualize
intovisualizations
plugin.Removed
dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables
flag to avoid circular dependencies between visualizations and dashboard;Code from visualize public plugin was added to visualizations public plugin with minor services changes:
dashboard
was removed because of circular dependency;visualizations
was removed as all required code was used directly from visualizations;visEditorsRegistry
was added to get rid of its getter and setter and pass it through as other services.Following code from visualizations previously was used only in visualize services, so it was imported directly and removed from
VisualizationsStart
createVis
-> importedcreateVisAsync
from vis_asyncconvertToSerializedVis
-> imported from saved_visualize_utilsconvertFromSerializedVis
-> imported from saved_visualize_utilsgetSavedVisualization
-> imported from saved_visualize_utilssaveVisualization
-> imported from saved_visualize_utilsfindListItems
-> imported from saved_visualize_utils__LEGACY.createVisEmbeddableFromObject
-> imported from create_vis_embeddable_from_objectCode from visualize server plugin was added to visualizations server plugin without any changes;
Changes related to kibana.json:
visualize
kibana.json were moved tovisualizations
kibana.json;vis_default_editor
kibana.json visualize optional plugin was replaced with visualizations;timeseries
kibana.json visualize was removed as it already has visualizations dependency;Updated tests and translations keys.
Checklist
For maintainers