Skip to content

Commit 007d6b2

Browse files
abbyhu2000Ajay Gupta
authored andcommitted
Change save object type, wizard id and name to visBuilder (opensearch-project#2673)
* Change save object type, wizard ID and Name to visBuilder Signed-off-by: abbyhu2000 <[email protected]> * Rename wizard in functional tests Signed-off-by: abbyhu2000 <[email protected]> * Finalize plugin-id and plugin-name and saved-object-type Signed-off-by: abbyhu2000 <[email protected]> * Change official name to VisBuilder Signed-off-by: abbyhu2000 <[email protected]> * Delete migration Signed-off-by: abbyhu2000 <[email protected]> * Fix functional test Signed-off-by: abbyhu2000 <[email protected]> * Update snapshot Signed-off-by: abbyhu2000 <[email protected]> Signed-off-by: abbyhu2000 <[email protected]> Signed-off-by: Ajay Gupta <[email protected]>
1 parent dd0300d commit 007d6b2

31 files changed

+75
-233
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
3232
- [Vis Builder] Rename wizard to visBuilder in i18n id and formatted message id ([#2635](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2635))
3333
- [Vis Builder] Rename wizard to visBuilder in class name, type name and function name ([#2639](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2639))
3434
- [Vis Builder] Rename wizard on save modal and visualization table ([#2645](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2645))
35+
- Change save object type, wizard id and name to visBuilder #2673 ([#2673](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2673))
3536

3637
### 🐛 Bug Fixes
3738

config/opensearch_dashboards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222

223223
# Set the value of this setting to true to start exploring wizard
224224
# functionality in Visualization.
225-
# wizard.enabled: false
225+
# vis_builder.enabled: false
226226

227227
# Set the value of this setting to true to enable the experimental multiple data source
228228
# support feature. Use with caution.

packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/saved_objects/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Saved object
22

3-
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.
3+
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.
44

55
## Save relationships to index pattern
66

src/plugins/saved_objects_management/opensearch_dashboards.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"server": true,
55
"ui": true,
66
"requiredPlugins": ["management", "data"],
7-
"optionalPlugins": ["dashboard", "visualizations", "discover", "home", "wizard"],
7+
"optionalPlugins": ["dashboard", "visualizations", "discover", "home", "visBuilder"],
88
"extraPublicDirs": ["public/lib"],
99
"requiredBundles": ["opensearchDashboardsReact", "home"]
1010
}

src/plugins/saved_objects_management/public/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import { i18n } from '@osd/i18n';
3232
import { CoreSetup, CoreStart, Plugin } from 'src/core/public';
3333

34-
import { WizardStart } from '../../vis_builder/public';
34+
import { VisBuilderStart } from '../../vis_builder/public';
3535
import { ManagementSetup } from '../../management/public';
3636
import { DataPublicPluginStart } from '../../data/public';
3737
import { DashboardStart } from '../../dashboard/public';
@@ -71,7 +71,7 @@ export interface StartDependencies {
7171
dashboard?: DashboardStart;
7272
visualizations?: VisualizationsStart;
7373
discover?: DiscoverStart;
74-
wizard?: WizardStart;
74+
visBuilder?: VisBuilderStart;
7575
}
7676

7777
export class SavedObjectsManagementPlugin

src/plugins/saved_objects_management/public/register_services.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const registerServices = async (
3636
registry: ISavedObjectsManagementServiceRegistry,
3737
getStartServices: StartServicesAccessor<StartDependencies, SavedObjectsManagementPluginStart>
3838
) => {
39-
const [, { dashboard, visualizations, discover, wizard }] = await getStartServices();
39+
const [, { dashboard, visualizations, discover, visBuilder }] = await getStartServices();
4040

4141
if (dashboard) {
4242
registry.register({
@@ -62,11 +62,11 @@ export const registerServices = async (
6262
});
6363
}
6464

65-
if (wizard) {
65+
if (visBuilder) {
6666
registry.register({
67-
id: 'savedWizard',
68-
title: 'wizard',
69-
service: wizard.savedWizardLoader,
67+
id: 'savedVisBuilder',
68+
title: 'visBuilder',
69+
service: visBuilder.savedVisBuilderLoader,
7070
});
7171
}
7272
};

src/plugins/vis_builder/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Wizard
1+
# VisBuilder
22

33
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.
44

55
## Usage
66

77
To use this plugin, navigate to:
88

9-
Visualize -> Create Visualization -> Wizard
9+
Visualize -> Create Visualization -> VisBuilder
1010

1111
## Add a visualization
1212

src/plugins/vis_builder/common/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
export const PLUGIN_ID = 'wizard';
7-
export const PLUGIN_NAME = 'Wizard';
6+
export const PLUGIN_ID = 'vis-builder';
7+
export const PLUGIN_NAME = 'VisBuilder';
88
export const VISUALIZE_ID = 'visualize';
99
export const EDIT_PATH = '/edit';
1010
export const VIS_BUILDER_CHART_TYPE = 'VisBuilder';

src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { SavedObjectAttributes } from '../../../core/types';
77

8-
export const VISBUILDER_SAVED_OBJECT = 'wizard';
8+
export const VISBUILDER_SAVED_OBJECT = 'visualization-visbuilder';
99

1010
export interface VisBuilderSavedObjectAttributes extends SavedObjectAttributes {
1111
title: string;

src/plugins/vis_builder/opensearch_dashboards.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "wizard",
2+
"id": "visBuilder",
33
"version": "1.0.0",
44
"opensearchDashboardsVersion": "opensearchDashboards",
55
"server": true,

src/plugins/vis_builder/public/application/utils/get_top_nav_config.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
import { VisBuilderServices } from '../..';
4040
import { VisBuilderVisSavedObject } from '../../types';
4141
import { AppDispatch } from './state_management';
42-
import { EDIT_PATH } from '../../../common';
42+
import { EDIT_PATH, VISBUILDER_SAVED_OBJECT } from '../../../common';
4343
import { setEditorState } from './state_management/metadata_slice';
4444
export interface TopNavConfigParams {
4545
visualizationIdFromUrl: string;
@@ -81,7 +81,7 @@ export const getTopNavConfig = (
8181
: i18n.translate('visBuilder.topNavMenu.saveVisualizationButtonLabel', {
8282
defaultMessage: 'save',
8383
}),
84-
testId: 'wizardSaveButton',
84+
testId: 'visBuilderSaveButton',
8585
disableButton: !!saveDisabledReason,
8686
tooltip: saveDisabledReason,
8787
run: (_anchorElement) => {
@@ -120,7 +120,7 @@ export const getTopNavConfig = (
120120
defaultMessage: 'Finish editing visBuilder and return to the last app',
121121
}
122122
),
123-
testId: 'wizardsaveAndReturnButton',
123+
testId: 'visBuilderSaveAndReturnButton',
124124
disableButton: !!saveDisabledReason,
125125
tooltip: saveDisabledReason,
126126
run: async () => {
@@ -207,7 +207,7 @@ export const getOnSave = (
207207
if (newlyCreated && stateTransfer) {
208208
// create new embeddable to transfer to originatingApp
209209
stateTransfer.navigateToWithEmbeddablePackage(originatingApp, {
210-
state: { type: 'wizard', input: { savedObjectId: id } },
210+
state: { type: VISBUILDER_SAVED_OBJECT, input: { savedObjectId: id } },
211211
});
212212
return { id };
213213
} else {

src/plugins/vis_builder/public/application/utils/use/use_saved_vis_builder_vis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const useSavedVisBuilderVis = (visualizationIdFromUrl: string | undefined
9191
const managementRedirectTarget = {
9292
[PLUGIN_ID]: {
9393
app: 'management',
94-
path: `opensearch-dashboards/objects/savedWizard/${visualizationIdFromUrl}`,
94+
path: `opensearch-dashboards/objects/savedVisBuilder/${visualizationIdFromUrl}`,
9595
},
9696
};
9797

src/plugins/vis_builder/public/embeddable/vis_builder_embeddable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class VisBuilderEmbeddable extends Embeddable<SavedObjectEmbeddableInput,
183183
this.timeRange = cloneDeep(this.input.timeRange);
184184

185185
const div = document.createElement('div');
186-
div.className = `wizard visualize panel-content panel-content--fullWidth`;
186+
div.className = `visBuilder visualize panel-content panel-content--fullWidth`;
187187
node.appendChild(div);
188188

189189
this.node = div;
@@ -201,7 +201,7 @@ export class VisBuilderEmbeddable extends Embeddable<SavedObjectEmbeddableInput,
201201
div.setAttribute('data-description', this.savedVisBuilder.description);
202202
}
203203

204-
div.setAttribute('data-test-subj', 'wizardLoader');
204+
div.setAttribute('data-test-subj', 'visBuilderLoader');
205205

206206
this.subscriptions.push(this.handler.loading$.subscribe(this.onContainerLoading));
207207
this.subscriptions.push(this.handler.render$.subscribe(this.onContainerRender));

src/plugins/vis_builder/public/embeddable/vis_builder_embeddable_factory.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
VisBuilderOutput,
2727
VISBUILDER_EMBEDDABLE,
2828
} from './vis_builder_embeddable';
29-
import visBuilderIcon from '../assets/wizard_icon.svg';
29+
import visBuilderIcon from '../assets/vis_builder_icon.svg';
3030
import {
3131
getHttp,
3232
getSavedVisBuilderLoader,

src/plugins/vis_builder/public/plugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import {
2020
VisBuilderStart,
2121
} from './types';
2222
import { VisBuilderEmbeddableFactoryDefinition, VISBUILDER_EMBEDDABLE } from './embeddable';
23-
import visBuilderIconSecondaryFill from './assets/wizard_icon_secondary_fill.svg';
24-
import visBuilderIcon from './assets/wizard_icon.svg';
23+
import visBuilderIconSecondaryFill from './assets/vis_builder_icon_secondary_fill.svg';
24+
import visBuilderIcon from './assets/vis_builder_icon.svg';
2525
import {
2626
EDIT_PATH,
2727
PLUGIN_ID,
@@ -122,15 +122,15 @@ export class VisBuilderPlugin
122122
name: PLUGIN_ID,
123123
title: PLUGIN_NAME,
124124
description: i18n.translate('visBuilder.visPicker.description', {
125-
defaultMessage: 'Create visualizations using the new Visualization Builder',
125+
defaultMessage: 'Create visualizations using the new VisBuilder',
126126
}),
127127
icon: visBuilderIconSecondaryFill,
128128
stage: 'experimental',
129129
aliasApp: PLUGIN_ID,
130130
aliasPath: '#/',
131131
appExtensions: {
132132
visualizations: {
133-
docTypes: [PLUGIN_ID],
133+
docTypes: [VISBUILDER_SAVED_OBJECT],
134134
toListItem: ({ id, attributes, updated_at: updatedAt }) => ({
135135
description: attributes?.description,
136136
editApp: PLUGIN_ID,

src/plugins/vis_builder/server/capabilities_provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
export const capabilitiesProvider = () => ({
7-
wizard: {
7+
'visualization-visbuilder': {
88
// TODO: investigate which capabilities we need to provide
99
// createNew: true,
1010
// createShortUrl: true,

src/plugins/vis_builder/server/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class VisBuilderPlugin implements Plugin<VisBuilderPluginSetup, VisBuilde
2323
}
2424

2525
public setup({ capabilities, http, savedObjects }: CoreSetup) {
26-
this.logger.debug('wizard: Setup');
26+
this.logger.debug('vis-builder: Setup');
2727

2828
// Register saved object types
2929
savedObjects.registerType(visBuilderSavedObjectType);
@@ -35,7 +35,7 @@ export class VisBuilderPlugin implements Plugin<VisBuilderPluginSetup, VisBuilde
3535
}
3636

3737
public start(_core: CoreStart) {
38-
this.logger.debug('wizard: Started');
38+
this.logger.debug('vis-builder: Started');
3939
return {};
4040
}
4141

src/plugins/vis_builder/server/saved_objects/vis_builder_app.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
VisBuilderSavedObjectAttributes,
1111
VISBUILDER_SAVED_OBJECT,
1212
} from '../../common';
13-
import { visBuilderSavedObjectTypeMigrations } from './vis_builder_migration';
1413

1514
export const visBuilderSavedObjectType: SavedObjectsType = {
1615
name: VISBUILDER_SAVED_OBJECT,
@@ -22,15 +21,15 @@ export const visBuilderSavedObjectType: SavedObjectsType = {
2221
importableAndExportable: true,
2322
getTitle: ({ attributes: { title } }: SavedObject<VisBuilderSavedObjectAttributes>) => title,
2423
getEditUrl: ({ id }: SavedObject) =>
25-
`/management/opensearch-dashboards/objects/savedWizard/${encodeURIComponent(id)}`,
24+
`/management/opensearch-dashboards/objects/savedVisBuilder/${encodeURIComponent(id)}`,
2625
getInAppUrl({ id }: SavedObject) {
2726
return {
2827
path: `/app/${PLUGIN_ID}${EDIT_PATH}/${encodeURIComponent(id)}`,
29-
uiCapabilitiesPath: 'wizard.show',
28+
uiCapabilitiesPath: 'visualization-visbuilder.show',
3029
};
3130
},
3231
},
33-
migrations: visBuilderSavedObjectTypeMigrations,
32+
migrations: {},
3433
mappings: {
3534
properties: {
3635
title: {

src/plugins/vis_builder/server/saved_objects/vis_builder_migration.test.ts

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)