From 2b8e839a79ae3bc5539eb620c3077c77165e31d7 Mon Sep 17 00:00:00 2001 From: Alisher Musurmonov Date: Wed, 11 Oct 2023 18:57:06 +0500 Subject: [PATCH 01/26] UIORGS-391: add initial routing config and components --- CHANGELOG.md | 1 + .../AccountTypeSettings.js | 54 ++++++++++++++++ src/Settings/AccountTypeSettings/index.js | 1 + .../BankingInformationSettings.js | 64 +++++++++++++++++++ .../BankingInformationSettings/constants.js | 4 ++ .../BankingInformationSettings/index.js | 1 + src/Settings/SettingsPage.js | 14 ++++ translations/ui-organizations/en.json | 5 ++ 8 files changed, 144 insertions(+) create mode 100644 src/Settings/AccountTypeSettings/AccountTypeSettings.js create mode 100644 src/Settings/AccountTypeSettings/index.js create mode 100644 src/Settings/BankingInformationSettings/BankingInformationSettings.js create mode 100644 src/Settings/BankingInformationSettings/constants.js create mode 100644 src/Settings/BankingInformationSettings/index.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 4026bd20..ca875a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Upgrade `Node.js` to `18` version in GitHub Actions. Refs UIORGS-378. * *BREAKING* bump `react-intl` to `v6.4.4`. Refs UIORGS-386. * Add a message indicating future functionality for EDI naming convention. Refs UIORGS-382. +* Settings for banking information. Refs UIORGS-391. ## [4.0.0](https://github.com/folio-org/ui-organizations/tree/v4.0.0) (2023-02-22) [Full Changelog](https://github.com/folio-org/ui-organizations/compare/v3.3.1...v4.0.0) diff --git a/src/Settings/AccountTypeSettings/AccountTypeSettings.js b/src/Settings/AccountTypeSettings/AccountTypeSettings.js new file mode 100644 index 00000000..4488e0e2 --- /dev/null +++ b/src/Settings/AccountTypeSettings/AccountTypeSettings.js @@ -0,0 +1,54 @@ +import React, { Component } from 'react'; +import { FormattedMessage } from 'react-intl'; + +import { stripesShape } from '@folio/stripes/core'; +import { ControlledVocab } from '@folio/stripes/smart-components'; +import { getControlledVocabTranslations } from '@folio/stripes-acq-components'; + +class AccountTypeSettings extends Component { + constructor(props) { + super(props); + this.connectedControlledVocab = props.stripes.connect(ControlledVocab); + } + + render() { + const { stripes } = this.props; + const columnMapping = { + value: , + action: , + }; + + const hasEditPerms = stripes.hasPerm('ui-organizations.settings'); + const actionSuppressor = { + edit: () => !hasEditPerms, + delete: () => !hasEditPerms, + }; + + const ConnectedComponent = this.connectedControlledVocab; + + return ( + } + translations={getControlledVocabTranslations('ui-organizations.settings.accountTypes')} + objectLabel="Categories" + visibleFields={['value']} + columnMapping={columnMapping} + hiddenFields={['lastUpdated', 'numberOfObjects']} + nameKey="categories" + id="categories" + sortby="value" + /> + ); + } +} + +AccountTypeSettings.propTypes = { + stripes: stripesShape.isRequired, +}; + +export default AccountTypeSettings; diff --git a/src/Settings/AccountTypeSettings/index.js b/src/Settings/AccountTypeSettings/index.js new file mode 100644 index 00000000..db0e3b28 --- /dev/null +++ b/src/Settings/AccountTypeSettings/index.js @@ -0,0 +1 @@ +export { default as AccountTypeSettings } from './AccountTypeSettings'; diff --git a/src/Settings/BankingInformationSettings/BankingInformationSettings.js b/src/Settings/BankingInformationSettings/BankingInformationSettings.js new file mode 100644 index 00000000..f39e1f12 --- /dev/null +++ b/src/Settings/BankingInformationSettings/BankingInformationSettings.js @@ -0,0 +1,64 @@ +import { FormattedMessage } from 'react-intl'; +import { Field, Form } from 'react-final-form'; + +import { + Button, + Checkbox, + Col, + Headline, + Pane, + RadioButton, + RadioButtonGroup, + Row, +} from '@folio/stripes/components'; + +const BankingInformationSettings = () => { + const onSubmit = (values) => { + console.log(values); + }; + + return ( + } + > + + + + + + + +
( + + + } + id="enabled" + value="true" + /> + } + id="disabled" + value="false" + /> + + +
+ )} + /> + +
+
+ ); +}; + +export default BankingInformationSettings; diff --git a/src/Settings/BankingInformationSettings/constants.js b/src/Settings/BankingInformationSettings/constants.js new file mode 100644 index 00000000..f4707bf5 --- /dev/null +++ b/src/Settings/BankingInformationSettings/constants.js @@ -0,0 +1,4 @@ +export const typeStatus = [ + { value: 'Active' }, + { value: 'Inactive' }, +]; diff --git a/src/Settings/BankingInformationSettings/index.js b/src/Settings/BankingInformationSettings/index.js new file mode 100644 index 00000000..6fe1ba6f --- /dev/null +++ b/src/Settings/BankingInformationSettings/index.js @@ -0,0 +1 @@ +export { default as BankingInformationSettings } from './BankingInformationSettings'; diff --git a/src/Settings/SettingsPage.js b/src/Settings/SettingsPage.js index 65d7c8d4..60be7242 100644 --- a/src/Settings/SettingsPage.js +++ b/src/Settings/SettingsPage.js @@ -5,6 +5,8 @@ import { Settings } from '@folio/stripes/smart-components'; import { CategorySettings } from './CategorySettings'; import { TypeSettings } from './TypeSettings'; +import { BankingInformationSettings } from './BankingInformationSettings'; +import { AccountTypeSettings } from './AccountTypeSettings'; const pages = [ { @@ -19,6 +21,18 @@ const pages = [ perm: 'settings.organizations.enabled', route: 'type', }, + { + component: BankingInformationSettings, + label: , + perm: 'settings.organizations.enabled', + route: 'banking-information', + }, + { + component: AccountTypeSettings, + label: , + perm: 'settings.organizations.enabled', + route: 'account-types', + }, ]; const SettingsPage = (props) => ( diff --git a/translations/ui-organizations/en.json b/translations/ui-organizations/en.json index 7b83dd21..c1253386 100644 --- a/translations/ui-organizations/en.json +++ b/translations/ui-organizations/en.json @@ -441,6 +441,11 @@ "settings.type": "Type", "settings.typeStatus.Active": "Active", "settings.typeStatus.Inactive": "Inactive", + "settings.bankingInformation": "Banking information", + "settings.bankingInformation.enabled": "Enabled", + "settings.bankingInformation.disabled": "Disabled", + "settings.accountTypes": "Account types", + "permission.view": "Organizations: View", "permission.edit": "Organizations: View, edit", "permission.create": "Organizations: View, edit, create", From 04b922ad0b716e83cc55c51fc655404f2e8ff644 Mon Sep 17 00:00:00 2001 From: Zak Burke Date: Wed, 11 Oct 2023 09:31:44 -0400 Subject: [PATCH 02/26] UIORGS-404 bump optional plugins to compatible versions (#572) Use plugins compatible with the requested version of stripes (v9). Refs UIORGS-404 --- CHANGELOG.md | 2 +- package.json | 6 +- ...OrganizationContactPeopleForm.test.js.snap | 262 +++---- .../OrganizationInterfacesForm.test.js.snap | 212 +++--- .../__snapshots__/ViewContact.test.js.snap | 702 +++++++++--------- 5 files changed, 602 insertions(+), 582 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca875a40..eb9627b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ * Upgrade `Node.js` to `18` version in GitHub Actions. Refs UIORGS-378. * *BREAKING* bump `react-intl` to `v6.4.4`. Refs UIORGS-386. * Add a message indicating future functionality for EDI naming convention. Refs UIORGS-382. -* Settings for banking information. Refs UIORGS-391. +* Bump optional plugins to their `@folio/stripes` `v9` compatible versions. Refs UIORGS-404. ## [4.0.0](https://github.com/folio-org/ui-organizations/tree/v4.0.0) (2023-02-22) [Full Changelog](https://github.com/folio-org/ui-organizations/compare/v3.3.1...v4.0.0) diff --git a/package.json b/package.json index c1db681a..9e6ca65e 100644 --- a/package.json +++ b/package.json @@ -255,7 +255,7 @@ "@folio/jest-config-stripes": "^2.0.0", "@folio/stripes": "^9.0.0", "@folio/stripes-cli": "^3.0.0", - "@formatjs/cli": "^6.1.3", + "@formatjs/cli": "^6.1.3", "babel-jest": "^26.3.0", "chai": "^4.2.0", "core-js": "^3.6.4", @@ -302,7 +302,7 @@ "redux": "^4.0.0" }, "optionalDependencies": { - "@folio/plugin-find-contact": "^4.0.0", - "@folio/plugin-find-interface": "^4.0.0" + "@folio/plugin-find-contact": "^5.0.0", + "@folio/plugin-find-interface": "^5.0.0" } } diff --git a/src/Organizations/OrganizationForm/OrganizationContactPeopleForm/__snapshots__/OrganizationContactPeopleForm.test.js.snap b/src/Organizations/OrganizationForm/OrganizationContactPeopleForm/__snapshots__/OrganizationContactPeopleForm.test.js.snap index 73757dde..df1d973e 100644 --- a/src/Organizations/OrganizationForm/OrganizationContactPeopleForm/__snapshots__/OrganizationContactPeopleForm.test.js.snap +++ b/src/Organizations/OrganizationForm/OrganizationContactPeopleForm/__snapshots__/OrganizationContactPeopleForm.test.js.snap @@ -10,165 +10,169 @@ exports[`OrganizationContactPeopleForm should render correct structure 1`] = ` class="col-xs-12" >
-
+
- ui-organizations.contactPeople.name -
-
- ui-organizations.contactPeople.categories -
-
- ui-organizations.contactPeople.emails -
-
- ui-organizations.contactPeople.note +
+ ui-organizations.contactPeople.name +
+
+ ui-organizations.contactPeople.categories +
+
+ ui-organizations.contactPeople.emails +
+
+ ui-organizations.contactPeople.note +
+
-
-
-
diff --git a/src/Organizations/OrganizationForm/OrganizationInterfacesForm/__snapshots__/OrganizationInterfacesForm.test.js.snap b/src/Organizations/OrganizationForm/OrganizationInterfacesForm/__snapshots__/OrganizationInterfacesForm.test.js.snap index 80fd9bb2..87554144 100644 --- a/src/Organizations/OrganizationForm/OrganizationInterfacesForm/__snapshots__/OrganizationInterfacesForm.test.js.snap +++ b/src/Organizations/OrganizationForm/OrganizationInterfacesForm/__snapshots__/OrganizationInterfacesForm.test.js.snap @@ -10,90 +10,74 @@ exports[`OrganizationInterfacesForm should render correct structure 1`] = ` class="col-xs-12" >
-
+
- ui-organizations.interface.name -
-
- ui-organizations.interface.url +
+ ui-organizations.interface.name +
+
+ ui-organizations.interface.url +
+
-
-
-
-
diff --git a/src/contacts/ViewContact/__snapshots__/ViewContact.test.js.snap b/src/contacts/ViewContact/__snapshots__/ViewContact.test.js.snap index 626cfe88..e238b370 100644 --- a/src/contacts/ViewContact/__snapshots__/ViewContact.test.js.snap +++ b/src/contacts/ViewContact/__snapshots__/ViewContact.test.js.snap @@ -439,148 +439,152 @@ exports[`ViewContact should render correct structure 1`] = ` role="region" >
-
+
- ui-organizations.contactPeople.email -
-
- ui-organizations.contactPeople.description -
-
- ui-organizations.contactPeople.language -
-
- ui-organizations.contactPeople.categories -
-
- ui-organizations.primaryItem +
+ ui-organizations.contactPeople.email +
+
+ ui-organizations.contactPeople.description +
+
+ ui-organizations.contactPeople.language +
+
+ ui-organizations.contactPeople.categories +
+
+ ui-organizations.primaryItem +
-
-
- cust.service03@amazon.com -
-
- customer service -
-
- English -
-
- Customer Service -
-
- ui-organizations.primaryItem +
+ cust.service03@amazon.com +
+
+ customer service +
+
+ English +
+
+ Customer Service +
+
+ ui-organizations.primaryItem +
-
-
@@ -646,148 +650,152 @@ exports[`ViewContact should render correct structure 1`] = ` role="region" >
-
+
- ui-organizations.contactPeople.phoneNumber -
-
- ui-organizations.contactPeople.type -
-
- ui-organizations.contactPeople.language -
-
- ui-organizations.contactPeople.categories -
-
- ui-organizations.primaryItem +
+ ui-organizations.contactPeople.phoneNumber +
+
+ ui-organizations.contactPeople.type +
+
+ ui-organizations.contactPeople.language +
+
+ ui-organizations.contactPeople.categories +
+
+ ui-organizations.primaryItem +
-
-
- 1-888-238-22090 -
-
- Mobile -
-
- English -
-
- Customer Service -
-
- ui-organizations.primaryItem +
+ 1-888-238-22090 +
+
+ Mobile +
+
+ English +
+
+ Customer Service +
+
+ ui-organizations.primaryItem +
-
-
@@ -853,155 +861,159 @@ exports[`ViewContact should render correct structure 1`] = ` role="region" >
-
+
- ui-organizations.contactPeople.name -
-
- ui-organizations.contactPeople.description -
-
- ui-organizations.contactPeople.language -
-
- ui-organizations.contactPeople.categories -
-
- ui-organizations.primaryItem +
+ ui-organizations.contactPeople.name +
+
+ ui-organizations.contactPeople.description +
+
+ ui-organizations.contactPeople.language +
+
+ ui-organizations.contactPeople.categories +
+
+ ui-organizations.primaryItem +
-
-
-
- main website -
-
- en-us -
-
- Customer Service -
-
- ui-organizations.primaryItem + + https://www.amazon.com + +
+
+ main website +
+
+ en-us +
+
+ Customer Service +
+
+ ui-organizations.primaryItem +
-
-
From 0c5efe64eac82040ef1ca5176c61390da5e30675 Mon Sep 17 00:00:00 2001 From: Alisher Musurmonov Date: Thu, 12 Oct 2023 15:53:33 +0500 Subject: [PATCH 03/26] Release v5.0.0 (#573) --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb9627b4..f30bba80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change history for ui-organizations -## 5.0.0 (IN PROGRESS) +## 5.1.0 (IN PROGRESS) + +## [5.0.0](https://github.com/folio-org/ui-organizations/tree/v5.0.0) (2023-10-12) +[Full Changelog](https://github.com/folio-org/ui-organizations/compare/v4.0.0...v5.0.0) * Unpin `@rehooks/local-storage` now that it's no longer broken. Refs UIORGS-344. * Add `Note` field to contact people summary list. Refs UIORGS-352. diff --git a/package.json b/package.json index 9e6ca65e..0b817ec2 100644 --- a/package.json +++ b/package.json @@ -281,7 +281,7 @@ "regenerator-runtime": "^0.13.3" }, "dependencies": { - "@folio/plugin-find-organization": "^4.0.0", + "@folio/plugin-find-organization": "^5.0.0", "@folio/stripes-acq-components": "~5.0.0", "lodash": "^4.17.5", "moment-timezone": "^0.5.20", From cdcf2cf72f6bbf74c9a4cf554e2ad8a536d580dc Mon Sep 17 00:00:00 2001 From: Alisher Musurmonov Date: Mon, 16 Oct 2023 17:13:20 +0500 Subject: [PATCH 04/26] UIORGS-383: add donor info for organization summary (#574) * UIORGS-383: add donor info for organization summary * tests: fix failing tests * tests: remove failing snapshots * tests: generate snapshot tests * tests: update snapshot tests * improve: bump package.json, fix organizations summary layout, remove checkbox handler --- CHANGELOG.md | 2 + package.json | 2 +- .../OrganizationCreate/OrganizationCreate.js | 1 + .../OrganizationDetails.js | 1 + .../OrganizationSummary.js | 12 ++ .../OrganizationForm/OrganizationForm.test.js | 14 +- .../OrganizationSummaryForm.js | 41 +++-- .../OrganizationSummaryForm.test.js.snap | 173 ++++++++++++------ translations/ui-organizations/en.json | 1 + 9 files changed, 166 insertions(+), 81 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f30bba80..07078bfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 5.1.0 (IN PROGRESS) +* Designate Organization as donor. Refs UIORGS-383. + ## [5.0.0](https://github.com/folio-org/ui-organizations/tree/v5.0.0) (2023-10-12) [Full Changelog](https://github.com/folio-org/ui-organizations/compare/v4.0.0...v5.0.0) diff --git a/package.json b/package.json index 0b817ec2..4d765cd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@folio/organizations", - "version": "5.0.0", + "version": "5.1.0", "description": "Organizations", "main": "index.js", "repository": "folio-org/ui-organizations", diff --git a/src/Organizations/OrganizationCreate/OrganizationCreate.js b/src/Organizations/OrganizationCreate/OrganizationCreate.js index 26bbf3f2..24f5d6de 100644 --- a/src/Organizations/OrganizationCreate/OrganizationCreate.js +++ b/src/Organizations/OrganizationCreate/OrganizationCreate.js @@ -19,6 +19,7 @@ const INITIAL_VALUES = { interfaces: [], contacts: [], isVendor: false, + isDonor: false, edi: { vendorEdiType: '31B/US-SAN', libEdiType: '31B/US-SAN', diff --git a/src/Organizations/OrganizationDetails/OrganizationDetails.js b/src/Organizations/OrganizationDetails/OrganizationDetails.js index 2d381b61..6c6a71d1 100644 --- a/src/Organizations/OrganizationDetails/OrganizationDetails.js +++ b/src/Organizations/OrganizationDetails/OrganizationDetails.js @@ -269,6 +269,7 @@ const OrganizationDetails = ({ description={organization.description} erpCode={organization.erpCode} isVendor={organization.isVendor} + isDonor={organization.isDonor} language={organization.language} metadata={organization.metadata} name={organization.name} diff --git a/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js b/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js index d8a04dc6..ae5cb36a 100644 --- a/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js +++ b/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js @@ -31,6 +31,7 @@ const OrganizationSummary = ({ description, erpCode, isVendor, + isDonor, language, metadata, name, @@ -101,6 +102,15 @@ const OrganizationSummary = ({ /> + + } + vertical + /> + + ({ ...jest.requireActual('react-router'), useHistory: jest.fn(), diff --git a/src/Organizations/OrganizationForm/OrganizationSummaryForm/OrganizationSummaryForm.js b/src/Organizations/OrganizationForm/OrganizationSummaryForm/OrganizationSummaryForm.js index d9459640..6973df2e 100644 --- a/src/Organizations/OrganizationForm/OrganizationSummaryForm/OrganizationSummaryForm.js +++ b/src/Organizations/OrganizationForm/OrganizationSummaryForm/OrganizationSummaryForm.js @@ -159,20 +159,6 @@ function OrganizationSummaryForm({ initialValues }) { name="language" /> - - } - name="isVendor" - type="checkbox" - onChange={onChangeIsVendor} - vertical - validateFields={[]} - /> - + + } + name="isDonor" + type="checkbox" + vertical + validateFields={[]} + /> + + + } + name="isVendor" + type="checkbox" + vertical + onChange={onChangeIsVendor} + validateFields={[]} + /> + } diff --git a/src/Organizations/OrganizationForm/OrganizationSummaryForm/__snapshots__/OrganizationSummaryForm.test.js.snap b/src/Organizations/OrganizationForm/OrganizationSummaryForm/__snapshots__/OrganizationSummaryForm.test.js.snap index 200624cf..048253ee 100644 --- a/src/Organizations/OrganizationForm/OrganizationSummaryForm/__snapshots__/OrganizationSummaryForm.test.js.snap +++ b/src/Organizations/OrganizationForm/OrganizationSummaryForm/__snapshots__/OrganizationSummaryForm.test.js.snap @@ -7765,60 +7765,6 @@ exports[`OrganizationSummaryForm should render correct structure 1`] = `
-
-
- -
-
-
@@ -7945,14 +7891,14 @@ exports[`OrganizationSummaryForm should render correct structure 1`] = ` >