From 96c036d59010e0e6adbbb42f421af76af056f9ce Mon Sep 17 00:00:00 2001
From: Daniil Suleiman <31325372+sulemanof@users.noreply.github.com>
Date: Fri, 18 Oct 2019 16:26:26 +0300
Subject: [PATCH] [Vis: Default editor] EUIficate Vega options tab (#47473)
* EUIficate Vega options tab
* Update list of dependencies
* Fix comments
* Adjust styles
---
.../vis_type_vega/public/_vega_editor.scss | 33 +----
.../vis_type_vega/public/components/index.ts | 20 +++
.../public/components/vega_actions_menu.tsx | 85 ++++++++++++
.../public/components/vega_help_menu.tsx | 91 +++++++++++++
.../public/components/vega_vis_editor.tsx | 101 ++++++++++++++
.../public/help_menus/vega_action_menu.js | 114 ----------------
.../public/help_menus/vega_help_menu.js | 126 ------------------
.../public/shim/legacy_dependencies_plugin.ts | 5 +-
.../public/shim/vega_legacy_module.ts | 49 -------
.../public/vega_editor_controller.js | 86 ------------
.../public/vega_editor_template.html | 30 -----
.../vis_type_vega/public/vega_type.ts | 4 +-
.../translations/translations/ja-JP.json | 3 -
.../translations/translations/zh-CN.json | 3 -
14 files changed, 307 insertions(+), 443 deletions(-)
create mode 100644 src/legacy/core_plugins/vis_type_vega/public/components/index.ts
create mode 100644 src/legacy/core_plugins/vis_type_vega/public/components/vega_actions_menu.tsx
create mode 100644 src/legacy/core_plugins/vis_type_vega/public/components/vega_help_menu.tsx
create mode 100644 src/legacy/core_plugins/vis_type_vega/public/components/vega_vis_editor.tsx
delete mode 100644 src/legacy/core_plugins/vis_type_vega/public/help_menus/vega_action_menu.js
delete mode 100644 src/legacy/core_plugins/vis_type_vega/public/help_menus/vega_help_menu.js
delete mode 100644 src/legacy/core_plugins/vis_type_vega/public/shim/vega_legacy_module.ts
delete mode 100644 src/legacy/core_plugins/vis_type_vega/public/vega_editor_controller.js
delete mode 100644 src/legacy/core_plugins/vis_type_vega/public/vega_editor_template.html
diff --git a/src/legacy/core_plugins/vis_type_vega/public/_vega_editor.scss b/src/legacy/core_plugins/vis_type_vega/public/_vega_editor.scss
index 94ba9a9c6bc43..f4276541d5d9e 100644
--- a/src/legacy/core_plugins/vis_type_vega/public/_vega_editor.scss
+++ b/src/legacy/core_plugins/vis_type_vega/public/_vega_editor.scss
@@ -1,41 +1,22 @@
.visEditor--vega {
.visEditorSidebar__config {
padding: 0;
- // Makes sure the vega options dropdown menu is visible
- overflow: inherit;
+ position: relative;
}
- // The following is necessary for the Vega editor to expand to full height of the editor panel
- .visEditorSidebar__config,
.visEditorSidebar__options {
- @include flex-parent(1, 1, auto);
-
- > * {
- @include flex-parent(1, 1, auto);
- }
- }
-
- @include euiBreakpoint('xs', 's', 'm') {
- .visEditor__collapsibleSidebar {
- flex-grow: 1;
- }
+ @include euiScrollBar;
+ flex-shrink: 1;
+ overflow-y: auto;
}
}
-
.vgaEditor {
- @include flex-parent(1, 1, auto);
- position: relative;
-
@include euiBreakpoint('xs', 's', 'm') {
- min-height: $euiSize * 15;
+ @include euiScrollBar;
+ max-height: $euiSize * 15;
+ overflow-y: auto;
}
-
- position: relative;
-}
-
-.vgaEditor__aceEditor {
- flex: 1 1 auto;
}
.vgaEditor__aceEditorActions {
diff --git a/src/legacy/core_plugins/vis_type_vega/public/components/index.ts b/src/legacy/core_plugins/vis_type_vega/public/components/index.ts
new file mode 100644
index 0000000000000..90f067c778fd2
--- /dev/null
+++ b/src/legacy/core_plugins/vis_type_vega/public/components/index.ts
@@ -0,0 +1,20 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+export { VegaVisEditor } from './vega_vis_editor';
diff --git a/src/legacy/core_plugins/vis_type_vega/public/components/vega_actions_menu.tsx b/src/legacy/core_plugins/vis_type_vega/public/components/vega_actions_menu.tsx
new file mode 100644
index 0000000000000..71a88b47a8be3
--- /dev/null
+++ b/src/legacy/core_plugins/vis_type_vega/public/components/vega_actions_menu.tsx
@@ -0,0 +1,85 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React, { useState, useCallback } from 'react';
+import { EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } from '@elastic/eui';
+import { FormattedMessage } from '@kbn/i18n/react';
+import { i18n } from '@kbn/i18n';
+
+interface VegaActionsMenuProps {
+ formatHJson(): void;
+ formatJson(): void;
+}
+
+function VegaActionsMenu({ formatHJson, formatJson }: VegaActionsMenuProps) {
+ const [isPopoverOpen, setIsPopoverOpen] = useState(false);
+
+ const onButtonClick = useCallback(() => setIsPopoverOpen(isOpen => !isOpen), []);
+ const onHJsonCLick = useCallback(() => {
+ formatHJson();
+ setIsPopoverOpen(false);
+ }, [isPopoverOpen, formatHJson]);
+
+ const onJsonCLick = useCallback(() => {
+ formatJson();
+ setIsPopoverOpen(false);
+ }, [isPopoverOpen, formatJson]);
+
+ const closePopover = useCallback(() => setIsPopoverOpen(false), []);
+
+ const button = (
+
+ );
+
+ const items = [
+
+
+ ,
+
+
+ ,
+ ];
+
+ return (
+
+ );
+}
+
+export { VegaActionsMenu };
diff --git a/src/legacy/core_plugins/vis_type_vega/public/components/vega_help_menu.tsx b/src/legacy/core_plugins/vis_type_vega/public/components/vega_help_menu.tsx
new file mode 100644
index 0000000000000..e4443c0058e9b
--- /dev/null
+++ b/src/legacy/core_plugins/vis_type_vega/public/components/vega_help_menu.tsx
@@ -0,0 +1,91 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React, { useCallback, useState } from 'react';
+import { EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } from '@elastic/eui';
+import { FormattedMessage } from '@kbn/i18n/react';
+import { i18n } from '@kbn/i18n';
+
+function VegaHelpMenu() {
+ const [isPopoverOpen, setIsPopoverOpen] = useState(false);
+ const onButtonClick = useCallback(() => setIsPopoverOpen(!isPopoverOpen), [isPopoverOpen]);
+
+ const closePopover = useCallback(() => setIsPopoverOpen(false), []);
+
+ const button = (
+
+ );
+
+ const items = [
+
+
+ ,
+
+
+ ,
+
+
+ ,
+ ];
+
+ return (
+
+ );
+}
+
+export { VegaHelpMenu };
diff --git a/src/legacy/core_plugins/vis_type_vega/public/components/vega_vis_editor.tsx b/src/legacy/core_plugins/vis_type_vega/public/components/vega_vis_editor.tsx
new file mode 100644
index 0000000000000..6d14acf6ec7aa
--- /dev/null
+++ b/src/legacy/core_plugins/vis_type_vega/public/components/vega_vis_editor.tsx
@@ -0,0 +1,101 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React, { useCallback } from 'react';
+import { EuiCodeEditor } from '@elastic/eui';
+import compactStringify from 'json-stringify-pretty-compact';
+// @ts-ignore
+import hjson from 'hjson';
+import { i18n } from '@kbn/i18n';
+
+import { toastNotifications } from 'ui/notify';
+import { VisOptionsProps } from 'ui/vis/editors/default';
+import { VisParams } from '../vega_fn';
+import { VegaHelpMenu } from './vega_help_menu';
+import { VegaActionsMenu } from './vega_actions_menu';
+
+const aceOptions = {
+ maxLines: Infinity,
+ highlightActiveLine: false,
+ showPrintMargin: false,
+ tabSize: 2,
+ useSoftTabs: true,
+ wrap: true,
+};
+
+const hjsonStringifyOptions = {
+ bracesSameLine: true,
+ keepWsc: true,
+};
+
+function format(value: string, stringify: typeof compactStringify, options?: any) {
+ try {
+ const spec = hjson.parse(value, { legacyRoot: false, keepWsc: true });
+ return stringify(spec, options);
+ } catch (err) {
+ // This is a common case - user tries to format an invalid HJSON text
+ toastNotifications.addError(err, {
+ title: i18n.translate('visTypeVega.editor.formatError', {
+ defaultMessage: 'Error formatting spec',
+ }),
+ });
+
+ return value;
+ }
+}
+
+function VegaVisEditor({ stateParams, setValue }: VisOptionsProps) {
+ const onChange = useCallback(
+ (value: string) => {
+ setValue('spec', value);
+ },
+ [setValue]
+ );
+
+ const formatJson = useCallback(
+ () => setValue('spec', format(stateParams.spec, compactStringify)),
+ [setValue, stateParams.spec]
+ );
+
+ const formatHJson = useCallback(
+ () => setValue('spec', format(stateParams.spec, hjson.stringify, hjsonStringifyOptions)),
+ [setValue, stateParams.spec]
+ );
+
+ return (
+
+ );
+}
+
+export { VegaVisEditor };
diff --git a/src/legacy/core_plugins/vis_type_vega/public/help_menus/vega_action_menu.js b/src/legacy/core_plugins/vis_type_vega/public/help_menus/vega_action_menu.js
deleted file mode 100644
index 6f136e3679f30..0000000000000
--- a/src/legacy/core_plugins/vis_type_vega/public/help_menus/vega_action_menu.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import PropTypes from 'prop-types';
-
-import React, {
- Component,
-} from 'react';
-
-import {
- EuiButtonIcon,
- EuiContextMenuPanel,
- EuiContextMenuItem,
- EuiPopover,
-} from '@elastic/eui';
-
-import { FormattedMessage } from '@kbn/i18n/react';
-
-export class VegaActionsMenu extends Component {
- constructor(props) {
- super(props);
-
- this.state = {
- isPopoverOpen: false,
- };
- }
-
- onButtonClick = () => {
- this.setState(prevState => ({
- isPopoverOpen: !prevState.isPopoverOpen,
- }));
- };
-
- closePopover = () => {
- this.setState({
- isPopoverOpen: false,
- });
- };
-
- render() {
- const button = (
-
- }
- />
- );
-
- const items = [
- (
- { this.closePopover(); this.props.formatHJson(event); }}
- >
-
-
- ), (
- { this.closePopover(); this.props.formatJson(event); }}
- >
-
-
- )
- ];
-
- return (
-
- );
- }
-}
-
-VegaActionsMenu.propTypes = {
- formatHJson: PropTypes.func.isRequired,
- formatJson: PropTypes.func.isRequired,
-};
diff --git a/src/legacy/core_plugins/vis_type_vega/public/help_menus/vega_help_menu.js b/src/legacy/core_plugins/vis_type_vega/public/help_menus/vega_help_menu.js
deleted file mode 100644
index fe0819a729490..0000000000000
--- a/src/legacy/core_plugins/vis_type_vega/public/help_menus/vega_help_menu.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React, {
- Component,
-} from 'react';
-
-import {
- EuiButtonIcon,
- EuiContextMenuPanel,
- EuiContextMenuItem,
- EuiPopover,
-} from '@elastic/eui';
-
-import { FormattedMessage } from '@kbn/i18n/react';
-
-export class VegaHelpMenu extends Component {
- constructor(props) {
- super(props);
-
- this.state = {
- isPopoverOpen: false,
- };
- }
-
- onButtonClick = () => {
- this.setState(prevState => ({
- isPopoverOpen: !prevState.isPopoverOpen,
- }));
- };
-
- closePopover = () => {
- this.setState({
- isPopoverOpen: false,
- });
- };
-
- render() {
- const button = (
-
- }
- />
- );
-
- const items = [
- (
- { this.closePopover(); }}
- >
-
-
- ), (
- { this.closePopover(); }}
- >
-
-
- ), (
- { this.closePopover(); }}
- >
-
-
- )
- ];
-
- return (
-
- );
- }
-}
diff --git a/src/legacy/core_plugins/vis_type_vega/public/shim/legacy_dependencies_plugin.ts b/src/legacy/core_plugins/vis_type_vega/public/shim/legacy_dependencies_plugin.ts
index 2c4c2d2491fc4..af4425e3d5548 100644
--- a/src/legacy/core_plugins/vis_type_vega/public/shim/legacy_dependencies_plugin.ts
+++ b/src/legacy/core_plugins/vis_type_vega/public/shim/legacy_dependencies_plugin.ts
@@ -18,9 +18,9 @@
*/
import chrome from 'ui/chrome';
+import 'ui/vis/map/service_settings';
import 'ui/es'; // required for $injector.get('es') below
import { CoreStart, Plugin } from 'kibana/public';
-import { initVegaLegacyModule } from './vega_legacy_module';
/** @internal */
export interface LegacyDependenciesPluginSetup {
@@ -31,9 +31,6 @@ export interface LegacyDependenciesPluginSetup {
export class LegacyDependenciesPlugin
implements Plugin, void> {
public async setup() {
- // Init kibana/vega AngularJS module.
- initVegaLegacyModule();
-
const $injector = await chrome.dangerouslyGetActiveInjector();
return {
diff --git a/src/legacy/core_plugins/vis_type_vega/public/shim/vega_legacy_module.ts b/src/legacy/core_plugins/vis_type_vega/public/shim/vega_legacy_module.ts
deleted file mode 100644
index 4dc6f03821649..0000000000000
--- a/src/legacy/core_plugins/vis_type_vega/public/shim/vega_legacy_module.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import 'ngreact';
-import 'brace/mode/hjson';
-import 'brace/ext/searchbox';
-import 'ui/accessibility/kbn_ui_ace_keyboard_mode';
-import 'ui/vis/map/service_settings';
-
-import { once } from 'lodash';
-// @ts-ignore
-import { uiModules } from 'ui/modules';
-import { wrapInI18nContext } from 'ui/i18n';
-
-// @ts-ignore
-import { VegaEditorController } from '../vega_editor_controller';
-// @ts-ignore
-import { VegaHelpMenu } from '../help_menus/vega_help_menu';
-// @ts-ignore
-import { VegaActionsMenu } from '../help_menus/vega_action_menu';
-
-/** @internal */
-export const initVegaLegacyModule = once((): void => {
- uiModules
- .get('kibana/vega', ['react'])
- .controller('VegaEditorController', VegaEditorController)
- .directive('vegaActionsMenu', (reactDirective: any) =>
- reactDirective(wrapInI18nContext(VegaActionsMenu))
- )
- .directive('vegaHelpMenu', (reactDirective: any) =>
- reactDirective(wrapInI18nContext(VegaHelpMenu))
- );
-});
diff --git a/src/legacy/core_plugins/vis_type_vega/public/vega_editor_controller.js b/src/legacy/core_plugins/vis_type_vega/public/vega_editor_controller.js
deleted file mode 100644
index f91beff59a34f..0000000000000
--- a/src/legacy/core_plugins/vis_type_vega/public/vega_editor_controller.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import compactStringify from 'json-stringify-pretty-compact';
-import hjson from 'hjson';
-import { toastNotifications } from 'ui/notify';
-import { i18n } from '@kbn/i18n';
-
-export class VegaEditorController {
- constructor($scope) {
- this.$scope = $scope;
- $scope.aceLoaded = (editor) => {
- editor.$blockScrolling = Infinity;
-
- const session = editor.getSession();
- session.setTabSize(2);
- session.setUseSoftTabs(true);
-
- this.aceEditor = editor;
- };
-
- $scope.formatJson = (event) => {
- this._format(event, compactStringify, {
- maxLength: this._getCodeWidth(),
- });
- };
-
- $scope.formatHJson = (event) => {
- this._format(event, hjson.stringify, {
- condense: this._getCodeWidth(),
- bracesSameLine: true,
- keepWsc: true,
- });
- };
- }
-
- _getCodeWidth() {
- return this.aceEditor.getSession().getWrapLimit();
- }
-
- _format(event, stringify, opts) {
- event.preventDefault();
-
- let newSpec;
- try {
- const spec = hjson.parse(this.aceEditor.getSession().doc.getValue(), { legacyRoot: false, keepWsc: true });
- newSpec = stringify(spec, opts);
- } catch (err) {
- // This is a common case - user tries to format an invalid HJSON text
- toastNotifications.addError(err, {
- title: i18n.translate('visTypeVega.editor.formatError', {
- defaultMessage: 'Error formatting spec',
- }),
- });
- return;
- }
-
- // ui-ace only accepts changes from the editor when they
- // happen outside of a digest cycle
- // Per @spalger, we used $$postDigest() instead of setTimeout(() => {}, 0)
- // because it better described the intention.
- this.$scope.$$postDigest(() => {
- // set the new value to the session doc so that it
- // is treated as an edit by ace: ace adds it to the
- // undo stack and emits it as a change like all
- // other edits
- this.aceEditor.getSession().doc.setValue(newSpec);
- });
- }
-}
diff --git a/src/legacy/core_plugins/vis_type_vega/public/vega_editor_template.html b/src/legacy/core_plugins/vis_type_vega/public/vega_editor_template.html
deleted file mode 100644
index 4d5d6189f3302..0000000000000
--- a/src/legacy/core_plugins/vis_type_vega/public/vega_editor_template.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
diff --git a/src/legacy/core_plugins/vis_type_vega/public/vega_type.ts b/src/legacy/core_plugins/vis_type_vega/public/vega_type.ts
index 6ffcd8867ffea..0d5290ddbefc7 100644
--- a/src/legacy/core_plugins/vis_type_vega/public/vega_type.ts
+++ b/src/legacy/core_plugins/vis_type_vega/public/vega_type.ts
@@ -24,9 +24,9 @@ import { DefaultEditorSize } from 'ui/vis/editor_size';
// @ts-ignore
import { defaultFeedbackMessage } from 'ui/vis/default_feedback_message';
-import vegaEditorTemplate from './vega_editor_template.html';
import { visFactory } from '../../visualizations/public';
import { VegaVisualizationDependencies } from './plugin';
+import { VegaVisEditor } from './components';
import { createVegaRequestHandler } from './vega_request_handler';
// @ts-ignore
@@ -48,7 +48,7 @@ export const createVegaTypeDefinition = (dependencies: VegaVisualizationDependen
icon: 'visVega',
visConfig: { defaults: { spec: defaultSpec } },
editorConfig: {
- optionsTemplate: vegaEditorTemplate,
+ optionsTemplate: VegaVisEditor,
enableAutoApply: true,
defaultSize: DefaultEditorSize.MEDIUM,
},
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index d3d1d4a75fb9b..429e8e391a457 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -3162,11 +3162,8 @@
"visTypeVega.editor.formatError": "仕様のフォーマット中にエラーが発生",
"visTypeVega.editor.reformatAsHJSONButtonLabel": "HJSON に変換",
"visTypeVega.editor.reformatAsJSONButtonLabel": "JSON に変換しコメントを削除",
- "visTypeVega.editor.vegaDocumentationLinkText": "Vega ドキュメント",
"visTypeVega.editor.vegaEditorOptionsButtonAriaLabel": "Vega エディターオプション",
"visTypeVega.editor.vegaHelpButtonAriaLabel": "Vega ヘルプ",
- "visTypeVega.editor.vegaHelpLinkText": "Kibana Vega ヘルプ",
- "visTypeVega.editor.vegaLiteDocumentationLinkText": "Vega-Lite ドキュメンテーション",
"visTypeVega.emsFileParser.emsFileNameDoesNotExistErrorMessage": "{emsfile} {emsfileName} が存在しません",
"visTypeVega.emsFileParser.missingNameOfFileErrorMessage": "{dataUrlParamValue} の {dataUrlParam} には {nameParam} パラメーター (ファイル名) が必要です",
"visTypeVega.esQueryParser.autointervalValueTypeErrorMessage": "{autointerval} は文字 {trueValue} または数字である必要があります",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 6f68296cadf95..1180539e4f263 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -3163,11 +3163,8 @@
"visTypeVega.editor.formatError": "格式化规范时出错",
"visTypeVega.editor.reformatAsHJSONButtonLabel": "重新格式化为 HJSON",
"visTypeVega.editor.reformatAsJSONButtonLabel": "重新格式化为 JSON,删除注释",
- "visTypeVega.editor.vegaDocumentationLinkText": "Vega 文档",
"visTypeVega.editor.vegaEditorOptionsButtonAriaLabel": "Vega 编辑器选项",
"visTypeVega.editor.vegaHelpButtonAriaLabel": "Vega 帮助",
- "visTypeVega.editor.vegaHelpLinkText": "Kibana Vega 帮助",
- "visTypeVega.editor.vegaLiteDocumentationLinkText": "Vega-Lite 文档",
"visTypeVega.emsFileParser.emsFileNameDoesNotExistErrorMessage": "{emsfile} {emsfileName} 不存在",
"visTypeVega.emsFileParser.missingNameOfFileErrorMessage": "具有 {dataUrlParamValue} 的 {dataUrlParam} 需要 {nameParam} 参数(文件名)",
"visTypeVega.esQueryParser.autointervalValueTypeErrorMessage": "{autointerval} 必须为 {trueValue} 或数字",