From 0c63c0899be288c64069d5bb11ca1026885312a8 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:56:36 +1100 Subject: [PATCH] [8.x] [ResponseOps][Cases]Design Review changes PR 3 (#194936) (#195408) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][Cases]Design Review changes PR 3 (#194936)](https://github.com/elastic/kibana/pull/194936) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Georgiana-Andreea Onoleață --- .../components/configure_cases/index.test.tsx | 12 ++++++++++++ .../public/components/configure_cases/index.tsx | 8 ++++++-- .../components/configure_cases/translations.ts | 13 ++++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx b/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx index 7f375ef75938b..6c65eae41c78b 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx @@ -902,6 +902,10 @@ describe('ConfigureCases', () => { expect(await screen.findByTestId('common-flyout')).toBeInTheDocument(); + expect(await screen.findByTestId('common-flyout-header')).toHaveTextContent( + i18n.EDIT_CUSTOM_FIELD + ); + await userEvent.click(screen.getByTestId('custom-field-label-input')); await userEvent.paste('!!'); await userEvent.click(screen.getByTestId('text-custom-field-required')); @@ -941,6 +945,10 @@ describe('ConfigureCases', () => { await userEvent.click(screen.getByTestId('add-custom-field')); expect(await screen.findByTestId('common-flyout')).toBeInTheDocument(); + + expect(await screen.findByTestId('common-flyout-header')).toHaveTextContent( + i18n.ADD_CUSTOM_FIELD + ); }); it('closes fly out for when click on cancel', async () => { @@ -1177,6 +1185,10 @@ describe('ConfigureCases', () => { expect(await screen.findByTestId('common-flyout')).toBeInTheDocument(); + expect(await screen.findByTestId('common-flyout-header')).toHaveTextContent( + i18n.EDIT_TEMPLATE + ); + await userEvent.clear(await screen.findByTestId('template-name-input')); await userEvent.click(await screen.findByTestId('template-name-input')); await userEvent.paste('Updated template name'); diff --git a/x-pack/plugins/cases/public/components/configure_cases/index.tsx b/x-pack/plugins/cases/public/components/configure_cases/index.tsx index d26fe1ee185f8..61f99a46a0b08 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/index.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/index.tsx @@ -484,7 +484,9 @@ export const ConfigureCases: React.FC = React.memo(() => { } onCloseFlyout={onCloseCustomFieldFlyout} onSaveField={onCustomFieldSave} - renderHeader={() => {i18n.ADD_CUSTOM_FIELD}} + renderHeader={() => ( + {customFieldToEdit ? i18n.EDIT_CUSTOM_FIELD : i18n.ADD_CUSTOM_FIELD} + )} > {({ onChange }) => ( @@ -504,7 +506,9 @@ export const ConfigureCases: React.FC = React.memo(() => { } onCloseFlyout={onCloseTemplateFlyout} onSaveField={onTemplateSave} - renderHeader={() => {i18n.CREATE_TEMPLATE}} + renderHeader={() => ( + {templateToEdit ? i18n.EDIT_TEMPLATE : i18n.CREATE_TEMPLATE} + )} > {({ onChange }) => (