Skip to content

Commit

Permalink
Finalize plugin-id and plugin-name and saved-object-type
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 committed Oct 27, 2022
1 parent 55d8170 commit bd16e39
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 18 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/vis_builder/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_builder/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "visBuilder",
"configPath": "visBuilder",
"version": "1.0.0",
"opensearchDashboardsVersion": "opensearchDashboards",
"server": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_builder/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_builder/server/capabilities_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

export const capabilitiesProvider = () => ({
visBuilder: {
'visualization-visbuilder': {
// TODO: investigate which capabilities we need to provide
// createNew: true,
// createShortUrl: true,
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/vis_builder/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class VisBuilderPlugin implements Plugin<VisBuilderPluginSetup, VisBuilde
}

public setup({ capabilities, http, savedObjects }: CoreSetup) {
this.logger.debug('visBuilder: Setup');
this.logger.debug('vis-builder: Setup');

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

public start(_core: CoreStart) {
this.logger.debug('visBuilder: Started');
this.logger.debug('vis-builder: Started');
return {};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const visBuilderSavedObjectType: SavedObjectsType = {
getInAppUrl({ id }: SavedObject) {
return {
path: `/app/${PLUGIN_ID}${EDIT_PATH}/${encodeURIComponent(id)}`,
uiCapabilitiesPath: 'visBuilder.show',
uiCapabilitiesPath: 'visualization-visbuilder.show',
};
},
},
Expand Down
2 changes: 1 addition & 1 deletion test/common/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
`--visBuilder.enabled=true`,
`--vis_builder.enabled=true`,
],
},
services,
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_chart_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'Timeline',
'Vega',
'Vertical Bar',
'Wizard', // TODO: Update to final name when ready
'Visualization Builder',
];
if (!isOss) {
expectedChartTypes.push('Maps', 'Lens');
Expand Down

0 comments on commit bd16e39

Please sign in to comment.