Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VisBuilder] Change VisBuilder from experimental to production #6436

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

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'));
});
}
Loading