From 46ba8ebcda43b1a624f11d3d5339081bfbd60c85 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 4 Jul 2024 14:28:04 -0700 Subject: [PATCH 1/5] [ResponseOps][Cases] Edits case template text --- x-pack/plugins/cases/public/common/translations.ts | 4 ++-- .../cases/public/components/configure_cases/flyout.test.tsx | 2 +- .../plugins/cases/public/components/create/translations.ts | 2 +- .../cases/public/components/custom_fields/translations.ts | 2 +- .../cases/public/components/templates/translations.ts | 6 ++---- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/cases/public/common/translations.ts b/x-pack/plugins/cases/public/common/translations.ts index eab026897e3bf..e83bbfd0013d1 100644 --- a/x-pack/plugins/cases/public/common/translations.ts +++ b/x-pack/plugins/cases/public/common/translations.ts @@ -22,11 +22,11 @@ export const DELETE_CASE = (quantity: number = 1) => }); export const COPY_ID_ACTION_LABEL = i18n.translate('xpack.cases.caseView.copyID', { - defaultMessage: 'Copy Case ID', + defaultMessage: 'Copy case ID', }); export const COPY_ID_ACTION_SUCCESS = i18n.translate('xpack.cases.caseView.copyIDSuccess', { - defaultMessage: 'Copied Case ID to clipboard', + defaultMessage: 'Copied case ID to clipboard', }); export const NAME = i18n.translate('xpack.cases.caseView.name', { diff --git a/x-pack/plugins/cases/public/components/configure_cases/flyout.test.tsx b/x-pack/plugins/cases/public/components/configure_cases/flyout.test.tsx index 555f5e6f553b8..568d08b188dbf 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/flyout.test.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/flyout.test.tsx @@ -766,7 +766,7 @@ describe('CommonFlyout ', () => { expect(props.onSaveField).not.toHaveBeenCalled(); }); - expect(await screen.findByText('A Template name is required.')).toBeInTheDocument(); + expect(await screen.findByText('Template name is required.')).toBeInTheDocument(); }); it('shows error if template name is too long', async () => { diff --git a/x-pack/plugins/cases/public/components/create/translations.ts b/x-pack/plugins/cases/public/components/create/translations.ts index 56f937b715398..89e384502d3ed 100644 --- a/x-pack/plugins/cases/public/components/create/translations.ts +++ b/x-pack/plugins/cases/public/components/create/translations.ts @@ -55,7 +55,7 @@ export const TEMPLATE_LABEL = i18n.translate('xpack.cases.create.templateLabel', }); export const TEMPLATE_HELP_TEXT = i18n.translate('xpack.cases.create.templateHelpText', { - defaultMessage: 'Selecting a template will pre-fill certain case fields below', + defaultMessage: 'Select a template to use its default field values.', }); export const SOLUTION_SELECTOR_LABEL = i18n.translate('xpack.cases.create.solutionSelectorLabel', { diff --git a/x-pack/plugins/cases/public/components/custom_fields/translations.ts b/x-pack/plugins/cases/public/components/custom_fields/translations.ts index 1f6616ceeb612..5f1a91765193f 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/translations.ts +++ b/x-pack/plugins/cases/public/components/custom_fields/translations.ts @@ -77,7 +77,7 @@ export const REQUIRED = i18n.translate('xpack.cases.customFields.required', { export const REQUIRED_FIELD = (fieldName: string): string => i18n.translate('xpack.cases.customFields.requiredField', { values: { fieldName }, - defaultMessage: 'A {fieldName} is required.', + defaultMessage: '{fieldName} is required.', }); export const EDIT_CUSTOM_FIELDS_ARIA_LABEL = (customFieldLabel: string) => diff --git a/x-pack/plugins/cases/public/components/templates/translations.ts b/x-pack/plugins/cases/public/components/templates/translations.ts index 2993070046813..bd2d02712d7a1 100644 --- a/x-pack/plugins/cases/public/components/templates/translations.ts +++ b/x-pack/plugins/cases/public/components/templates/translations.ts @@ -14,8 +14,7 @@ export const TEMPLATE_TITLE = i18n.translate('xpack.cases.templates.title', { }); export const TEMPLATE_DESCRIPTION = i18n.translate('xpack.cases.templates.description', { - defaultMessage: - 'Add Case Templates to automatically define the case fields while creating a new case. A user can choose to create an empty case or based on a preset template. Templates allow to auto-populate values when creating new cases.', + defaultMessage: 'Create templates that automatically populate values in new cases.', }); export const NO_TEMPLATES = i18n.translate('xpack.cases.templates.noTemplates', { @@ -45,8 +44,7 @@ export const TEMPLATE_NAME = i18n.translate('xpack.cases.templates.templateName' }); export const TEMPLATE_TAGS_HELP = i18n.translate('xpack.cases.templates.templateTagsHelp', { - defaultMessage: - 'Type one or more custom identifying tags for this template. Please enter after each tag to begin a new one', + defaultMessage: 'Separate tags with a line break.', }); export const TEMPLATE_FIELDS = i18n.translate('xpack.cases.templates.templateFields', { From 486583bc60273e415bca915a5e60dc19206f7969 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 4 Jul 2024 15:10:21 -0700 Subject: [PATCH 2/5] [UI] Edit message --- .../plugins/cases/public/components/templates/translations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/cases/public/components/templates/translations.ts b/x-pack/plugins/cases/public/components/templates/translations.ts index bd2d02712d7a1..607276180fca8 100644 --- a/x-pack/plugins/cases/public/components/templates/translations.ts +++ b/x-pack/plugins/cases/public/components/templates/translations.ts @@ -36,7 +36,7 @@ export const REQUIRED = i18n.translate('xpack.cases.templates.required', { export const REQUIRED_FIELD = (fieldName: string): string => i18n.translate('xpack.cases.templates.requiredField', { values: { fieldName }, - defaultMessage: 'A {fieldName} is required.', + defaultMessage: '{fieldName} is required.', }); export const TEMPLATE_NAME = i18n.translate('xpack.cases.templates.templateName', { From 7c3acd3294cf9f44fe32acc2e78db97a1aae4e0a Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 8 Jul 2024 15:20:29 -0700 Subject: [PATCH 3/5] Fix jest test --- .../cases/public/components/custom_fields/text/edit.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/cases/public/components/custom_fields/text/edit.test.tsx b/x-pack/plugins/cases/public/components/custom_fields/text/edit.test.tsx index 0c0ff65d5036e..04dee5dc04878 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/text/edit.test.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/text/edit.test.tsx @@ -380,7 +380,7 @@ describe('Edit ', () => { userEvent.click(await screen.findByTestId('case-text-custom-field-edit-button-test_key_1')); userEvent.clear(await screen.findByTestId('case-text-custom-field-form-field-test_key_1')); - expect(await screen.findByText('A My test label 1 is required.')).toBeInTheDocument(); + expect(await screen.findByText('My test label 1 is required.')).toBeInTheDocument(); }); it('does not shows a validation error if the field is not required', async () => { From ff00b884e885ce691878a0dcfe56ee84be62d816 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 8 Jul 2024 15:22:32 -0700 Subject: [PATCH 4/5] Another jest test update --- .../cases/public/components/custom_fields/text/create.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/cases/public/components/custom_fields/text/create.test.tsx b/x-pack/plugins/cases/public/components/custom_fields/text/create.test.tsx index 0b62466fa6858..86a4aef5ad720 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/text/create.test.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/text/create.test.tsx @@ -191,7 +191,7 @@ describe('Create ', () => { userEvent.click(await screen.findByText('Submit')); expect( - await screen.findByText(`A ${customFieldConfiguration.label} is required.`) + await screen.findByText(`${customFieldConfiguration.label} is required.`) ).toBeInTheDocument(); await waitFor(() => { From 1252ab14786166c9fc4012caf4679e3f1db56a61 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 8 Jul 2024 15:24:45 -0700 Subject: [PATCH 5/5] Fix capitalization in tests --- .../components/actions/copy_id/use_copy_id_action.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/cases/public/components/actions/copy_id/use_copy_id_action.test.tsx b/x-pack/plugins/cases/public/components/actions/copy_id/use_copy_id_action.test.tsx index 0c33980b3ab63..388b3de940ec5 100644 --- a/x-pack/plugins/cases/public/components/actions/copy_id/use_copy_id_action.test.tsx +++ b/x-pack/plugins/cases/public/components/actions/copy_id/use_copy_id_action.test.tsx @@ -50,7 +50,7 @@ describe('useCopyIDAction', () => { />, "key": "cases-action-copy-id", "name": - Copy Case ID + Copy case ID , "onClick": [Function], } @@ -84,7 +84,7 @@ describe('useCopyIDAction', () => { await waitFor(() => { expect(onActionSuccess).toHaveBeenCalled(); expect(appMockRender.coreStart.notifications.toasts.addSuccess).toHaveBeenCalledWith({ - title: 'Copied Case ID to clipboard', + title: 'Copied case ID to clipboard', className: 'eui-textBreakWord', }); });