Skip to content

Commit

Permalink
[VisBuilder] Change VisBuilder from experimental to production (#6436) (
Browse files Browse the repository at this point in the history
#6971)

* [VisBuilder] Change VisBuilder from experimental to production

Issue Resolve
#6435

* Changeset file for PR #6436 created/updated

---------


(cherry picked from commit 75e6087)

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 7, 2024
1 parent 310c240 commit 9b6325c
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 199 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/6436.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [VisBuilder] Change VisBuilder from experimental to production ([#6436](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6436))

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $keyframe-multiplier: calc(1 / $animation-multiplier);
.vbWorkspace {
display: grid;
-ms-grid-rows: auto $euiSizeM 1fr;
grid-template-rows: auto 1fr;
grid-template-rows: 1fr;
grid-area: workspace;
grid-gap: $euiSizeM;
padding: $euiSizeM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { i18n } from '@osd/i18n';
import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiPanel } from '@elastic/eui';
import { EuiEmptyPrompt, EuiFlexItem, EuiIcon, EuiPanel } from '@elastic/eui';
import React, { useState, useMemo, useEffect, useLayoutEffect } from 'react';
import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public';
import { IExpressionLoaderParams } from '../../../../expressions/public';
Expand All @@ -18,7 +18,6 @@ import hand_field from '../../assets/hand_field.svg';
import fields_bg from '../../assets/fields_bg.svg';

import './workspace.scss';
import { ExperimentalInfo } from './experimental_info';
import { handleVisEvent } from '../utils/handle_vis_event';

export const WorkspaceUI = () => {
Expand Down Expand Up @@ -105,11 +104,6 @@ export const WorkspaceUI = () => {

return (
<section className="vbWorkspace">
<EuiFlexGroup className="vbCanvasControls">
<EuiFlexItem>
<ExperimentalInfo />
</EuiFlexItem>
</EuiFlexGroup>
<EuiPanel className="vbCanvas" data-test-subj="visualizationLoader">
{expression ? (
<ReactExpressionRenderer
Expand Down
34 changes: 0 additions & 34 deletions src/plugins/vis_builder/public/embeddable/disabled_embeddable.tsx

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,21 @@ import {
IContainer,
SavedObjectEmbeddableInput,
} from '../../../embeddable/public';
import { VISUALIZE_ENABLE_LABS_SETTING } from '../../../visualizations/public';
import {
EDIT_PATH,
PLUGIN_ID,
PLUGIN_NAME,
VisBuilderSavedObjectAttributes,
VISBUILDER_SAVED_OBJECT,
} from '../../common';
import { DisabledEmbeddable } from './disabled_embeddable';
import {
VisBuilderEmbeddable,
VisBuilderInput,
VisBuilderOutput,
VISBUILDER_EMBEDDABLE,
} from './vis_builder_embeddable';
import { getStateFromSavedObject } from '../saved_visualizations/transforms';
import {
getHttp,
getSavedVisBuilderLoader,
getTimeFilter,
getUISettings,
} from '../plugin_services';
import { getHttp, getSavedVisBuilderLoader, getTimeFilter } from '../plugin_services';
import { StartServicesGetter } from '../../../opensearch_dashboards_utils/public';
import { VisBuilderPluginStartDependencies } from '../types';

Expand All @@ -45,7 +38,7 @@ export class VisBuilderEmbeddableFactory
EmbeddableFactoryDefinition<
SavedObjectEmbeddableInput,
VisBuilderOutput | EmbeddableOutput,
VisBuilderEmbeddable | DisabledEmbeddable,
VisBuilderEmbeddable,
VisBuilderSavedObjectAttributes
> {
public readonly type = VISBUILDER_EMBEDDABLE;
Expand Down Expand Up @@ -75,17 +68,11 @@ export class VisBuilderEmbeddableFactory
savedObjectId: string,
input: VisBuilderInput,
parent?: IContainer
): Promise<VisBuilderEmbeddable | ErrorEmbeddable | DisabledEmbeddable> {
): Promise<VisBuilderEmbeddable | ErrorEmbeddable> {
try {
const savedObject = await getSavedVisBuilderLoader().get(savedObjectId);
const editPath = `${EDIT_PATH}/${savedObjectId}`;
const editUrl = getHttp().basePath.prepend(`/app/${PLUGIN_ID}${editPath}`);
const isLabsEnabled = getUISettings().get<boolean>(VISUALIZE_ENABLE_LABS_SETTING);

if (!isLabsEnabled) {
return new DisabledEmbeddable(PLUGIN_NAME, input);
}

const savedVis = getStateFromSavedObject(savedObject);
const indexPatternService = this.deps.start().plugins.data.indexPatterns;
const indexPattern = await indexPatternService.get(
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_builder/public/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe('VisBuilderPlugin', () => {
title: PLUGIN_NAME,
aliasPath: '#/',
aliasApp: PLUGIN_ID,
stage: 'experimental',
})
);
});
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/vis_builder/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ export class VisBuilderPlugin
defaultMessage: 'Create visualizations using the new VisBuilder',
}),
icon: 'visBuilder',
stage: 'experimental',
aliasApp: PLUGIN_ID,
aliasPath: '#/',
appExtensions: {
Expand All @@ -205,7 +204,6 @@ export class VisBuilderPlugin
icon: 'visBuilder',
id,
savedObjectType: VISBUILDER_SAVED_OBJECT,
stage: 'experimental',
title: attributes?.title,
typeTitle: VIS_BUILDER_CHART_TYPE,
updated_at: updatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface VisualizationTypeOptions<T = any> {
readonly title: string;
readonly description?: string;
readonly icon: IconType;
readonly stage?: 'experimental' | 'production';
readonly stage?: 'production';
readonly ui: {
containerConfig: {
data: DataTabConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class VisualizationType implements IVisualizationType {
public readonly title: string;
public readonly description: string;
public readonly icon: IconType;
public readonly stage: 'experimental' | 'production';
public readonly stage: 'production';
public readonly ui: IVisualizationType['ui'];
public readonly toExpression: (
state: RenderState,
Expand Down
51 changes: 0 additions & 51 deletions test/functional/apps/vis_builder/_experimental_vis.ts

This file was deleted.

1 change: 0 additions & 1 deletion test/functional/apps/vis_builder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
});

loadTestFile(require.resolve('./_base'));
loadTestFile(require.resolve('./_experimental_vis'));
});
}

0 comments on commit 9b6325c

Please sign in to comment.