diff --git a/.changeset/fuzzy-frogs-arrive.md b/.changeset/fuzzy-frogs-arrive.md new file mode 100644 index 00000000000..9c1db60485f --- /dev/null +++ b/.changeset/fuzzy-frogs-arrive.md @@ -0,0 +1,5 @@ +--- +'@talend/react-forms': patch +--- + +fix(TMC-861): Enhance translation for some cancel actions on ListView and Enumeration diff --git a/packages/containers/package.json b/packages/containers/package.json index 3197a7f301f..315e819e623 100644 --- a/packages/containers/package.json +++ b/packages/containers/package.json @@ -64,7 +64,7 @@ "@talend/icons": "^7.10.3", "@talend/locales-tui-components": "^16.0.1", "@talend/locales-tui-containers": "^9.1.3", - "@talend/locales-tui-forms": "^10.2.4", + "@talend/locales-tui-forms": "^15.2.0", "@talend/locales-design-system": "^7.15.1", "@talend/react-storybook-cmf": "^10.0.0", "@talend/eslint-config": "^13.2.1", diff --git a/packages/design-docs/package.json b/packages/design-docs/package.json index df70e8143da..b5e0762da04 100644 --- a/packages/design-docs/package.json +++ b/packages/design-docs/package.json @@ -55,7 +55,7 @@ "@talend/locales-tui-components": "^16.0.1", "@talend/locales-tui-containers": "^9.1.3", "@talend/locales-tui-faceted-search": "^11.3.0", - "@talend/locales-tui-forms": "^10.2.4", + "@talend/locales-tui-forms": "^15.2.0", "@talend/scripts-core": "^16.5.1", "@talend/scripts-config-babel": "^13.5.0", "@talend/scripts-config-react-webpack": "^16.8.1", diff --git a/packages/forms/package.json b/packages/forms/package.json index 368f09e3dbd..ce84e97dfac 100644 --- a/packages/forms/package.json +++ b/packages/forms/package.json @@ -68,7 +68,7 @@ "devDependencies": { "@storybook/addon-actions": "^7.6.20", "@storybook/addon-controls": "^7.6.20", - "@talend/locales-tui-forms": "^10.2.4", + "@talend/locales-tui-forms": "^15.2.0", "@talend/react-components": "^17.2.0", "@talend/eslint-config": "^13.2.1", "@talend/eslint-plugin": "^1.3.1", diff --git a/packages/forms/src/UIForm/fields/Enumeration/EnumerationWidget.js b/packages/forms/src/UIForm/fields/Enumeration/EnumerationWidget.js index a7ee9054267..3e26c7cba5f 100644 --- a/packages/forms/src/UIForm/fields/Enumeration/EnumerationWidget.js +++ b/packages/forms/src/UIForm/fields/Enumeration/EnumerationWidget.js @@ -103,7 +103,7 @@ class EnumerationForm extends Component { onClick: this.onSingleAddHandler.bind(this), }, { - label: t('ENUMERATION_WIDGET_ABORT', { defaultValue: 'Abort' }), + label: t('ENUMERATION_WIDGET_CANCEL', { defaultValue: 'Cancel' }), icon: 'talend-cross', id: 'abort', key: 'abort', @@ -112,7 +112,7 @@ class EnumerationForm extends Component { ]; this.searchInputsActions = [ { - label: t('ENUMERATION_WIDGET_ABORT', { defaultValue: 'Abort' }), + label: t('ENUMERATION_WIDGET_REMOVE', { defaultValue: 'Remove filter' }), icon: 'talend-cross', id: 'abort', key: 'abort', @@ -137,7 +137,7 @@ class EnumerationForm extends Component { }, { disabled: false, - label: t('ENUMERATION_WIDGET_ABORT', { defaultValue: 'Abort' }), + label: t('ENUMERATION_WIDGET_CANCEL', { defaultValue: 'Cancel' }), icon: 'talend-cross', id: 'abort', onClick: this.onAbortItem.bind(this), diff --git a/packages/forms/src/UIForm/fields/ListView/ListView.component.js b/packages/forms/src/UIForm/fields/ListView/ListView.component.js index 0b44adb7952..16d9959266a 100644 --- a/packages/forms/src/UIForm/fields/ListView/ListView.component.js +++ b/packages/forms/src/UIForm/fields/ListView/ListView.component.js @@ -32,7 +32,7 @@ class ListViewWidget extends Component { { id: 'abort', icon: 'talend-cross', - label: t('LISTVIEW_WIDGET_ABORT', { defaultValue: 'Abort' }), + label: t('LISTVIEW_WIDGET_REMOVE', { defaultValue: 'Remove filter' }), onClick: this.switchToDefaultMode.bind(this), }, ]; diff --git a/packages/forms/src/UIForm/fields/ListView/ListView.component.test.js b/packages/forms/src/UIForm/fields/ListView/ListView.component.test.js index e0451958281..4b4023d42ec 100644 --- a/packages/forms/src/UIForm/fields/ListView/ListView.component.test.js +++ b/packages/forms/src/UIForm/fields/ListView/ListView.component.test.js @@ -189,7 +189,7 @@ describe('ListView field', () => { target: { value: 'aaaaaa' }, }); // jest.runAllTimers(); - fireEvent.click(screen.getByRole('link', { name: 'Abort' })); + fireEvent.click(screen.getByRole('link', { name: 'Remove filter' })); // then expect(screen.queryAllByRole('option').length).toBe(4); diff --git a/packages/forms/src/UIForm/fields/NestedListView/NestedListView.component.js b/packages/forms/src/UIForm/fields/NestedListView/NestedListView.component.js index 92a44e40b06..d412779a435 100644 --- a/packages/forms/src/UIForm/fields/NestedListView/NestedListView.component.js +++ b/packages/forms/src/UIForm/fields/NestedListView/NestedListView.component.js @@ -39,7 +39,7 @@ class NestedListViewWidget extends Component { { id: 'abort', icon: 'talend-cross', - label: t('LISTVIEW_WIDGET_ABORT', { defaultValue: 'Abort' }), + label: t('LISTVIEW_WIDGET_REMOVE', { defaultValue: 'Remove filter' }), onClick: this.switchToDefaultMode.bind(this), }, ]; diff --git a/packages/forms/src/UIForm/fields/NestedListView/NestedListView.test.js b/packages/forms/src/UIForm/fields/NestedListView/NestedListView.test.js index f30be4d383a..e998e600e43 100644 --- a/packages/forms/src/UIForm/fields/NestedListView/NestedListView.test.js +++ b/packages/forms/src/UIForm/fields/NestedListView/NestedListView.test.js @@ -1,5 +1,7 @@ -import { screen, render, fireEvent } from '@testing-library/react'; import ReactDOM from 'react-dom'; + +import { fireEvent, render, screen } from '@testing-library/react'; + import { NestedListViewWidget } from './NestedListView.component'; import { getDisplayedItems, prepareItemsFromSchema } from './NestedListView.utils'; @@ -457,7 +459,7 @@ describe('NestedListView component', () => { fireEvent.click(screen.getByRole('link', { name: 'Search for specific values' })); // when clicking on the close action - fireEvent.click(screen.getByRole('link', { name: 'Abort' })); + fireEvent.click(screen.getByRole('link', { name: 'Remove filter' })); // then switches to default mode expect(screen.getByRole('link', { name: 'Search for specific values' })).toBeInTheDocument(); diff --git a/packages/playground-vite/package.json b/packages/playground-vite/package.json index 3fcc22d36b5..895e3eba12e 100644 --- a/packages/playground-vite/package.json +++ b/packages/playground-vite/package.json @@ -54,7 +54,7 @@ "@talend/locales-tui-components": "^16.0.1", "@talend/locales-tui-containers": "^9.1.3", "@talend/locales-tui-faceted-search": "^11.3.0", - "@talend/locales-tui-forms": "^10.2.4", + "@talend/locales-tui-forms": "^15.2.0", "@talend/react-cmf": "^10.0.1", "@talend/react-cmf-router": "^7.0.1", "@talend/react-components": "^17.1.3", diff --git a/packages/playground/package.json b/packages/playground/package.json index 2421d09249c..67bd5b032cf 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -45,7 +45,7 @@ "@talend/icons": "^7.10.3", "@talend/locales-tui-components": "^16.0.1", "@talend/locales-tui-containers": "^9.1.3", - "@talend/locales-tui-forms": "^10.2.4", + "@talend/locales-tui-forms": "^15.2.0", "@talend/react-cmf": "^10.0.1", "@talend/react-cmf-router": "^7.0.1", "@talend/react-components": "^17.1.3", diff --git a/packages/storybook-one/package.json b/packages/storybook-one/package.json index 40000b53ca9..c9002b47fc1 100644 --- a/packages/storybook-one/package.json +++ b/packages/storybook-one/package.json @@ -53,7 +53,7 @@ "@talend/locales-tui-components": "^16.0.1", "@talend/locales-tui-containers": "^9.1.3", "@talend/locales-tui-faceted-search": "^11.3.0", - "@talend/locales-tui-forms": "^10.2.4", + "@talend/locales-tui-forms": "^15.2.0", "@talend/scripts-config-babel": "^13.5.0", "@talend/scripts-config-react-webpack": "^16.8.1", "@talend/scripts-config-storybook-lib": "^5.4.0", diff --git a/yarn.lock b/yarn.lock index 263c6d2e897..3f8daa566b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4322,10 +4322,10 @@ resolved "https://registry.yarnpkg.com/@talend/locales-tui-faceted-search/-/locales-tui-faceted-search-11.3.0.tgz#6a8d6e256ac9082cd3e3187f68cd67459b105107" integrity sha512-Wj1t2puu/0vsNLHDgYwMiOCAh4vcHSfA76++vxSfQ0oZLnwXYoIDERcT1NaEnwu6Cpleue5MAuTKgDHryvWiqw== -"@talend/locales-tui-forms@^10.2.4": - version "10.2.4" - resolved "https://registry.yarnpkg.com/@talend/locales-tui-forms/-/locales-tui-forms-10.2.4.tgz#ea71b0d4876a82bea209d85f7da9d7b5c9bf248c" - integrity sha512-3rHgRKv9bc4rpLA3p4CQ7cGEWbHVITv6aRDLjhca6ZFmlQECC0JsghrqUYZ3GZeJmHezWGZm0LLRw4nNXBHwUA== +"@talend/locales-tui-forms@^15.2.0": + version "15.2.0" + resolved "https://registry.yarnpkg.com/@talend/locales-tui-forms/-/locales-tui-forms-15.2.0.tgz#dee8f65820b7e4e26de8b7972a48fd108bb0ffeb" + integrity sha512-6UMXC8/2qSB7u0ovYsvTqw0mtDsMUWTp/ahmuf4VtRGZDaHxwKl1TMhNgcVKDzwQc7AVzP4DBwG3MbzXqBEYlA== "@testing-library/cypress@^10.0.2": version "10.0.2"