diff --git a/src/components/POLine/Vendor/VendorForm.js b/src/components/POLine/Vendor/VendorForm.js index 30862f141..a6ca1c083 100644 --- a/src/components/POLine/Vendor/VendorForm.js +++ b/src/components/POLine/Vendor/VendorForm.js @@ -1,7 +1,10 @@ import React, { useCallback, useMemo, useRef } from 'react'; import PropTypes from 'prop-types'; import { useForm } from 'react-final-form'; -import { FormattedMessage } from 'react-intl'; +import { + FormattedMessage, + useIntl, +} from 'react-intl'; import { Col, @@ -27,6 +30,7 @@ const VendorForm = ({ hiddenFields = {}, integrationConfigs = [], }) => { + const { formatMessage } = useIntl(); const { change, getState } = useForm(); const { vendorDetail } = getState().values; const currentAccountNumber = vendorDetail?.vendorAccount; @@ -34,15 +38,16 @@ const VendorForm = ({ const initialAccountNumber = useRef(currentAccountNumber); const activeAccountOptions = useMemo(() => { + const message = ` - ${formatMessage({ id: 'ui-orders.inactive' })}`; const activeAccounts = accounts.filter(({ accountStatus, accountNo }) => { return accountStatus === ACTIVE || accountNo === initialAccountNumber.current; }); return activeAccounts.map(({ name, accountNo, accountStatus }) => ({ - label: `${name} (${accountNo}) ${accountStatus === INACTIVE ? ' - Inactive' : ''}`, + label: `${name} (${accountNo}) ${accountStatus === INACTIVE ? message : ''}`, value: accountNo, })); - }, [accounts, initialAccountNumber]); + }, [accounts, formatMessage]); const onAccountChange = useCallback( ({ target: { value } }) => { diff --git a/translations/ui-orders/en.json b/translations/ui-orders/en.json index 7bd6123ee..d768b6ca8 100644 --- a/translations/ui-orders/en.json +++ b/translations/ui-orders/en.json @@ -1,6 +1,6 @@ { "appMenu.ordersAppSearch": "Orders app Search", - + "inactive": "Inactive", "breakInstanceConnection.modal.heading": "Remove instance connection", "breakInstanceConnection.modal.message": "Making this change will remove the link between the POL and selected inventory instance. Are you sure you would like to proceed with making this change and unlink this POL from the inventory instance \"{titleOrPackage}\"?",