mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.x`: - [Remove unused`kbn-ace` code (#195353)](https://github.com/elastic/kibana/pull/195353) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ignacio Rivas","email":"rivasign@gmail.com"},"sourceCommit":{"committedDate":"2024-10-08T11:45:20Z","message":"Remove unused`kbn-ace` code (#195353)","sha":"83810ac9edba72f0bcad8f7e7e77a1bef89328cc","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana Management","release_note:skip","v9.0.0","backport:prev-minor","v8.16.0"],"title":"Remove unused`kbn-ace` code","number":195353,"url":"https://github.com/elastic/kibana/pull/195353","mergeCommit":{"message":"Remove unused`kbn-ace` code (#195353)","sha":"83810ac9edba72f0bcad8f7e7e77a1bef89328cc"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195353","number":195353,"mergeCommit":{"message":"Remove unused`kbn-ace` code (#195353)","sha":"83810ac9edba72f0bcad8f7e7e77a1bef89328cc"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
This commit is contained in:
parent
950e073890
commit
cbef50e179
14 changed files with 5 additions and 40 deletions
|
@ -33,7 +33,6 @@
|
|||
"kibanaReact",
|
||||
"kibanaUtils",
|
||||
"maps",
|
||||
"esUiShared",
|
||||
"fieldFormats",
|
||||
"uiActions",
|
||||
"lens",
|
||||
|
|
|
@ -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;
|
||||
|
@ -30,10 +29,6 @@ export const JsonEditor: FC<JobEditorProps> = ({
|
|||
readOnly = false,
|
||||
onChange = () => {},
|
||||
}) => {
|
||||
if (mode === EDITOR_MODE.XJSON) {
|
||||
value = expandLiteralStrings(value);
|
||||
}
|
||||
|
||||
return (
|
||||
<CodeEditor
|
||||
value={value}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { XJson } from '@kbn/es-ui-shared-plugin/public';
|
||||
const { collapseLiteralStrings, expandLiteralStrings } = XJson;
|
||||
|
||||
export { XJsonMode } from '@kbn/ace';
|
||||
export { collapseLiteralStrings, expandLiteralStrings };
|
|
@ -12,7 +12,6 @@
|
|||
"types/**/*"
|
||||
],
|
||||
"kbn_references": [
|
||||
"@kbn/ace",
|
||||
"@kbn/aiops-components",
|
||||
"@kbn/charts-plugin",
|
||||
"@kbn/cloud-plugin",
|
||||
|
@ -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",
|
||||
|
|
|
@ -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';
|
||||
|
@ -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'];
|
||||
|
@ -176,7 +173,6 @@ export const RuntimeMappings: FC<Props> = ({ actions, state }) => {
|
|||
}
|
||||
setAdvancedRuntimeMappingsConfig={setAdvancedRuntimeMappingsConfig}
|
||||
convertToJson={convertToJson}
|
||||
xJsonMode={xJsonMode}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
|
|
@ -12,7 +12,6 @@ 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;
|
||||
|
@ -20,13 +19,11 @@ interface Props {
|
|||
setIsRuntimeMappingsEditorApplyButtonEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
advancedEditorRuntimeMappingsLastApplied: string | undefined;
|
||||
advancedRuntimeMappingsConfig: string;
|
||||
xJsonMode: XJsonModeType;
|
||||
}
|
||||
|
||||
export const RuntimeMappingsEditor: FC<Props> = memo(
|
||||
({
|
||||
convertToJson,
|
||||
xJsonMode,
|
||||
setAdvancedRuntimeMappingsConfig,
|
||||
setIsRuntimeMappingsEditorApplyButtonEnabled,
|
||||
advancedEditorRuntimeMappingsLastApplied,
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { XJsonMode } from '@kbn/ace';
|
||||
|
||||
import { XJson } from '@kbn/es-ui-shared-plugin/public';
|
||||
|
||||
|
@ -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,
|
||||
|
@ -71,7 +69,6 @@ export const useAdvancedPivotEditor = (
|
|||
isAdvancedEditorSwitchModalVisible,
|
||||
isAdvancedPivotEditorApplyButtonEnabled,
|
||||
isAdvancedPivotEditorEnabled,
|
||||
xJsonMode,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
@ -81,7 +79,6 @@ export const useAdvancedRuntimeMappingsEditor = (defaults: StepDefineExposedStat
|
|||
isRuntimeMappingsEditorSwitchModalVisible,
|
||||
runtimeMappingsUpdated,
|
||||
advancedRuntimeMappingsConfig,
|
||||
xJsonMode,
|
||||
runtimeMappings,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue