From bd16e3924290a36b806cfde99ef52969a14cf759 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Thu, 27 Oct 2022 23:40:19 +0000 Subject: [PATCH] Finalize plugin-id and plugin-name and saved-object-type Signed-off-by: abbyhu2000 --- CHANGELOG.md | 4 ---- config/opensearch_dashboards.yml | 2 +- src/plugins/vis_builder/common/index.ts | 3 +-- .../vis_builder/common/vis_builder_saved_object_attributes.ts | 2 +- src/plugins/vis_builder/opensearch_dashboards.json | 1 - .../public/application/utils/get_top_nav_config.tsx | 4 ++-- src/plugins/vis_builder/public/plugin.ts | 2 +- src/plugins/vis_builder/server/capabilities_provider.ts | 2 +- src/plugins/vis_builder/server/plugin.ts | 4 ++-- .../vis_builder/server/saved_objects/vis_builder_app.ts | 2 +- test/common/config.js | 2 +- test/functional/apps/visualize/_chart_types.ts | 2 +- 12 files changed, 12 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e804c1b9f3e..85d3633663d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### 📈 Features/Enhancements -<<<<<<< HEAD - [MD] Support legacy client for data source ([#2204](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2204)) - [MD] Add data source signing support ([#2510](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2510)) - [Plugin Helpers] Facilitate version changes ([#2398](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2398)) @@ -31,11 +30,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Multi DataSource] Address UX comments on Data source list and create page ([#2625](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2625)) - [Vis Builder] Rename wizard to visBuilder in i18n id and formatted message id ([#2635](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2635)) - [Vis Builder] Rename wizard to visBuilder in class name, type name and function name ([#2639](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2639)) -<<<<<<< HEAD - [Vis Builder] Rename wizard on save modal and visualization table ([#2645](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2645)) -======= - Change save object type, wizard id and name to visBuilder #2673 ([#2673](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2673)) ->>>>>>> Rename wizard in functional tests ### 🐛 Bug Fixes diff --git a/config/opensearch_dashboards.yml b/config/opensearch_dashboards.yml index 0a7d8c6b909e..d68c77ad8495 100644 --- a/config/opensearch_dashboards.yml +++ b/config/opensearch_dashboards.yml @@ -222,7 +222,7 @@ # Set the value of this setting to true to start exploring wizard # functionality in Visualization. -# visBuilder.enabled: false +# vis_builder.enabled: false # Set the value of this setting to true to enable the experimental multiple data source # support feature. Use with caution. diff --git a/src/plugins/vis_builder/common/index.ts b/src/plugins/vis_builder/common/index.ts index 951a279bd6e6..18583abaf421 100644 --- a/src/plugins/vis_builder/common/index.ts +++ b/src/plugins/vis_builder/common/index.ts @@ -3,10 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -export const PLUGIN_ID = 'visBuilder'; +export const PLUGIN_ID = 'vis-builder'; export const PLUGIN_NAME = 'Visualization Builder'; export const VISUALIZE_ID = 'visualize'; -export const VIS_BUILDER_TYPE_SHORTHAND = 'VisBuilder'; export const EDIT_PATH = '/edit'; export const VIS_BUILDER_CHART_TYPE = 'VisBuilder'; diff --git a/src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts b/src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts index e25f91d131a7..243e455d7157 100644 --- a/src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts +++ b/src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts @@ -5,7 +5,7 @@ import { SavedObjectAttributes } from '../../../core/types'; -export const VISBUILDER_SAVED_OBJECT = 'visBuilder'; +export const VISBUILDER_SAVED_OBJECT = 'visualization-visbuilder'; export interface VisBuilderSavedObjectAttributes extends SavedObjectAttributes { title: string; diff --git a/src/plugins/vis_builder/opensearch_dashboards.json b/src/plugins/vis_builder/opensearch_dashboards.json index 96ce2db2c36a..98ef5153a9b0 100644 --- a/src/plugins/vis_builder/opensearch_dashboards.json +++ b/src/plugins/vis_builder/opensearch_dashboards.json @@ -1,6 +1,5 @@ { "id": "visBuilder", - "configPath": "visBuilder", "version": "1.0.0", "opensearchDashboardsVersion": "opensearchDashboards", "server": true, diff --git a/src/plugins/vis_builder/public/application/utils/get_top_nav_config.tsx b/src/plugins/vis_builder/public/application/utils/get_top_nav_config.tsx index 3b18d9b9939d..c88bb13f3cb3 100644 --- a/src/plugins/vis_builder/public/application/utils/get_top_nav_config.tsx +++ b/src/plugins/vis_builder/public/application/utils/get_top_nav_config.tsx @@ -39,7 +39,7 @@ import { import { VisBuilderServices } from '../..'; import { VisBuilderVisSavedObject } from '../../types'; import { AppDispatch } from './state_management'; -import { EDIT_PATH } from '../../../common'; +import { EDIT_PATH, VISBUILDER_SAVED_OBJECT } from '../../../common'; import { setEditorState } from './state_management/metadata_slice'; export interface TopNavConfigParams { visualizationIdFromUrl: string; @@ -207,7 +207,7 @@ export const getOnSave = ( if (newlyCreated && stateTransfer) { // create new embeddable to transfer to originatingApp stateTransfer.navigateToWithEmbeddablePackage(originatingApp, { - state: { type: 'visBuilder', input: { savedObjectId: id } }, + state: { type: VISBUILDER_SAVED_OBJECT, input: { savedObjectId: id } }, }); return { id }; } else { diff --git a/src/plugins/vis_builder/public/plugin.ts b/src/plugins/vis_builder/public/plugin.ts index edc43c1b7c80..085fab408bbb 100644 --- a/src/plugins/vis_builder/public/plugin.ts +++ b/src/plugins/vis_builder/public/plugin.ts @@ -130,7 +130,7 @@ export class VisBuilderPlugin aliasPath: '#/', appExtensions: { visualizations: { - docTypes: [PLUGIN_ID], + docTypes: [VISBUILDER_SAVED_OBJECT], toListItem: ({ id, attributes, updated_at: updatedAt }) => ({ description: attributes?.description, editApp: PLUGIN_ID, diff --git a/src/plugins/vis_builder/server/capabilities_provider.ts b/src/plugins/vis_builder/server/capabilities_provider.ts index fa28c849a547..c810efabdfe5 100644 --- a/src/plugins/vis_builder/server/capabilities_provider.ts +++ b/src/plugins/vis_builder/server/capabilities_provider.ts @@ -4,7 +4,7 @@ */ export const capabilitiesProvider = () => ({ - visBuilder: { + 'visualization-visbuilder': { // TODO: investigate which capabilities we need to provide // createNew: true, // createShortUrl: true, diff --git a/src/plugins/vis_builder/server/plugin.ts b/src/plugins/vis_builder/server/plugin.ts index 8cc5f02c8d3f..d250c21f14ad 100644 --- a/src/plugins/vis_builder/server/plugin.ts +++ b/src/plugins/vis_builder/server/plugin.ts @@ -23,7 +23,7 @@ export class VisBuilderPlugin implements Plugin