Skip to content

Commit

Permalink
recreating visAugmenterLoader instead of required plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
  • Loading branch information
amitgalitz committed Mar 21, 2023
1 parent 22b11eb commit 2be90dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/plugins/visualizations/opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "opensearchDashboards",
"server": true,
"ui": true,
"requiredPlugins": ["data", "expressions", "uiActions", "embeddable", "inspector", "dashboard", "visAugmenter"],
"requiredPlugins": ["data", "expressions", "uiActions", "embeddable", "inspector", "dashboard"],
"optionalPlugins": ["usageCollection"],
"requiredBundles": ["opensearchDashboardsUtils", "discover", "savedObjects", "visAugmenter"]
}
14 changes: 10 additions & 4 deletions src/plugins/visualizations/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import './index.scss';

import { VisAugmenterStart } from 'src/plugins/vis_augmenter/public';
import {
PluginInitializerContext,
CoreSetup,
Expand Down Expand Up @@ -94,6 +93,7 @@ import {
} from './saved_visualizations/_saved_vis';
import { createSavedSearchesLoader } from '../../discover/public';
import { DashboardStart } from '../../dashboard/public';
import { createSavedAugmentVisLoader } from '../../vis_augmenter/public';

/**
* Interface for this plugin's returned setup/start contracts.
Expand Down Expand Up @@ -130,7 +130,6 @@ export interface VisualizationsStartDeps {
dashboard: DashboardStart;
getAttributeService: DashboardStart['getAttributeService'];
savedObjectsClient: SavedObjectsClientContract;
visAugmenter: VisAugmenterStart;
}

/**
Expand Down Expand Up @@ -177,7 +176,7 @@ export class VisualizationsPlugin

public start(
core: CoreStart,
{ data, expressions, uiActions, embeddable, dashboard, visAugmenter }: VisualizationsStartDeps
{ data, expressions, uiActions, embeddable, dashboard }: VisualizationsStartDeps
): VisualizationsStart {
const types = this.types.start();
setI18n(core.i18n);
Expand All @@ -196,7 +195,14 @@ export class VisualizationsPlugin
setAggs(data.search.aggs);
setOverlays(core.overlays);
setChrome(core.chrome);
setSavedAugmentVisLoader(visAugmenter.savedAugmentVisLoader);
const savedAugmentVisLoader = createSavedAugmentVisLoader({
savedObjectsClient: core.savedObjects.client,
indexPatterns: data.indexPatterns,
search: data.search,
chrome: core.chrome,
overlays: core.overlays,
});
setSavedAugmentVisLoader(savedAugmentVisLoader);
const savedVisualizationsLoader = createSavedVisLoader({
savedObjectsClient: core.savedObjects.client,
indexPatterns: data.indexPatterns,
Expand Down

0 comments on commit 2be90dc

Please sign in to comment.