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

[8.x] Remove unusedkbn-ace code (#195353) #195720

Closed
wants to merge 1 commit into from
Closed
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
1 change: 0 additions & 1 deletion x-pack/plugins/data_visualizer/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"kibanaReact",
"kibanaUtils",
"maps",
"esUiShared",
"fieldFormats",
"uiActions",
"lens",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import type { FC } from 'react';
import React from 'react';

import { CodeEditor, type CodeEditorProps } from '@kbn/code-editor';
import { expandLiteralStrings, XJsonMode } from '../../../shared_imports';

export const EDITOR_MODE = { TEXT: 'text', JSON: 'json', XJSON: new XJsonMode() };
export const EDITOR_MODE = { TEXT: 'text', JSON: 'json' };

interface JobEditorProps {
value: string;
Expand All @@ -30,10 +29,6 @@ export const JsonEditor: FC<JobEditorProps> = ({
readOnly = false,
onChange = () => {},
}) => {
if (mode === EDITOR_MODE.XJSON) {
value = expandLiteralStrings(value);
}

return (
<CodeEditor
value={value}
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions x-pack/plugins/data_visualizer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"types/**/*"
],
"kbn_references": [
"@kbn/ace",
"@kbn/aiops-components",
"@kbn/charts-plugin",
"@kbn/cloud-plugin",
Expand All @@ -32,7 +31,6 @@
"@kbn/embeddable-plugin",
"@kbn/es-query",
"@kbn/es-types",
"@kbn/es-ui-shared-plugin",
"@kbn/esql-utils",
"@kbn/field-formats-plugin",
"@kbn/field-types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { XJsonMode } from '@kbn/ace';
import { XJson } from '@kbn/es-ui-shared-plugin/public';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import { getCombinedRuntimeMappings, isRuntimeMappings } from '@kbn/ml-runtime-field-utils';
Expand Down Expand Up @@ -66,8 +65,6 @@ const RUNTIME_FIELDS_LABEL_TEXT = i18n.translate(
);

const { useXJsonMode } = XJson;
const xJsonMode = new XJsonMode();
export type XJsonModeType = ReturnType<typeof XJsonMode>;

interface Props {
actions: CreateAnalyticsFormProps['actions'];
Expand Down Expand Up @@ -176,7 +173,6 @@ export const RuntimeMappings: FC<Props> = ({ actions, state }) => {
}
setAdvancedRuntimeMappingsConfig={setAdvancedRuntimeMappingsConfig}
convertToJson={convertToJson}
xJsonMode={xJsonMode}
/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,18 @@ import { i18n } from '@kbn/i18n';

import { CodeEditor } from '@kbn/code-editor';
import { isRuntimeMappings } from '@kbn/ml-runtime-field-utils';
import type { XJsonModeType } from './runtime_mappings';

interface Props {
convertToJson: (data: string) => string;
setAdvancedRuntimeMappingsConfig: React.Dispatch<string>;
setIsRuntimeMappingsEditorApplyButtonEnabled: React.Dispatch<React.SetStateAction<boolean>>;
advancedEditorRuntimeMappingsLastApplied: string | undefined;
advancedRuntimeMappingsConfig: string;
xJsonMode: XJsonModeType;
}

export const RuntimeMappingsEditor: FC<Props> = memo(
({
convertToJson,
xJsonMode,
setAdvancedRuntimeMappingsConfig,
setIsRuntimeMappingsEditorApplyButtonEnabled,
advancedEditorRuntimeMappingsLastApplied,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const DatafeedPreview: FC<{
const {
jobs: { datafeedPreview },
} = useMlApi();
// the ace editor requires a fixed height
// the editor requires a fixed height
const editorHeight = useMemo(
() => `${window.innerHeight - 230 - heightOffset}px`,
[heightOffset]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ const Contents: FC<{
heightOffset?: number;
schema?: object;
}> = ({ title, value, editJson, onChange, heightOffset = 0, schema }) => {
// the ace editor requires a fixed height
// the editor requires a fixed height
const editorHeight = useMemo(
() => `${window.innerHeight - 230 - heightOffset}px`,
[heightOffset]
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/ml/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"path": "../../../src/setup_node_env/tsconfig.json"
},
// add references to other TypeScript projects the plugin depends on
"@kbn/ace",
"@kbn/actions-plugin",
"@kbn/aiops-plugin",
"@kbn/alerting-plugin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type { StepDefineFormHook } from '../step_define';
export const AdvancedPivotEditor: FC<StepDefineFormHook['advancedPivotEditor']> = memo(
({
actions: { convertToJson, setAdvancedEditorConfig, setAdvancedPivotEditorApplyButtonEnabled },
state: { advancedEditorConfigLastApplied, advancedEditorConfig, xJsonMode },
state: { advancedEditorConfigLastApplied, advancedEditorConfig },
}) => {
return (
<EuiFormRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const AdvancedRuntimeMappingsEditor: FC<StepDefineFormHook['runtimeMappin
setAdvancedRuntimeMappingsConfig,
setRuntimeMappingsEditorApplyButtonEnabled,
},
state: { advancedEditorRuntimeMappingsLastApplied, advancedRuntimeMappingsConfig, xJsonMode },
state: { advancedEditorRuntimeMappingsLastApplied, advancedRuntimeMappingsConfig },
}) => {
return (
<div data-test-subj="transformAdvancedRuntimeMappingsEditor">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import { useEffect, useState } from 'react';
import { XJsonMode } from '@kbn/ace';

import { XJson } from '@kbn/es-ui-shared-plugin/public';

Expand All @@ -15,7 +14,6 @@ import type { PostTransformsPreviewRequestSchema } from '../../../../../../../se
import type { StepDefineExposedState } from '../common';

const { useXJsonMode } = XJson;
const xJsonMode = new XJsonMode();

export const useAdvancedPivotEditor = (
defaults: StepDefineExposedState,
Expand Down Expand Up @@ -71,7 +69,6 @@ export const useAdvancedPivotEditor = (
isAdvancedEditorSwitchModalVisible,
isAdvancedPivotEditorApplyButtonEnabled,
isAdvancedPivotEditorEnabled,
xJsonMode,
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
*/

import { useState } from 'react';
import { XJsonMode } from '@kbn/ace';
import { XJson } from '@kbn/es-ui-shared-plugin/public';
import type { StepDefineExposedState } from '../common';

const { useXJsonMode } = XJson;
const xJsonMode = new XJsonMode();

export const useAdvancedRuntimeMappingsEditor = (defaults: StepDefineExposedState) => {
const stringifiedRuntimeMappings = JSON.stringify(defaults.runtimeMappings, null, 2);
Expand Down Expand Up @@ -81,7 +79,6 @@ export const useAdvancedRuntimeMappingsEditor = (defaults: StepDefineExposedStat
isRuntimeMappingsEditorSwitchModalVisible,
runtimeMappingsUpdated,
advancedRuntimeMappingsConfig,
xJsonMode,
runtimeMappings,
},
};
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/transform/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@kbn/triggers-actions-ui-plugin",
"@kbn/i18n-react",
"@kbn/kibana-react-plugin",
"@kbn/ace",
"@kbn/es-ui-shared-plugin",
"@kbn/discover-plugin",
"@kbn/kibana-utils-plugin",
Expand Down