Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIORGS-453: Enhancement settings help text #670

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -16,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';
Expand Down Expand Up @@ -50,7 +53,27 @@ const NumberGeneratorSettingsForm = ({ handleSubmit, pristine, submitting }) =>
<Col xs={12}>
<div className={css.marginBottomGutter}>
<MessageBanner>
<FormattedMessage id="ui-organizations.settings.numberGeneratorOptions.info" />
<p><FormattedMessage id="ui-organizations.settings.numberGeneratorOptions.info" /></p>
<p>
<FormattedMessage
id="ui-organizations.settings.numberGeneratorOptions.infoAdditional"
values={{
serviceInteractionLink: (
<Link to={SERVICE_INTERACTION_API}>
<FormattedMessage id="stripes-core.settings" />{' > '}
<FormattedMessage id="ui-service-interaction.meta.title" />
</Link>
),
numberGeneratorSequencesLink: (
<Link to={SERVICE_INTERACTION_NUMBER_GENERATOR_SEQUENCES_API}>
<FormattedMessage id="stripes-core.settings" />{' > '}
<FormattedMessage id="ui-service-interaction.meta.title" />{' > '}
<FormattedMessage id="ui-service-interaction.settings.numberGeneratorSequences" />
</Link>
),
}}
/>
</p>
</MessageBanner>
</div>
</Col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('NumberGeneratorSettingsForm', () => {

expect(screen.getByText('ui-organizations.settings.numberGeneratorOptions')).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();
Expand Down
3 changes: 3 additions & 0 deletions src/common/constants/numberGenerator.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
1 change: 1 addition & 0 deletions translations/ui-organizations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +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.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.",
Expand Down
Loading