From 5366269e97933cad5f3255ec9ceba9318e992c1d Mon Sep 17 00:00:00 2001 From: Ethan Freestone Date: Fri, 8 Sep 2023 14:53:56 +0100 Subject: [PATCH] feat: Number generator Swapped implementation to full Modal implementation as per the other apps --- .../FieldCode/FieldCode.js | 11 ++++++++--- src/Settings/NumberGeneratorOptions.js | 16 ++++++++-------- translations/ui-organizations/en.json | 2 ++ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/Organizations/OrganizationForm/OrganizationSummaryForm/FieldCode/FieldCode.js b/src/Organizations/OrganizationForm/OrganizationSummaryForm/FieldCode/FieldCode.js index 72a04dfc..e5a8aaef 100644 --- a/src/Organizations/OrganizationForm/OrganizationSummaryForm/FieldCode/FieldCode.js +++ b/src/Organizations/OrganizationForm/OrganizationSummaryForm/FieldCode/FieldCode.js @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'; import { stripesConnect, useStripes } from '@folio/stripes/core'; import { Col, Row, TextField } from '@folio/stripes/components'; -import { NumberGeneratorButton } from '@folio/service-interaction'; +import { NumberGeneratorModalButton } from '@folio/service-interaction'; import { fetchOrgsByParam } from '../../../../common/resources'; import { validateOrgCode } from './validateOrgCode'; @@ -48,11 +48,16 @@ const FieldCode = ({ orgId, mutator }) => { vendorCodeSetting === 'useBoth' ) && - } callback={(generated) => change('code', generated)} + fullWidth id="vendor-code-generator" + generateButtonLabel={} generator="organizations_vendorCode" - sequence="vendor" + modalProps={{ + label: + }} /> } diff --git a/src/Settings/NumberGeneratorOptions.js b/src/Settings/NumberGeneratorOptions.js index ab67580a..e49a4cb9 100644 --- a/src/Settings/NumberGeneratorOptions.js +++ b/src/Settings/NumberGeneratorOptions.js @@ -49,14 +49,6 @@ const NumberGeneratorOptions = (props) => { > - } - type="radio" - value="useGenerator" - /> { type="radio" value="useBoth" /> + } + type="radio" + value="useGenerator" + /> diff --git a/translations/ui-organizations/en.json b/translations/ui-organizations/en.json index 43a37277..c424da00 100644 --- a/translations/ui-organizations/en.json +++ b/translations/ui-organizations/en.json @@ -443,6 +443,8 @@ "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.", + "numberGenerator.vendorCodeGenerator": "Vendor code generator", + "numberGenerator.generateVendorCode": "Generate vendor code", "permission.view": "Organizations: View", "permission.edit": "Organizations: View, edit", "permission.create": "Organizations: View, edit, create",