From a2cf13098568855cf7c4995d5292418833353248 Mon Sep 17 00:00:00 2001 From: Maja Grubic Date: Mon, 6 Mar 2023 17:50:56 +0100 Subject: [PATCH 1/5] [Saved Objects Finder] Add help text and left button --- .../finder/saved_object_finder.test.tsx | 29 +++++++- .../public/finder/saved_object_finder.tsx | 47 ++++++++---- x-pack/plugins/cases/kibana.jsonc | 6 +- .../markdown_editor/plugins/lens/plugin.tsx | 72 +++++++------------ x-pack/plugins/cases/public/types.ts | 2 + x-pack/plugins/security_solution/kibana.jsonc | 3 +- .../security_solution/public/plugin.tsx | 1 + .../plugins/security_solution/public/types.ts | 3 + 8 files changed, 96 insertions(+), 67 deletions(-) diff --git a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.test.tsx b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.test.tsx index 7e560906b8ae9..0a7e3d2e1d0be 100644 --- a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.test.tsx +++ b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.test.tsx @@ -10,7 +10,7 @@ const nextTick = () => new Promise((res) => process.nextTick(res)); import lodash from 'lodash'; jest.spyOn(lodash, 'debounce').mockImplementation((fn: any) => fn); -import { EuiInMemoryTable, EuiLink, EuiSearchBarProps, Query } from '@elastic/eui'; +import { EuiInMemoryTable, EuiLink, EuiSearchBarProps, EuiText, Query } from '@elastic/eui'; import { IconType } from '@elastic/eui'; import { mount, shallow } from 'enzyme'; import React from 'react'; @@ -192,6 +192,33 @@ describe('SavedObjectsFinder', () => { ); }); + it('should render help text', async () => { + const core = coreMock.createStart(); + (core.http.get as any as jest.SpyInstance).mockImplementation(() => + Promise.resolve({ saved_objects: [doc] }) + ); + core.uiSettings.get.mockImplementation(() => 10); + + const wrapper = shallow( + + ); + + wrapper.instance().componentDidMount!(); + await nextTick(); + expect(wrapper.find(EuiText).childAt(0).text()).toEqual( + 'This is some description about the action' + ); + }); + describe('sorting', () => { it('should list items by type ascending', async () => { const core = coreMock.createStart(); diff --git a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx index 2db81716876c9..932e7daa907a2 100644 --- a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx +++ b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx @@ -8,7 +8,7 @@ import { debounce } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import React, { ReactNode } from 'react'; import type { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public'; import { @@ -22,6 +22,9 @@ import { SearchFilterConfig, Query, PropertySort, + EuiFlexItem, + EuiFlexGroup, + EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -72,6 +75,8 @@ interface BaseSavedObjectFinder { noItemsMessage?: React.ReactNode; savedObjectMetaData: Array>; showFilter?: boolean; + leftButton?: ReactNode; + helpText?: string; } interface SavedObjectFinderFixedPage extends BaseSavedObjectFinder { @@ -355,23 +360,35 @@ export class SavedObjectFinderUi extends React.Component< ] : undefined, toolsRight: this.props.children ? <>{this.props.children} : undefined, + toolsLeft: this.props.leftButton ? <>{this.props.leftButton} : undefined, }; return ( - { - this.setState({ sort }); - }} - /> + + + {this.props.helpText ? ( + + {this.props.helpText} + + ) : undefined} + + + { + this.setState({ sort }); + }} + /> + + ); } } diff --git a/x-pack/plugins/cases/kibana.jsonc b/x-pack/plugins/cases/kibana.jsonc index afed1cd7631f8..a37320379b76d 100644 --- a/x-pack/plugins/cases/kibana.jsonc +++ b/x-pack/plugins/cases/kibana.jsonc @@ -27,6 +27,8 @@ "notifications", "ruleRegistry", "files", + "savedObjectsFinder", + "savedObjectsManagement" ], "optionalPlugins": [ "home", @@ -34,9 +36,7 @@ "usageCollection", "spaces" ], - "requiredBundles": [ - "savedObjects" - ], + "requiredBundles": [], "extraPublicDirs": [ "common" ] diff --git a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx index ae88e17637627..a27281c155dc0 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx @@ -14,7 +14,6 @@ import { EuiModalHeaderTitle, EuiMarkdownContext, EuiModalFooter, - EuiButtonEmpty, EuiButton, EuiFlexItem, EuiFlexGroup, @@ -28,7 +27,7 @@ import styled from 'styled-components'; import type { TypedLensByValueInput } from '@kbn/lens-plugin/public'; import type { EmbeddablePackageState } from '@kbn/embeddable-plugin/public'; -import { SavedObjectFinderUi } from '@kbn/saved-objects-plugin/public'; +import { SavedObjectFinder } from '@kbn/saved-objects-finder-plugin/public'; import { useKibana } from '../../../../common/lib/kibana'; import { DRAFT_COMMENT_STORAGE_ID, ID } from './constants'; import { CommentEditorContext } from '../../context'; @@ -74,6 +73,7 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ storage, http, uiSettings, + savedObjectsManagement, data: { query: { timefilter: { timefilter }, @@ -85,7 +85,6 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ const commentEditorContext = useContext(CommentEditorContext); const markdownContext = useContext(EuiMarkdownContext); const isMainApplication = useIsMainApplication(); - const handleClose = useCallback(() => { if (currentAppId) { embeddable?.getStateTransfer().getIncomingEmbeddablePackage(currentAppId, true); @@ -225,45 +224,6 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ [] ); - const euiFieldSearchProps = useMemo( - () => ({ - prepend: i18n.translate( - 'xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputPrependLabel', - { - defaultMessage: 'Template', - } - ), - }), - [] - ); - - const euiFormRowProps = useMemo( - () => ({ - label: i18n.translate( - 'xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputLabel', - { - defaultMessage: 'Select lens', - } - ), - labelAppend: ( - - - - ), - helpText: i18n.translate( - 'xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputHelpText', - { - defaultMessage: - 'Insert lens from existing templates or creating a new one. You will only create lens for this comment and won’t change Visualize Library.', - } - ), - }), - [handleCreateInLensClick] - ); - useEffect(() => { if (node?.attributes && currentAppId) { handleEditInLensClick(node.attributes, node.timeRange); @@ -318,6 +278,15 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ } }, [embeddable, storage, timefilter, currentAppId, handleAdd, handleUpdate, draftComment]); + const createLensButton = ( + + + + ); + return ( @@ -349,7 +318,7 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ - diff --git a/x-pack/plugins/cases/public/types.ts b/x-pack/plugins/cases/public/types.ts index f430b99ae17f2..a72f9e5449a95 100644 --- a/x-pack/plugins/cases/public/types.ts +++ b/x-pack/plugins/cases/public/types.ts @@ -23,6 +23,7 @@ import type { DistributiveOmit } from '@elastic/eui'; import type { ApmBase } from '@elastic/apm-rum'; import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import type { FilesSetup, FilesStart } from '@kbn/files-plugin/public'; +import type { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public'; import type { CasesByAlertId, CasesByAlertIDRequest, @@ -69,6 +70,7 @@ export interface CasesPluginStart { security: SecurityPluginStart; spaces?: SpacesPluginStart; apm?: ApmBase; + savedObjectsManagement: SavedObjectsManagementPluginStart; } /** diff --git a/x-pack/plugins/security_solution/kibana.jsonc b/x-pack/plugins/security_solution/kibana.jsonc index 85418bdeb31b7..9401b69d11657 100644 --- a/x-pack/plugins/security_solution/kibana.jsonc +++ b/x-pack/plugins/security_solution/kibana.jsonc @@ -40,7 +40,8 @@ "unifiedSearch", "files", "controls", - "dataViews" + "dataViews", + "savedObjectsManagement", ], "optionalPlugins": [ "cloudExperiments", diff --git a/x-pack/plugins/security_solution/public/plugin.tsx b/x-pack/plugins/security_solution/public/plugin.tsx index 78680086d45c0..c49cf383c3092 100644 --- a/x-pack/plugins/security_solution/public/plugin.tsx +++ b/x-pack/plugins/security_solution/public/plugin.tsx @@ -159,6 +159,7 @@ export class Plugin implements IPlugin SecuritySolutionTemplateWrapper, }, + savedObjectsManagement: startPluginsDeps.savedObjectsManagement, }; return services; }; diff --git a/x-pack/plugins/security_solution/public/types.ts b/x-pack/plugins/security_solution/public/types.ts index cb16591da9fb4..1cc98c8d44870 100644 --- a/x-pack/plugins/security_solution/public/types.ts +++ b/x-pack/plugins/security_solution/public/types.ts @@ -44,6 +44,7 @@ import type { ThreatIntelligencePluginStart } from '@kbn/threat-intelligence-plu import type { CloudExperimentsPluginStart } from '@kbn/cloud-experiments-plugin/common'; import type { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; import type { DataViewsServicePublic } from '@kbn/data-views-plugin/public'; +import type { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public'; import type { ResolverPluginSetup } from './resolver/types'; import type { Inspect } from '../common/search_strategy'; import type { Detections } from './detections'; @@ -101,6 +102,7 @@ export interface StartPlugins { } export interface StartPluginsDependencies extends StartPlugins { + savedObjectsManagement: SavedObjectsManagementPluginStart; savedObjectsTaggingOss: SavedObjectTaggingOssPluginStart; } @@ -119,6 +121,7 @@ export type StartServices = CoreStart & securityLayout: { getPluginWrapper: () => typeof SecuritySolutionTemplateWrapper; }; + savedObjectsManagement: SavedObjectsManagementPluginStart; }; export interface PluginSetup { From c15a6cea27a4ddb7ac02933f7b872bc8fe50f94c Mon Sep 17 00:00:00 2001 From: Maja Grubic Date: Mon, 6 Mar 2023 17:56:08 +0100 Subject: [PATCH 2/5] Update translations --- x-pack/plugins/translations/translations/fr-FR.json | 2 -- x-pack/plugins/translations/translations/ja-JP.json | 2 -- x-pack/plugins/translations/translations/zh-CN.json | 2 -- 3 files changed, 6 deletions(-) diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index fbd6695963d91..3f006870d803c 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -9641,8 +9641,6 @@ "xpack.cases.markdownEditor.plugins.lens.insertLensSavedObjectModal.searchSelection.savedObjectType.lens": "Lens", "xpack.cases.markdownEditor.plugins.lens.openVisualizationButtonLabel": "Visualisation ouverte", "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputHelpText": "Insérez un Lens à partir de modèles existants ou en créant un nouveau modèle. Vous créerez un Lens uniquement pour ce commentaire et ne changerez pas la Bibliothèque Visualize.", - "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputLabel": "Sélectionner un Lens", - "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputPrependLabel": "Modèle", "xpack.cases.markdownEditor.plugins.lens.visualizationButtonLabel": "Visualisation", "xpack.cases.markdownEditor.plugins.timeline.noParenthesesErrorMsg": "Parenthèses gauches attendues", "xpack.cases.markdownEditor.preview": "Aperçu", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 8ed17cfebea7a..a483f07a52d30 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -9630,8 +9630,6 @@ "xpack.cases.markdownEditor.plugins.lens.insertLensSavedObjectModal.searchSelection.savedObjectType.lens": "レンズ", "xpack.cases.markdownEditor.plugins.lens.openVisualizationButtonLabel": "ビジュアライゼーションを開く", "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputHelpText": "既存のテンプレートからLensを挿入するか、新しく作成します。このコメントでのみLensが作成されます。Visualize Libraryは変更されません。", - "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputLabel": "Lensを選択", - "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputPrependLabel": "テンプレート", "xpack.cases.markdownEditor.plugins.lens.visualizationButtonLabel": "ビジュアライゼーション", "xpack.cases.markdownEditor.plugins.timeline.noParenthesesErrorMsg": "想定される左括弧", "xpack.cases.markdownEditor.preview": "プレビュー", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 1fcfd93fc4142..41cf3ef67fdfc 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -9645,8 +9645,6 @@ "xpack.cases.markdownEditor.plugins.lens.insertLensSavedObjectModal.searchSelection.savedObjectType.lens": "Lens", "xpack.cases.markdownEditor.plugins.lens.openVisualizationButtonLabel": "打开可视化", "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputHelpText": "通过现有模板或创建新模板来插入 Lens。您将仅为此注释创建 Lens,并且不会更改可视化库。", - "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputLabel": "选择 Lens", - "xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputPrependLabel": "模板", "xpack.cases.markdownEditor.plugins.lens.visualizationButtonLabel": "可视化", "xpack.cases.markdownEditor.plugins.timeline.noParenthesesErrorMsg": "应为左括号", "xpack.cases.markdownEditor.preview": "预览", From b12b968b3b67147c957c54873630d96e02262ff7 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 6 Mar 2023 17:04:44 +0000 Subject: [PATCH 3/5] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/plugins/cases/tsconfig.json | 3 ++- x-pack/plugins/security_solution/tsconfig.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/cases/tsconfig.json b/x-pack/plugins/cases/tsconfig.json index 5ba7e85918975..7c703b9819300 100644 --- a/x-pack/plugins/cases/tsconfig.json +++ b/x-pack/plugins/cases/tsconfig.json @@ -25,7 +25,6 @@ "@kbn/es-ui-shared-plugin", "@kbn/kibana-react-plugin", "@kbn/kibana-utils-plugin", - "@kbn/saved-objects-plugin", "@kbn/i18n", "@kbn/utility-types", "@kbn/securitysolution-io-ts-utils", @@ -58,6 +57,8 @@ "@kbn/shared-ux-router", "@kbn/files-plugin", "@kbn/shared-ux-file-types", + "@kbn/saved-objects-finder-plugin", + "@kbn/saved-objects-management-plugin", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index c5654f37517fb..407dfe3ee102d 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -145,5 +145,6 @@ "@kbn/alerts-as-data-utils", "@kbn/expandable-flyout", "@kbn/securitysolution-grouping", + "@kbn/saved-objects-management-plugin", ] } From 5c38e027173b11f05a1626eb34815f870f47a34d Mon Sep 17 00:00:00 2001 From: Maja Grubic Date: Mon, 6 Mar 2023 19:27:33 +0100 Subject: [PATCH 4/5] Add more tests --- .../finder/saved_object_finder.test.tsx | 201 +++++++++++------- .../public/finder/saved_object_finder.tsx | 8 +- .../markdown_editor/plugins/lens/plugin.tsx | 2 +- 3 files changed, 129 insertions(+), 82 deletions(-) diff --git a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.test.tsx b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.test.tsx index 0a7e3d2e1d0be..1c8ed33853c87 100644 --- a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.test.tsx +++ b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.test.tsx @@ -10,7 +10,14 @@ const nextTick = () => new Promise((res) => process.nextTick(res)); import lodash from 'lodash'; jest.spyOn(lodash, 'debounce').mockImplementation((fn: any) => fn); -import { EuiInMemoryTable, EuiLink, EuiSearchBarProps, EuiText, Query } from '@elastic/eui'; +import { + EuiInMemoryTable, + EuiLink, + EuiSearchBarProps, + EuiText, + EuiButton, + Query, +} from '@elastic/eui'; import { IconType } from '@elastic/eui'; import { mount, shallow } from 'enzyme'; import React from 'react'; @@ -133,90 +140,130 @@ describe('SavedObjectsFinder', () => { }); }); - it('should list initial items', async () => { - const core = coreMock.createStart(); - (core.http.get as any as jest.SpyInstance).mockImplementation(() => - Promise.resolve({ saved_objects: [doc] }) - ); - core.uiSettings.get.mockImplementation(() => 10); + describe('render', () => { + it('lists initial items', async () => { + const core = coreMock.createStart(); + (core.http.get as any as jest.SpyInstance).mockImplementation(() => + Promise.resolve({ saved_objects: [doc] }) + ); + core.uiSettings.get.mockImplementation(() => 10); - const wrapper = shallow( - - ); + const wrapper = shallow( + + ); - wrapper.instance().componentDidMount!(); - await nextTick(); - expect( - wrapper - .find(EuiInMemoryTable) - .prop('items') - .map((item: any) => item.attributes) - ).toEqual([doc.attributes]); - }); + wrapper.instance().componentDidMount!(); + await nextTick(); + expect( + wrapper + .find(EuiInMemoryTable) + .prop('items') + .map((item: any) => item.attributes) + ).toEqual([doc.attributes]); + }); - it('should call onChoose on item click', async () => { - const chooseStub = sinon.stub(); - const core = coreMock.createStart(); - (core.http.get as any as jest.SpyInstance).mockImplementation(() => - Promise.resolve({ saved_objects: [doc] }) - ); - core.uiSettings.get.mockImplementation(() => 10); + it('calls onChoose on item click', async () => { + const chooseStub = sinon.stub(); + const core = coreMock.createStart(); + (core.http.get as any as jest.SpyInstance).mockImplementation(() => + Promise.resolve({ saved_objects: [doc] }) + ); + core.uiSettings.get.mockImplementation(() => 10); - const wrapper = mount( - - ); + const wrapper = mount( + + ); - wrapper.instance().componentDidMount!(); - await nextTick(); - wrapper.update(); - findTestSubject(wrapper, 'savedObjectTitleExample-title').simulate('click'); - expect(chooseStub.calledWith('1', 'search', `${doc.attributes.title} (Search)`, doc)).toEqual( - true - ); - }); + wrapper.instance().componentDidMount!(); + await nextTick(); + wrapper.update(); + findTestSubject(wrapper, 'savedObjectTitleExample-title').simulate('click'); + expect(chooseStub.calledWith('1', 'search', `${doc.attributes.title} (Search)`, doc)).toEqual( + true + ); + }); - it('should render help text', async () => { - const core = coreMock.createStart(); - (core.http.get as any as jest.SpyInstance).mockImplementation(() => - Promise.resolve({ saved_objects: [doc] }) - ); - core.uiSettings.get.mockImplementation(() => 10); + it('with help text', async () => { + const core = coreMock.createStart(); + (core.http.get as any as jest.SpyInstance).mockImplementation(() => + Promise.resolve({ saved_objects: [doc] }) + ); + core.uiSettings.get.mockImplementation(() => 10); - const wrapper = shallow( - - ); + const wrapper = shallow( + + ); - wrapper.instance().componentDidMount!(); - await nextTick(); - expect(wrapper.find(EuiText).childAt(0).text()).toEqual( - 'This is some description about the action' - ); + wrapper.instance().componentDidMount!(); + await nextTick(); + expect(wrapper.find(EuiText).childAt(0).text()).toEqual( + 'This is some description about the action' + ); + }); + + it('with left button', async () => { + const core = coreMock.createStart(); + (core.http.get as any as jest.SpyInstance).mockImplementation(() => + Promise.resolve({ saved_objects: [doc] }) + ); + core.uiSettings.get.mockImplementation(() => 10); + const button = Hello; + const wrapper = shallow( + + ); + + wrapper.instance().componentDidMount!(); + await nextTick(); + const searchBar = wrapper.find(EuiInMemoryTable).prop('search') as EuiSearchBarProps; + const toolsLeft = searchBar!.toolsLeft; + expect(toolsLeft).toMatchInlineSnapshot( + ` + + + Hello + + + ` + ); + }); }); describe('sorting', () => { diff --git a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx index 932e7daa907a2..3acf08ff0af39 100644 --- a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx +++ b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx @@ -8,7 +8,7 @@ import { debounce } from 'lodash'; import PropTypes from 'prop-types'; -import React, { ReactNode } from 'react'; +import React, { ReactElement, ReactNode } from 'react'; import type { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public'; import { @@ -72,10 +72,10 @@ interface BaseSavedObjectFinder { name: string, savedObject: SavedObjectCommon ) => void; - noItemsMessage?: React.ReactNode; + noItemsMessage?: ReactNode; savedObjectMetaData: Array>; showFilter?: boolean; - leftButton?: ReactNode; + leftChildren?: ReactElement | ReactElement[]; helpText?: string; } @@ -360,7 +360,7 @@ export class SavedObjectFinderUi extends React.Component< ] : undefined, toolsRight: this.props.children ? <>{this.props.children} : undefined, - toolsLeft: this.props.leftButton ? <>{this.props.leftButton} : undefined, + toolsLeft: this.props.leftChildren ? <>{this.props.leftChildren} : undefined, }; return ( diff --git a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx index a27281c155dc0..996d3d757186d 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx @@ -335,7 +335,7 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ http, savedObjectsManagement, }} - leftButton={createLensButton} + leftChildren={createLensButton} helpText={i18n.translate( 'xpack.cases.markdownEditor.plugins.lens.savedObjects.finder.searchInputHelpText', { From 29af5473dd209311d951e73ff488eb603d57a587 Mon Sep 17 00:00:00 2001 From: Maja Grubic Date: Fri, 10 Mar 2023 09:31:32 +0100 Subject: [PATCH 5/5] Fix layout issue --- .../public/finder/saved_object_finder.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx index 3acf08ff0af39..56f8b203f694c 100644 --- a/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx +++ b/src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx @@ -365,13 +365,13 @@ export class SavedObjectFinderUi extends React.Component< return ( - - {this.props.helpText ? ( + {this.props.helpText ? ( + {this.props.helpText} - ) : undefined} - + + ) : undefined}