From b53ca4c10f8ac2851bc2b912a3a4549a43d1b334 Mon Sep 17 00:00:00 2001 From: "Qingyang(Abby) Hu" Date: Fri, 28 Oct 2022 11:32:03 -0700 Subject: [PATCH] Change save object type, wizard id and name to visBuilder (#2673) * Change save object type, wizard ID and Name to visBuilder Signed-off-by: abbyhu2000 * Rename wizard in functional tests Signed-off-by: abbyhu2000 * Finalize plugin-id and plugin-name and saved-object-type Signed-off-by: abbyhu2000 * Change official name to VisBuilder Signed-off-by: abbyhu2000 * Delete migration Signed-off-by: abbyhu2000 * Fix functional test Signed-off-by: abbyhu2000 * Update snapshot Signed-off-by: abbyhu2000 Signed-off-by: abbyhu2000 --- CHANGELOG.md | 1 + config/opensearch_dashboards.yml | 2 +- .../__snapshots__/schema_error.test.ts.snap | 2 +- src/plugins/saved_objects/README.md | 2 +- .../opensearch_dashboards.json | 2 +- .../saved_objects_management/public/plugin.ts | 4 +- .../public/register_services.ts | 10 +- src/plugins/vis_builder/README.md | 4 +- src/plugins/vis_builder/common/index.ts | 4 +- .../vis_builder_saved_object_attributes.ts | 2 +- .../vis_builder/opensearch_dashboards.json | 2 +- .../application/utils/get_top_nav_config.tsx | 8 +- .../utils/use/use_saved_vis_builder_vis.ts | 2 +- .../{wizard_icon.svg => vis_builder_icon.svg} | 0 ...vg => vis_builder_icon_secondary_fill.svg} | 0 .../embeddable/vis_builder_embeddable.tsx | 4 +- .../vis_builder_embeddable_factory.tsx | 2 +- src/plugins/vis_builder/public/plugin.ts | 8 +- .../server/capabilities_provider.ts | 2 +- src/plugins/vis_builder/server/plugin.ts | 4 +- .../server/saved_objects/vis_builder_app.ts | 7 +- .../vis_builder_migration.test.ts | 107 ------------------ .../saved_objects/vis_builder_migration.ts | 51 --------- test/common/config.js | 2 +- .../apps/{wizard => vis_builder}/_base.ts | 26 ++--- .../_experimental_vis.ts | 22 ++-- .../apps/{wizard => vis_builder}/index.ts | 6 +- .../functional/apps/visualize/_chart_types.ts | 2 +- test/functional/config.js | 6 +- test/functional/page_objects/index.ts | 4 +- .../{wizard_page.ts => vis_builder_page.ts} | 10 +- 31 files changed, 75 insertions(+), 233 deletions(-) rename src/plugins/vis_builder/public/assets/{wizard_icon.svg => vis_builder_icon.svg} (100%) rename src/plugins/vis_builder/public/assets/{wizard_icon_secondary_fill.svg => vis_builder_icon_secondary_fill.svg} (100%) delete mode 100644 src/plugins/vis_builder/server/saved_objects/vis_builder_migration.test.ts delete mode 100644 src/plugins/vis_builder/server/saved_objects/vis_builder_migration.ts rename test/functional/apps/{wizard => vis_builder}/_base.ts (59%) rename test/functional/apps/{wizard => vis_builder}/_experimental_vis.ts (65%) rename test/functional/apps/{wizard => vis_builder}/index.ts (88%) rename test/functional/page_objects/{wizard_page.ts => vis_builder_page.ts} (94%) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc928d9e0bb3..924a5c4244de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [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)) - [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)) ### 🐛 Bug Fixes diff --git a/config/opensearch_dashboards.yml b/config/opensearch_dashboards.yml index 8c592f7f698f..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. -# wizard.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/packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap b/packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap index 2acd5f14fb55..38f81a0cc62b 100644 --- a/packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap +++ b/packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap @@ -3,6 +3,6 @@ exports[`includes stack 1`] = ` "Error: test at new SchemaError (packages/osd-config-schema/src/errors/schema_error.ts:35:5) - at Object. (packages/osd-config-schema/src/errors/schema_error.test.ts:61:11) + at Object. (packages/osd-config-schema/src/errors/schema_error.test.ts:59:11) at new Promise ()" `; diff --git a/src/plugins/saved_objects/README.md b/src/plugins/saved_objects/README.md index 2ea57a3d6334..3b6dc4f7a79c 100644 --- a/src/plugins/saved_objects/README.md +++ b/src/plugins/saved_objects/README.md @@ -1,6 +1,6 @@ # Saved object -The saved object plugin provides all the core services and functionalities of saved objects. It is utilized by many core plugins such as [`visualization`](../visualizations/), [`dashboard`](../dashboard/) and [`wizard`](../wizard/), as well as external plugins. Saved object is the primary way to store app and plugin data in a standardized form in OpenSearch Dashboards. They allow plugin developers to manage creating, saving, editing and retrieving data for the application. They can also make reference to other saved objects and have useful features out of the box, such as migrations and strict typings. The saved objects can be managed by the Saved Object Management UI. +The saved object plugin provides all the core services and functionalities of saved objects. It is utilized by many core plugins such as [`visualization`](../visualizations/), [`dashboard`](../dashboard/) and [`visBuilder`](../vis_builder/), as well as external plugins. Saved object is the primary way to store app and plugin data in a standardized form in OpenSearch Dashboards. They allow plugin developers to manage creating, saving, editing and retrieving data for the application. They can also make reference to other saved objects and have useful features out of the box, such as migrations and strict typings. The saved objects can be managed by the Saved Object Management UI. ## Save relationships to index pattern diff --git a/src/plugins/saved_objects_management/opensearch_dashboards.json b/src/plugins/saved_objects_management/opensearch_dashboards.json index 21a0b00860b4..6d02893311e3 100644 --- a/src/plugins/saved_objects_management/opensearch_dashboards.json +++ b/src/plugins/saved_objects_management/opensearch_dashboards.json @@ -4,7 +4,7 @@ "server": true, "ui": true, "requiredPlugins": ["management", "data"], - "optionalPlugins": ["dashboard", "visualizations", "discover", "home", "wizard"], + "optionalPlugins": ["dashboard", "visualizations", "discover", "home", "visBuilder"], "extraPublicDirs": ["public/lib"], "requiredBundles": ["opensearchDashboardsReact", "home"] } diff --git a/src/plugins/saved_objects_management/public/plugin.ts b/src/plugins/saved_objects_management/public/plugin.ts index 1ccf9772ff2c..c15a96bddb7a 100644 --- a/src/plugins/saved_objects_management/public/plugin.ts +++ b/src/plugins/saved_objects_management/public/plugin.ts @@ -31,7 +31,7 @@ import { i18n } from '@osd/i18n'; import { CoreSetup, CoreStart, Plugin } from 'src/core/public'; -import { WizardStart } from '../../vis_builder/public'; +import { VisBuilderStart } from '../../vis_builder/public'; import { ManagementSetup } from '../../management/public'; import { DataPublicPluginStart } from '../../data/public'; import { DashboardStart } from '../../dashboard/public'; @@ -71,7 +71,7 @@ export interface StartDependencies { dashboard?: DashboardStart; visualizations?: VisualizationsStart; discover?: DiscoverStart; - wizard?: WizardStart; + visBuilder?: VisBuilderStart; } export class SavedObjectsManagementPlugin diff --git a/src/plugins/saved_objects_management/public/register_services.ts b/src/plugins/saved_objects_management/public/register_services.ts index 8ce6ed20bc9f..514ab66a4595 100644 --- a/src/plugins/saved_objects_management/public/register_services.ts +++ b/src/plugins/saved_objects_management/public/register_services.ts @@ -36,7 +36,7 @@ export const registerServices = async ( registry: ISavedObjectsManagementServiceRegistry, getStartServices: StartServicesAccessor ) => { - const [, { dashboard, visualizations, discover, wizard }] = await getStartServices(); + const [, { dashboard, visualizations, discover, visBuilder }] = await getStartServices(); if (dashboard) { registry.register({ @@ -62,11 +62,11 @@ export const registerServices = async ( }); } - if (wizard) { + if (visBuilder) { registry.register({ - id: 'savedWizard', - title: 'wizard', - service: wizard.savedWizardLoader, + id: 'savedVisBuilder', + title: 'visBuilder', + service: visBuilder.savedVisBuilderLoader, }); } }; diff --git a/src/plugins/vis_builder/README.md b/src/plugins/vis_builder/README.md index bb2d08fecbbb..88b5afbda1f4 100755 --- a/src/plugins/vis_builder/README.md +++ b/src/plugins/vis_builder/README.md @@ -1,4 +1,4 @@ -# Wizard +# VisBuilder An OpenSearch Dashboards plugin for a visualization experience that makes exploring data and creating visualizations much easier. It will act as an additional way to create visualizations alongside the exiting tools within the current visualizations plugin. The tool will be incremental to the visualization tools available to users in OpenSearch Dashboards today. @@ -6,7 +6,7 @@ An OpenSearch Dashboards plugin for a visualization experience that makes explor To use this plugin, navigate to: -Visualize -> Create Visualization -> Wizard +Visualize -> Create Visualization -> VisBuilder ## Add a visualization diff --git a/src/plugins/vis_builder/common/index.ts b/src/plugins/vis_builder/common/index.ts index d28c9b8fa58c..8e50b07f7dc0 100644 --- a/src/plugins/vis_builder/common/index.ts +++ b/src/plugins/vis_builder/common/index.ts @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -export const PLUGIN_ID = 'wizard'; -export const PLUGIN_NAME = 'Wizard'; +export const PLUGIN_ID = 'vis-builder'; +export const PLUGIN_NAME = 'VisBuilder'; export const VISUALIZE_ID = 'visualize'; 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 c15d9b81295c..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 = 'wizard'; +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 1068a7228d18..98ef5153a9b0 100644 --- a/src/plugins/vis_builder/opensearch_dashboards.json +++ b/src/plugins/vis_builder/opensearch_dashboards.json @@ -1,5 +1,5 @@ { - "id": "wizard", + "id": "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 38b6f51e2f4f..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; @@ -81,7 +81,7 @@ export const getTopNavConfig = ( : i18n.translate('visBuilder.topNavMenu.saveVisualizationButtonLabel', { defaultMessage: 'save', }), - testId: 'wizardSaveButton', + testId: 'visBuilderSaveButton', disableButton: !!saveDisabledReason, tooltip: saveDisabledReason, run: (_anchorElement) => { @@ -120,7 +120,7 @@ export const getTopNavConfig = ( defaultMessage: 'Finish editing visBuilder and return to the last app', } ), - testId: 'wizardsaveAndReturnButton', + testId: 'visBuilderSaveAndReturnButton', disableButton: !!saveDisabledReason, tooltip: saveDisabledReason, run: async () => { @@ -207,7 +207,7 @@ export const getOnSave = ( if (newlyCreated && stateTransfer) { // create new embeddable to transfer to originatingApp stateTransfer.navigateToWithEmbeddablePackage(originatingApp, { - state: { type: 'wizard', input: { savedObjectId: id } }, + state: { type: VISBUILDER_SAVED_OBJECT, input: { savedObjectId: id } }, }); return { id }; } else { diff --git a/src/plugins/vis_builder/public/application/utils/use/use_saved_vis_builder_vis.ts b/src/plugins/vis_builder/public/application/utils/use/use_saved_vis_builder_vis.ts index 3e00c06994a4..d7840b92f8ad 100644 --- a/src/plugins/vis_builder/public/application/utils/use/use_saved_vis_builder_vis.ts +++ b/src/plugins/vis_builder/public/application/utils/use/use_saved_vis_builder_vis.ts @@ -91,7 +91,7 @@ export const useSavedVisBuilderVis = (visualizationIdFromUrl: string | undefined const managementRedirectTarget = { [PLUGIN_ID]: { app: 'management', - path: `opensearch-dashboards/objects/savedWizard/${visualizationIdFromUrl}`, + path: `opensearch-dashboards/objects/savedVisBuilder/${visualizationIdFromUrl}`, }, }; diff --git a/src/plugins/vis_builder/public/assets/wizard_icon.svg b/src/plugins/vis_builder/public/assets/vis_builder_icon.svg similarity index 100% rename from src/plugins/vis_builder/public/assets/wizard_icon.svg rename to src/plugins/vis_builder/public/assets/vis_builder_icon.svg diff --git a/src/plugins/vis_builder/public/assets/wizard_icon_secondary_fill.svg b/src/plugins/vis_builder/public/assets/vis_builder_icon_secondary_fill.svg similarity index 100% rename from src/plugins/vis_builder/public/assets/wizard_icon_secondary_fill.svg rename to src/plugins/vis_builder/public/assets/vis_builder_icon_secondary_fill.svg diff --git a/src/plugins/vis_builder/public/embeddable/vis_builder_embeddable.tsx b/src/plugins/vis_builder/public/embeddable/vis_builder_embeddable.tsx index 8ebbd662cc20..a8c41df6cc43 100644 --- a/src/plugins/vis_builder/public/embeddable/vis_builder_embeddable.tsx +++ b/src/plugins/vis_builder/public/embeddable/vis_builder_embeddable.tsx @@ -183,7 +183,7 @@ export class VisBuilderEmbeddable extends Embeddable ({ 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 9bbede2d53a9..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 = () => ({ - wizard: { + '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 d1466077061c..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) => title, getEditUrl: ({ id }: SavedObject) => - `/management/opensearch-dashboards/objects/savedWizard/${encodeURIComponent(id)}`, + `/management/opensearch-dashboards/objects/savedVisBuilder/${encodeURIComponent(id)}`, getInAppUrl({ id }: SavedObject) { return { path: `/app/${PLUGIN_ID}${EDIT_PATH}/${encodeURIComponent(id)}`, - uiCapabilitiesPath: 'wizard.show', + uiCapabilitiesPath: 'visualization-visbuilder.show', }; }, }, - migrations: visBuilderSavedObjectTypeMigrations, + migrations: {}, mappings: { properties: { title: { diff --git a/src/plugins/vis_builder/server/saved_objects/vis_builder_migration.test.ts b/src/plugins/vis_builder/server/saved_objects/vis_builder_migration.test.ts deleted file mode 100644 index 0a3927b81802..000000000000 --- a/src/plugins/vis_builder/server/saved_objects/vis_builder_migration.test.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { SavedObjectMigrationFn, SavedObjectMigrationContext } from '../../../../core/server'; -import { visBuilderSavedObjectTypeMigrations } from './vis_builder_migration'; - -const savedObjectMigrationContext = (null as unknown) as SavedObjectMigrationContext; - -describe('2.3.0', () => { - const migrate = (doc: any) => - visBuilderSavedObjectTypeMigrations['2.3.0']( - doc as Parameters[0], - savedObjectMigrationContext - ); - - it('should return original doc if visualizationState is not found', () => { - const migratedDoc = migrate({ - type: 'wizard', - attributes: {}, - }); - - expect(migratedDoc).toEqual({ - type: 'wizard', - attributes: {}, - }); - }); - - it('should return original doc if indexPattern is not found within visualizationState', () => { - const migratedDoc = migrate({ - type: 'wizard', - attributes: { - visualizationState: { - searchSource: '', - activeVisualization: {}, - }, - }, - }); - - expect(migratedDoc).toEqual({ - type: 'wizard', - attributes: { - visualizationState: { - searchSource: '', - activeVisualization: {}, - }, - }, - }); - }); - - it('should return original doc if references is not an array', () => { - const migratedDoc = migrate({ - type: 'wizard', - attributes: { - visualizationState: {}, - }, - references: {}, - }); - - expect(migratedDoc).toEqual({ - type: 'wizard', - attributes: { - visualizationState: {}, - }, - references: {}, - }); - }); - - it('should migrate the old version visBuilder saved object to new version VisBuilder saved object', () => { - const migratedDoc = migrate({ - type: 'wizard', - attributes: { - visualizationState: JSON.stringify({ - searchFields: {}, - activeVisualization: {}, - indexPattern: 'indexPatternId', - }), - version: 1, - }, - references: [], - }); - - expect(migratedDoc).toEqual({ - type: 'wizard', - attributes: { - visualizationState: JSON.stringify({ - searchFields: {}, - activeVisualization: {}, - }), - version: 2, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index', - }), - }, - }, - references: [ - { - name: 'kibanaSavedObjectMeta.searchSourceJSON.index', - type: 'index-pattern', - id: 'indexPatternId', - }, - ], - }); - }); -}); diff --git a/src/plugins/vis_builder/server/saved_objects/vis_builder_migration.ts b/src/plugins/vis_builder/server/saved_objects/vis_builder_migration.ts deleted file mode 100644 index b568f4b8c405..000000000000 --- a/src/plugins/vis_builder/server/saved_objects/vis_builder_migration.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { get, flow } from 'lodash'; -import { SavedObjectMigrationFn } from '../../../../core/server'; - -const migrateIndexPattern: SavedObjectMigrationFn = (doc) => { - try { - const visualizationStateJSON = get(doc, 'attributes.visualizationState'); - const visualizationState = JSON.parse(visualizationStateJSON); - const indexPatternId = visualizationState.indexPattern; - const indexRefName = 'kibanaSavedObjectMeta.searchSourceJSON.index'; - - if (indexPatternId && Array.isArray(doc.references)) { - const searchSourceIndex = { - indexRefName, - }; - const visualizationWithoutIndex = { - searchFields: visualizationState.searchFields, - activeVisualization: visualizationState.activeVisualization, - }; - doc.attributes.visualizationState = JSON.stringify(visualizationWithoutIndex); - - doc.references.push({ - name: indexRefName, - type: 'index-pattern', - id: indexPatternId, - }); - doc.attributes.version = 2; - - return { - ...doc, - attributes: { - ...doc.attributes, - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify(searchSourceIndex), - }, - }, - }; - } - return doc; - } catch (e) { - return doc; - } -}; - -export const visBuilderSavedObjectTypeMigrations = { - '2.3.0': flow(migrateIndexPattern), -}; diff --git a/test/common/config.js b/test/common/config.js index 26abcc2fa586..0ad9dc042c5b 100644 --- a/test/common/config.js +++ b/test/common/config.js @@ -78,7 +78,7 @@ export default function () { `--opensearchDashboards.branding.mark.defaultUrl=https://opensearch.org/assets/brand/SVG/Mark/opensearch_mark_default.svg`, `--opensearchDashboards.branding.mark.darkModeUrl=https://opensearch.org/assets/brand/SVG/Mark/opensearch_mark_darkmode.svg`, `--opensearchDashboards.branding.applicationTitle=OpenSearch`, - `--wizard.enabled=true`, + `--vis_builder.enabled=true`, ], }, services, diff --git a/test/functional/apps/wizard/_base.ts b/test/functional/apps/vis_builder/_base.ts similarity index 59% rename from test/functional/apps/wizard/_base.ts rename to test/functional/apps/vis_builder/_base.ts index 819a67a628f5..60dd1068347c 100644 --- a/test/functional/apps/wizard/_base.ts +++ b/test/functional/apps/vis_builder/_base.ts @@ -7,44 +7,44 @@ import expect from '@osd/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const PageObjects = getPageObjects(['visualize', 'wizard', 'visChart']); + const PageObjects = getPageObjects(['visualize', 'visBuilder', 'visChart']); const testSubjects = getService('testSubjects'); const log = getService('log'); const retry = getService('retry'); - describe('Basic tests for wizard app ', function () { + describe('Basic tests for visBuilder app ', function () { before(async () => { - log.debug('navigateToApp wizard'); - await PageObjects.wizard.navigateToCreateWizard(); + log.debug('navigateToApp visBuilder'); + await PageObjects.visBuilder.navigateToCreateVisBuilder(); }); it('should be able to switch data sources', async () => { - const dataSourceValue = await PageObjects.wizard.selectDataSource( - PageObjects.wizard.index.LOGSTASH_NON_TIME_BASED + const dataSourceValue = await PageObjects.visBuilder.selectDataSource( + PageObjects.visBuilder.index.LOGSTASH_NON_TIME_BASED ); - expect(dataSourceValue).to.equal(PageObjects.wizard.index.LOGSTASH_NON_TIME_BASED); + expect(dataSourceValue).to.equal(PageObjects.visBuilder.index.LOGSTASH_NON_TIME_BASED); // TODO: Switch with a datasource with unique fields to test if it exists }); it('should show visualization when a field is added', async () => { const expectedData = [2904, 2858, 2814, 2784, 1322]; - await PageObjects.wizard.addField('metric', 'Count'); - await PageObjects.wizard.addField('segment', 'Terms', 'machine.os.raw'); + await PageObjects.visBuilder.addField('metric', 'Count'); + await PageObjects.visBuilder.addField('segment', 'Terms', 'machine.os.raw'); const data = await PageObjects.visChart.getBarChartData(); expect(data).to.eql(expectedData); }); it('should clear visualization when field is deleted', async () => { - await PageObjects.wizard.removeField('metric', 0); + await PageObjects.visBuilder.removeField('metric', 0); - const isEmptyWorkspace = await PageObjects.wizard.isEmptyWorkspace(); + const isEmptyWorkspace = await PageObjects.visBuilder.isEmptyWorkspace(); expect(isEmptyWorkspace).to.be(true); }); it('should show warning before changing visualization type', async () => { - await PageObjects.wizard.selectVisType('metric', false); + await PageObjects.visBuilder.selectVisType('metric', false); const confirmModalExists = await testSubjects.exists('confirmVisChangeModal'); expect(confirmModalExists).to.be(true); @@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should change visualization type', async () => { - const pickerValue = await PageObjects.wizard.selectVisType('metric'); + const pickerValue = await PageObjects.visBuilder.selectVisType('metric'); expect(pickerValue).to.eql('Metric'); }); diff --git a/test/functional/apps/wizard/_experimental_vis.ts b/test/functional/apps/vis_builder/_experimental_vis.ts similarity index 65% rename from test/functional/apps/wizard/_experimental_vis.ts rename to test/functional/apps/vis_builder/_experimental_vis.ts index e36c0254e22a..1743d4882281 100644 --- a/test/functional/apps/wizard/_experimental_vis.ts +++ b/test/functional/apps/vis_builder/_experimental_vis.ts @@ -8,25 +8,25 @@ import { VISUALIZE_ENABLE_LABS_SETTING } from '../../../../src/plugins/visualiza import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const PageObjects = getPageObjects(['visualize', 'wizard']); + const PageObjects = getPageObjects(['visualize', 'visBuilder']); const log = getService('log'); const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - describe('experimental settings for wizard app ', function () { - it('should show an notification when creating wizard visualization', async () => { + describe('experimental settings for visBuilder app ', function () { + it('should show an notification when creating visBuilder visualization', async () => { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewVisualization(); await PageObjects.visualize.waitForVisualizationSelectPage(); - // Try to find the wizard Vis type. - const wizardVisTypeExists = await PageObjects.visualize.hasVisType('wizard'); - expect(wizardVisTypeExists).to.be(true); + // Try to find the visBuilder Vis type. + const visBuilderVisTypeExists = await PageObjects.visualize.hasVisType('vis-builder'); + expect(visBuilderVisTypeExists).to.be(true); // Create a new visualization - await PageObjects.visualize.clickVisType('wizard'); + await PageObjects.visualize.clickVisType('vis-builder'); // Check that the experimental banner is there and state that this is experimental - const info = await PageObjects.wizard.getExperimentalInfo(); + const info = await PageObjects.visBuilder.getExperimentalInfo(); expect(await info.getVisibleText()).to.contain('experimental'); }); @@ -38,9 +38,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.navigateToNewVisualization(); await PageObjects.visualize.waitForVisualizationSelectPage(); - // Try to find the wizard Vis type. - const wizardVisTypeExists = await PageObjects.visualize.hasVisType('wizard'); - expect(wizardVisTypeExists).to.be(false); + // Try to find the visBuilder Vis type. + const visBuilderVisTypeExists = await PageObjects.visualize.hasVisType('vis-builder'); + expect(visBuilderVisTypeExists).to.be(false); }); after(async () => { diff --git a/test/functional/apps/wizard/index.ts b/test/functional/apps/vis_builder/index.ts similarity index 88% rename from test/functional/apps/wizard/index.ts rename to test/functional/apps/vis_builder/index.ts index 24c4eb50c263..c0e7b9c35c77 100644 --- a/test/functional/apps/wizard/index.ts +++ b/test/functional/apps/vis_builder/index.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { FtrProviderContext } from '../../ftr_provider_context.d'; +import { FtrProviderContext } from '../../ftr_provider_context'; import { UI_SETTINGS } from '../../../../src/plugins/data/common'; export default function ({ getService, loadTestFile }: FtrProviderContext) { @@ -12,11 +12,11 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { const opensearchArchiver = getService('opensearchArchiver'); const opensearchDashboardsServer = getService('opensearchDashboardsServer'); - describe('wizard app', function () { + describe('visBuilder app', function () { this.tags('ciGroup13'); before(async function () { - log.debug('Starting wizard before method'); + log.debug('Starting visBuilder before method'); await browser.setWindowSize(1280, 800); await opensearchArchiver.loadIfNeeded('logstash_functional'); await opensearchArchiver.loadIfNeeded('long_window_logstash'); diff --git a/test/functional/apps/visualize/_chart_types.ts b/test/functional/apps/visualize/_chart_types.ts index 63538541e813..3286edd3cd8b 100644 --- a/test/functional/apps/visualize/_chart_types.ts +++ b/test/functional/apps/visualize/_chart_types.ts @@ -65,7 +65,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Timeline', 'Vega', 'Vertical Bar', - 'Wizard', // TODO: Update to final name when ready + 'VisBuilder', ]; if (!isOss) { expectedChartTypes.push('Maps', 'Lens'); diff --git a/test/functional/config.js b/test/functional/config.js index bb6be73ebd82..d60250968720 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -48,7 +48,7 @@ export default async function ({ readConfigFile }) { require.resolve('./apps/status_page'), require.resolve('./apps/timeline'), require.resolve('./apps/visualize'), - require.resolve('./apps/wizard'), + require.resolve('./apps/vis_builder'), ], pageObjects, services, @@ -92,8 +92,8 @@ export default async function ({ readConfigFile }) { pathname: '/app/visualize', hash: '/', }, - wizard: { - pathname: '/app/wizard', + visBuilder: { + pathname: '/app/visBuilder', hash: '/', }, dashboard: { diff --git a/test/functional/page_objects/index.ts b/test/functional/page_objects/index.ts index d09445d47026..63cd990c445b 100644 --- a/test/functional/page_objects/index.ts +++ b/test/functional/page_objects/index.ts @@ -44,7 +44,7 @@ import { TimePickerProvider } from './time_picker'; import { TimelinePageProvider } from './timeline_page'; import { VisualBuilderPageProvider } from './visual_builder_page'; import { VisualizePageProvider } from './visualize_page'; -import { WizardPageProvider } from './wizard_page'; +import { VisBuilderPageProvider } from './vis_builder_page'; import { VisualizeEditorPageProvider } from './visualize_editor_page'; import { VisualizeChartPageProvider } from './visualize_chart_page'; import { TileMapPageProvider } from './tile_map_page'; @@ -69,7 +69,7 @@ export const pageObjects = { timePicker: TimePickerProvider, visualBuilder: VisualBuilderPageProvider, visualize: VisualizePageProvider, - wizard: WizardPageProvider, + visBuilder: VisBuilderPageProvider, visEditor: VisualizeEditorPageProvider, visChart: VisualizeChartPageProvider, tileMap: TileMapPageProvider, diff --git a/test/functional/page_objects/wizard_page.ts b/test/functional/page_objects/vis_builder_page.ts similarity index 94% rename from test/functional/page_objects/wizard_page.ts rename to test/functional/page_objects/vis_builder_page.ts index bd206f71fa2f..81ad2f15fe53 100644 --- a/test/functional/page_objects/wizard_page.ts +++ b/test/functional/page_objects/vis_builder_page.ts @@ -5,7 +5,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; -export function WizardPageProvider({ getService, getPageObjects }: FtrProviderContext) { +export function VisBuilderPageProvider({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const find = getService('find'); const browser = getService('browser'); @@ -16,14 +16,14 @@ export function WizardPageProvider({ getService, getPageObjects }: FtrProviderCo * This page object contains the visualization type selection, the landing page, * and the open/save dialog functions */ - class WizardPage { + class VisBuilderPage { index = { LOGSTASH_TIME_BASED: 'logstash-*', LOGSTASH_NON_TIME_BASED: 'logstash*', }; - public async navigateToCreateWizard() { - await common.navigateToApp('wizard'); + public async navigateToCreateVisBuilder() { + await common.navigateToApp('vis-builder'); await header.waitUntilLoadingHasFinished(); } @@ -124,5 +124,5 @@ export function WizardPageProvider({ getService, getPageObjects }: FtrProviderCo } } - return new WizardPage(); + return new VisBuilderPage(); }