From 62a36e5f2fc6ae9c95a4845708b9c3c26b1ad6c8 Mon Sep 17 00:00:00 2001 From: elsenhans Date: Thu, 9 Jan 2025 18:10:30 +0100 Subject: [PATCH 1/3] UIORGS-453-enhancement-settings-help-text --- CHANGELOG.md | 1 + .../NumberGeneratorSettingsForm.js | 20 +++++++++++++++++++ .../NumberGeneratorSettingsForm.test.js | 3 ++- translations/ui-organizations/en.json | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b454b98..7d5bd8bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Add claiming to organization integration details. Refs UIORGS-442. * Add "Duplicate" integration action to organization integration view. Refs UIORGS-441. * *BREAKING* Add number generator for vendor code including settings page. Refs UIORGS-336, UIORGS-337. +* Enhancement help text on Settings > Organizations > Number generator options. Refs UIORGS-453. ## [5.2.0](https://github.com/folio-org/ui-organizations/tree/v5.2.0) (2024-10-31) [Full Changelog](https://github.com/folio-org/ui-organizations/compare/v5.1.1...v5.2.0) diff --git a/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.js b/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.js index 3f43e906..554ebbd6 100644 --- a/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.js +++ b/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.js @@ -1,4 +1,5 @@ import PropTypes from 'prop-types'; +import { Link } from 'react-router-dom'; import { Field } from 'react-final-form'; import { FormattedMessage } from 'react-intl'; @@ -51,6 +52,25 @@ const NumberGeneratorSettingsForm = ({ handleSubmit, pristine, submitting }) =>
+
+ + {' > '} + + + ), + numberGeneratorSequencesLink: ( + + {' > '} + {' > '} + + + ), + }} + />
diff --git a/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.test.js b/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.test.js index 81845d9d..bddaada9 100644 --- a/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.test.js +++ b/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.test.js @@ -31,7 +31,8 @@ describe('NumberGeneratorSettingsForm', () => { renderComponent(); expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions')).toBeInTheDocument(); - expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions.info')).toBeInTheDocument(); + expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions.info', { exact: false })).toBeInTheDocument(); + expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions.enhancement', { exact: false })).toBeInTheDocument(); expect( screen.getByLabelText('ui-organizations.settings.numberGeneratorOptions.useTextFieldForVendor'), ).toBeInTheDocument(); diff --git a/translations/ui-organizations/en.json b/translations/ui-organizations/en.json index 152e757d..a7238a74 100644 --- a/translations/ui-organizations/en.json +++ b/translations/ui-organizations/en.json @@ -514,9 +514,12 @@ "settings.typeStatus.Inactive": "Inactive", "settings.numberGeneratorOptions": "Number generator options", "settings.numberGeneratorOptions.info": "Fields which are usually filled using a numeric sequence can use the number generator. When the generator is switched on the field can either be fixed to prevent manual update, or made fully editable. When switched off, the field must be filled manually.", + "settings.numberGeneratorOptions.enhancement": "Additional number generator settings are available under {serviceInteractionLink}. At {numberGeneratorSequencesLink} sequences can be defined by selecting the appropriate generator via the drop-down menu.", "settings.numberGeneratorOptions.useGeneratorForVendor": "Number generator on, fixed: the vendor code can be filled using the generator only.", "settings.numberGeneratorOptions.useTextFieldForVendor": "Number generator off: the vendor code can be filled manually only.", "settings.numberGeneratorOptions.useBothForVendor": "Number generator on, editable: the vendor code can be filled using the generator and be edited, or filled manually.", + "settings.serviceInteraction.text": "Service interaction", + "settings.numberGeneratorSequences.text": "Number generator sequences", "settings.numberGeneratorOptions.save.error": "Error saving setting", "settings.numberGeneratorOptions.save.success": "Setting was successfully saved", "numberGenerator.vendorCodeGenerator": "Vendor code generator", From 3a51f8586028971cf7c812ede80f01dc903e676c Mon Sep 17 00:00:00 2001 From: elsenhans Date: Fri, 10 Jan 2025 12:25:20 +0100 Subject: [PATCH 2/3] UIORGS-453-enhancement-settings-help-text refinement --- .../NumberGeneratorSettingsForm.js | 43 ++++++++++--------- .../NumberGeneratorSettingsForm.test.js | 4 +- src/common/constants/numberGenerator.js | 3 ++ translations/ui-organizations/en.json | 2 +- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.js b/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.js index 554ebbd6..14fb9145 100644 --- a/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.js +++ b/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.js @@ -17,6 +17,8 @@ import stripesFinalForm from '@folio/stripes/final-form'; import css from './NumberGeneratorSettingsForm.css'; import { + SERVICE_INTERACTION_API, + SERVICE_INTERACTION_NUMBER_GENERATOR_SEQUENCES_API, VENDOR_CODE_GENERATOR_OPTIONS, VENDOR_CODE_GENERATOR_SETTINGS_KEY, } from '../../common/constants/numberGenerator'; @@ -51,26 +53,27 @@ const NumberGeneratorSettingsForm = ({ handleSubmit, pristine, submitting }) =>
- -
- - {' > '} - - - ), - numberGeneratorSequencesLink: ( - - {' > '} - {' > '} - - - ), - }} - /> +

+

+ + {' > '} + + + ), + numberGeneratorSequencesLink: ( + + {' > '} + {' > '} + + + ), + }} + /> +

diff --git a/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.test.js b/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.test.js index bddaada9..c1a14716 100644 --- a/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.test.js +++ b/src/Settings/NumberGeneratorSettings/NumberGeneratorSettingsForm.test.js @@ -31,8 +31,8 @@ describe('NumberGeneratorSettingsForm', () => { renderComponent(); expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions')).toBeInTheDocument(); - expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions.info', { exact: false })).toBeInTheDocument(); - expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions.enhancement', { exact: false })).toBeInTheDocument(); + expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions.info')).toBeInTheDocument(); + expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions.infoAdditional')).toBeInTheDocument(); expect( screen.getByLabelText('ui-organizations.settings.numberGeneratorOptions.useTextFieldForVendor'), ).toBeInTheDocument(); diff --git a/src/common/constants/numberGenerator.js b/src/common/constants/numberGenerator.js index d18894b9..9cd225f6 100644 --- a/src/common/constants/numberGenerator.js +++ b/src/common/constants/numberGenerator.js @@ -1,6 +1,9 @@ export const NUMBER_GENERATOR_INTERFACE_NAME = 'servint'; export const NUMBER_GENERATOR_INTERFACE_VERSION = '4.0'; +export const SERVICE_INTERACTION_API = '/settings/service-interaction'; +export const SERVICE_INTERACTION_NUMBER_GENERATOR_SEQUENCES_API = '/settings/service-interaction/numberGeneratorSequences/'; + export const VENDOR_CODE_GENERATOR_OPTIONS = { BOTH: 'useBoth', TEXTFIELD: 'useTextField', diff --git a/translations/ui-organizations/en.json b/translations/ui-organizations/en.json index a7238a74..93986ce2 100644 --- a/translations/ui-organizations/en.json +++ b/translations/ui-organizations/en.json @@ -514,7 +514,7 @@ "settings.typeStatus.Inactive": "Inactive", "settings.numberGeneratorOptions": "Number generator options", "settings.numberGeneratorOptions.info": "Fields which are usually filled using a numeric sequence can use the number generator. When the generator is switched on the field can either be fixed to prevent manual update, or made fully editable. When switched off, the field must be filled manually.", - "settings.numberGeneratorOptions.enhancement": "Additional number generator settings are available under {serviceInteractionLink}. At {numberGeneratorSequencesLink} sequences can be defined by selecting the appropriate generator via the drop-down menu.", + "settings.numberGeneratorOptions.infoAdditional": "Additional number generator settings are available under {serviceInteractionLink}. At {numberGeneratorSequencesLink} sequences can be defined by selecting the appropriate generator via the drop-down menu.", "settings.numberGeneratorOptions.useGeneratorForVendor": "Number generator on, fixed: the vendor code can be filled using the generator only.", "settings.numberGeneratorOptions.useTextFieldForVendor": "Number generator off: the vendor code can be filled manually only.", "settings.numberGeneratorOptions.useBothForVendor": "Number generator on, editable: the vendor code can be filled using the generator and be edited, or filled manually.", From a344832d38db27c67697515c83223fa9e312c8d9 Mon Sep 17 00:00:00 2001 From: elsenhans Date: Fri, 10 Jan 2025 12:30:21 +0100 Subject: [PATCH 3/3] UIORGS-453-enhancement-settings-help-text remove unused --- translations/ui-organizations/en.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/translations/ui-organizations/en.json b/translations/ui-organizations/en.json index 93986ce2..4e7c24d3 100644 --- a/translations/ui-organizations/en.json +++ b/translations/ui-organizations/en.json @@ -518,8 +518,6 @@ "settings.numberGeneratorOptions.useGeneratorForVendor": "Number generator on, fixed: the vendor code can be filled using the generator only.", "settings.numberGeneratorOptions.useTextFieldForVendor": "Number generator off: the vendor code can be filled manually only.", "settings.numberGeneratorOptions.useBothForVendor": "Number generator on, editable: the vendor code can be filled using the generator and be edited, or filled manually.", - "settings.serviceInteraction.text": "Service interaction", - "settings.numberGeneratorSequences.text": "Number generator sequences", "settings.numberGeneratorOptions.save.error": "Error saving setting", "settings.numberGeneratorOptions.save.success": "Setting was successfully saved", "numberGenerator.vendorCodeGenerator": "Vendor code generator",