From 427c232eae827eed1021b9641f2c7336feaf290f Mon Sep 17 00:00:00 2001 From: UladzislauKutarkin <72550466+UladzislauKutarkin@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:42:17 +0400 Subject: [PATCH] UIORGS-425: Use Save & close button label stripes-component translation key (#637) --- CHANGELOG.md | 1 + .../OrganizationIntegrationForm.js | 2 +- .../OrganizationIntegrationForm.test.js.snap | 2 +- .../OrganizationAccounts.test.js | 10 +- .../OrganizationAccounts.test.js.snap | 1 + .../OrganizationSummary.test.js | 35 ++++--- .../OrganizationAccountsForm.test.js | 13 ++- .../OrganizationAccountsForm.test.js.snap | 14 +-- .../OrganizationContactInfoForm.test.js.snap | 87 ++++++++++------ .../OrganizationForm/OrganizationForm.js | 2 +- .../OrganizationSummaryForm.test.js | 13 ++- .../OrganizationSummaryForm.test.js.snap | 34 ++++--- .../OrganizationVendorInfoForm.test.js.snap | 15 +-- .../OrganizationForm.test.js.snap | 6 +- src/contacts/EditContact/EditContact.js | 2 +- .../__snapshots__/EditContact.test.js.snap | 99 +++++++++++++------ translations/ui-organizations/en.json | 1 - 17 files changed, 215 insertions(+), 122 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e7aa473..d4a39618 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * UX Consistency: HTML Page Title display when the third pane (detail record) displays. Refs UIORGS-423. * Settings > Organizations > Banking information is not properly fenced off by permissions. Refs UIORGS-436. +* Use Save & close button label stripes-component translation key - all UI modules. Refs UIORGS-425. ## [5.1.1](https://github.com/folio-org/ui-organizations/tree/v5.1.1) (2024-04-18) [Full Changelog](https://github.com/folio-org/ui-organizations/compare/v5.1.0...v5.1.1) diff --git a/src/OrganizationIntegration/OrganizationIntegrationForm/OrganizationIntegrationForm.js b/src/OrganizationIntegration/OrganizationIntegrationForm/OrganizationIntegrationForm.js index c009bc29..c2b7561c 100644 --- a/src/OrganizationIntegration/OrganizationIntegrationForm/OrganizationIntegrationForm.js +++ b/src/OrganizationIntegration/OrganizationIntegrationForm/OrganizationIntegrationForm.js @@ -55,7 +55,7 @@ const OrganizationIntegrationForm = ({ disabled={pristine || submitting} onClick={handleSubmit} > - + ); diff --git a/src/OrganizationIntegration/OrganizationIntegrationForm/__snapshots__/OrganizationIntegrationForm.test.js.snap b/src/OrganizationIntegration/OrganizationIntegrationForm/__snapshots__/OrganizationIntegrationForm.test.js.snap index b113b6d8..a3374648 100644 --- a/src/OrganizationIntegration/OrganizationIntegrationForm/__snapshots__/OrganizationIntegrationForm.test.js.snap +++ b/src/OrganizationIntegration/OrganizationIntegrationForm/__snapshots__/OrganizationIntegrationForm.test.js.snap @@ -1486,7 +1486,7 @@ exports[`OrganizationIntegrationForm should render correct form structure 1`] = - ui-organizations.button.saveAndClose + stripes-components.saveAndClose diff --git a/src/Organizations/OrganizationDetails/OrganizationAccounts/OrganizationAccounts.test.js b/src/Organizations/OrganizationDetails/OrganizationAccounts/OrganizationAccounts.test.js index c05393fe..347e604b 100644 --- a/src/Organizations/OrganizationDetails/OrganizationAccounts/OrganizationAccounts.test.js +++ b/src/Organizations/OrganizationDetails/OrganizationAccounts/OrganizationAccounts.test.js @@ -1,6 +1,7 @@ import React from 'react'; import { render } from '@folio/jest-config-stripes/testing-library/react'; +import { QueryClient, QueryClientProvider } from 'react-query'; import OrganizationAccounts from './OrganizationAccounts'; jest.mock('@folio/stripes-components/lib/NoValue', () => { @@ -18,10 +19,13 @@ const accounts = [{ libraryEdiCode: 'ECDA', notes: 'Default account', }]; +const queryClient = new QueryClient(); const renderOrganizationAccounts = () => render( - , + + , + , ); describe('OrganizationAccounts', () => { diff --git a/src/Organizations/OrganizationDetails/OrganizationAccounts/__snapshots__/OrganizationAccounts.test.js.snap b/src/Organizations/OrganizationDetails/OrganizationAccounts/__snapshots__/OrganizationAccounts.test.js.snap index b358f210..0ea49c0b 100644 --- a/src/Organizations/OrganizationDetails/OrganizationAccounts/__snapshots__/OrganizationAccounts.test.js.snap +++ b/src/Organizations/OrganizationDetails/OrganizationAccounts/__snapshots__/OrganizationAccounts.test.js.snap @@ -209,5 +209,6 @@ exports[`OrganizationAccounts should render correct structure 1`] = ` + , `; diff --git a/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.test.js b/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.test.js index e6ba9692..6e24e96c 100644 --- a/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.test.js +++ b/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.test.js @@ -4,6 +4,7 @@ import { IntlProvider } from 'react-intl'; import '@folio/stripes-acq-components/test/jest/__mock__'; +import { QueryClient, QueryClientProvider } from 'react-query'; import OrganizationSummary from './OrganizationSummary'; const STUB_ORG = { @@ -52,22 +53,26 @@ const messages = { 'stripes-components.noValue.noValueSet': 'noValueSet', }; +const queryClient = new QueryClient(); + const renderOrganizationSummary = (organization) => (render( - - - , + + + + , + , )); describe('OrganizationSummary component', () => { diff --git a/src/Organizations/OrganizationForm/OrganizationAccountsForm/OrganizationAccountsForm.test.js b/src/Organizations/OrganizationForm/OrganizationAccountsForm/OrganizationAccountsForm.test.js index 73bf74d9..00a55d54 100644 --- a/src/Organizations/OrganizationForm/OrganizationAccountsForm/OrganizationAccountsForm.test.js +++ b/src/Organizations/OrganizationForm/OrganizationAccountsForm/OrganizationAccountsForm.test.js @@ -4,6 +4,7 @@ import { MemoryRouter } from 'react-router-dom'; import stripesFinalForm from '@folio/stripes/final-form'; +import { QueryClient, QueryClientProvider } from 'react-query'; import OrganizationAccountsForm from './OrganizationAccountsForm'; const TestForm = stripesFinalForm({})( @@ -29,11 +30,15 @@ const account = { notes: '', paymentMethod: 'Credit Card', }; +const queryClient = new QueryClient(); + const renderForm = ({ initialValues = {} } = {}) => render( - , + + + , { wrapper: MemoryRouter }, ); diff --git a/src/Organizations/OrganizationForm/OrganizationAccountsForm/__snapshots__/OrganizationAccountsForm.test.js.snap b/src/Organizations/OrganizationForm/OrganizationAccountsForm/__snapshots__/OrganizationAccountsForm.test.js.snap index 12dddefb..f11d1616 100644 --- a/src/Organizations/OrganizationForm/OrganizationAccountsForm/__snapshots__/OrganizationAccountsForm.test.js.snap +++ b/src/Organizations/OrganizationForm/OrganizationAccountsForm/__snapshots__/OrganizationAccountsForm.test.js.snap @@ -453,8 +453,8 @@ exports[`OrganizationAccountsForm should render correct structure with defined a /> @@ -475,7 +475,7 @@ exports[`OrganizationAccountsForm should render correct structure with defined a >