Skip to content

Commit

Permalink
Save visualization on save modal, VisBuilder for chart type
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 committed Oct 26, 2022
1 parent 227388f commit 9b90176
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
.osdSavedObjectSaveModal {
width: $euiSizeXXL * 10;
}

.osdSavedObjectSaveModalVisBuilder {
color: $euiTextSubduedColor;
font-size: $euiFontSizeM;
}

.osdSavedObjectSaveModalBadge {
margin-left: $euiSizeS;
vertical-align: text-bottom;
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ import {
EuiSwitch,
EuiSwitchEvent,
EuiTextArea,
EuiBadge,
EuiBetaBadge,
} from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import React from 'react';
Expand All @@ -72,7 +70,6 @@ interface Props {
options?: React.ReactNode | ((state: SaveModalState) => React.ReactNode);
description?: string;
showDescription: boolean;
isExperimental?: boolean;
}

export interface SaveModalState {
Expand Down Expand Up @@ -114,7 +111,6 @@ export class SavedObjectSaveModal extends React.Component<Props, SaveModalState>
defaultMessage="Save {objectType}"
values={{ objectType: this.props.objectType }}
/>
{this.renderExperimentalBadge()}
</EuiModalHeaderTitle>
</EuiModalHeader>

Expand Down Expand Up @@ -171,28 +167,6 @@ export class SavedObjectSaveModal extends React.Component<Props, SaveModalState>
);
}

private renderExperimentalBadge = () => {
if (!this.props.isExperimental) {
return;
}

return (
<EuiModalHeaderTitle className="osdSavedObjectSaveModalVisBuilder">
<FormattedMessage
id="savedObjects.saveModal.saveSubTitle"
defaultMessage="Visualization Builder"
/>
<EuiBetaBadge
label="Lab"
iconType="beaker"
color="subdued"
size="s"
className="osdSavedObjectSaveModalBadge"
/>
</EuiModalHeaderTitle>
);
};

private renderViewDescription = () => {
if (!this.props.showDescription) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ interface OriginSaveModalProps {
objectType: string;
onClose: () => void;
onSave: (props: OnSaveProps & { returnToOrigin: boolean }) => void;
isExperimental?: boolean;
}

export function SavedObjectSaveModalOrigin(props: OriginSaveModalProps) {
Expand Down Expand Up @@ -126,7 +125,6 @@ export function SavedObjectSaveModalOrigin(props: OriginSaveModalProps) {
options={getReturnToOriginSwitch}
description={documentInfo.description}
showDescription={true}
isExperimental={props.isExperimental}
/>
);
}
2 changes: 1 addition & 1 deletion src/plugins/vis_builder/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
export const PLUGIN_ID = 'wizard';
export const PLUGIN_NAME = 'Wizard';
export const VISUALIZE_ID = 'visualize';
export const VIS_BUILDER_TYPE_SHORTHAND = 'VisBuilder';
export const EDIT_PATH = '/edit';
export const VIS_BUILDER_STATE = 'experimental';
export const VIS_BUILDER_CHART_TYPE = 'VisBuilder';

export {
VisBuilderSavedObjectAttributes,
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, VIS_BUILDER_STATE } from '../../../common';
import { EDIT_PATH } from '../../../common';
import { setEditorState } from './state_management/metadata_slice';
export interface TopNavConfigParams {
visualizationIdFromUrl: string;
Expand Down Expand Up @@ -99,7 +99,6 @@ export const getTopNavConfig = (
onClose={() => {}}
originatingApp={originatingApp}
getAppNameFromId={stateTransfer.getAppNameFromId}
isExperimental={VIS_BUILDER_STATE === 'experimental' ? true : false}
/>
);

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/vis_builder/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
PLUGIN_ID,
PLUGIN_NAME,
VISBUILDER_SAVED_OBJECT,
VIS_BUILDER_TYPE_SHORTHAND,
VIS_BUILDER_CHART_TYPE,
} from '../common';
import { TypeService } from './services/type_service';
import { getPreloadedStore } from './application/utils/state_management';
Expand Down Expand Up @@ -140,7 +140,7 @@ export class VisBuilderPlugin
savedObjectType: VISBUILDER_SAVED_OBJECT,
stage: 'experimental',
title: attributes?.title,
typeTitle: VIS_BUILDER_TYPE_SHORTHAND,
typeTitle: VIS_BUILDER_CHART_TYPE,
}),
},
},
Expand Down

0 comments on commit 9b90176

Please sign in to comment.