From 22b11eb83e0893b5a808709126646a8e52d0da6c Mon Sep 17 00:00:00 2001 From: Amit Galitzky Date: Wed, 15 Mar 2023 20:19:11 -0700 Subject: [PATCH 1/3] setting augmented viz loader and importing as plugin Signed-off-by: Amit Galitzky --- src/plugins/visualizations/opensearch_dashboards.json | 2 +- src/plugins/visualizations/public/plugin.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/visualizations/opensearch_dashboards.json b/src/plugins/visualizations/opensearch_dashboards.json index b7c5e4ab9b4e..b9871161accc 100644 --- a/src/plugins/visualizations/opensearch_dashboards.json +++ b/src/plugins/visualizations/opensearch_dashboards.json @@ -3,7 +3,7 @@ "version": "opensearchDashboards", "server": true, "ui": true, - "requiredPlugins": ["data", "expressions", "uiActions", "embeddable", "inspector", "dashboard"], + "requiredPlugins": ["data", "expressions", "uiActions", "embeddable", "inspector", "dashboard", "visAugmenter"], "optionalPlugins": ["usageCollection"], "requiredBundles": ["opensearchDashboardsUtils", "discover", "savedObjects", "visAugmenter"] } diff --git a/src/plugins/visualizations/public/plugin.ts b/src/plugins/visualizations/public/plugin.ts index 682e678ed584..64e7dfe1d654 100644 --- a/src/plugins/visualizations/public/plugin.ts +++ b/src/plugins/visualizations/public/plugin.ts @@ -30,6 +30,7 @@ import './index.scss'; +import { VisAugmenterStart } from 'src/plugins/vis_augmenter/public'; import { PluginInitializerContext, CoreSetup, @@ -60,6 +61,7 @@ import { setOverlays, setSavedSearchLoader, setEmbeddable, + setSavedAugmentVisLoader, } from './services'; import { VISUALIZE_EMBEDDABLE_TYPE, @@ -128,6 +130,7 @@ export interface VisualizationsStartDeps { dashboard: DashboardStart; getAttributeService: DashboardStart['getAttributeService']; savedObjectsClient: SavedObjectsClientContract; + visAugmenter: VisAugmenterStart; } /** @@ -174,7 +177,7 @@ export class VisualizationsPlugin public start( core: CoreStart, - { data, expressions, uiActions, embeddable, dashboard }: VisualizationsStartDeps + { data, expressions, uiActions, embeddable, dashboard, visAugmenter }: VisualizationsStartDeps ): VisualizationsStart { const types = this.types.start(); setI18n(core.i18n); @@ -193,6 +196,7 @@ export class VisualizationsPlugin setAggs(data.search.aggs); setOverlays(core.overlays); setChrome(core.chrome); + setSavedAugmentVisLoader(visAugmenter.savedAugmentVisLoader); const savedVisualizationsLoader = createSavedVisLoader({ savedObjectsClient: core.savedObjects.client, indexPatterns: data.indexPatterns, From 2be90dcd3822ed3e5e910c381a8ce5a33844401c Mon Sep 17 00:00:00 2001 From: Amit Galitzky Date: Tue, 21 Mar 2023 09:39:47 -0700 Subject: [PATCH 2/3] recreating visAugmenterLoader instead of required plugin Signed-off-by: Amit Galitzky --- .../visualizations/opensearch_dashboards.json | 2 +- src/plugins/visualizations/public/plugin.ts | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/plugins/visualizations/opensearch_dashboards.json b/src/plugins/visualizations/opensearch_dashboards.json index b9871161accc..b7c5e4ab9b4e 100644 --- a/src/plugins/visualizations/opensearch_dashboards.json +++ b/src/plugins/visualizations/opensearch_dashboards.json @@ -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"] } diff --git a/src/plugins/visualizations/public/plugin.ts b/src/plugins/visualizations/public/plugin.ts index 64e7dfe1d654..48f1d8306345 100644 --- a/src/plugins/visualizations/public/plugin.ts +++ b/src/plugins/visualizations/public/plugin.ts @@ -30,7 +30,6 @@ import './index.scss'; -import { VisAugmenterStart } from 'src/plugins/vis_augmenter/public'; import { PluginInitializerContext, CoreSetup, @@ -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. @@ -130,7 +130,6 @@ export interface VisualizationsStartDeps { dashboard: DashboardStart; getAttributeService: DashboardStart['getAttributeService']; savedObjectsClient: SavedObjectsClientContract; - visAugmenter: VisAugmenterStart; } /** @@ -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); @@ -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, From a5873618f97dc2e1960b2754596a066628e4d151 Mon Sep 17 00:00:00 2001 From: Amit Galitzky Date: Tue, 21 Mar 2023 10:05:44 -0700 Subject: [PATCH 3/3] run notice script Signed-off-by: Amit Galitzky --- NOTICE.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/NOTICE.txt b/NOTICE.txt index 170b48daa5b9..34da5d0a6f44 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -245,3 +245,4 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +