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/OrganizationDetails/OrganizationSummary/OrganizationSummary.js b/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js index 22c29624..ae5cb36a 100644 --- a/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js +++ b/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react'; +import React from 'react'; import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; @@ -6,6 +6,7 @@ import { Checkbox, Col, KeyValue, + MultiColumnList, NoValue, Row, } from '@folio/stripes/components'; @@ -17,6 +18,12 @@ import { import { ORGANIZATION_SECTIONS } from '../../constants'; +const aliasesColumnMapping = { + value: , + description: , +}; +const aliasesVisibleColumns = ['value', 'description']; + const OrganizationSummary = ({ acqUnitIds, aliases, @@ -32,7 +39,6 @@ const OrganizationSummary = ({ organizationTypes, }) => { const defaultLanguageValue = LANG_LABEL_BY_CODE[language] || language; - const alternativeNames = useMemo(() => aliases.map(({ value }) => value).join(', '), [aliases]); return ( <> @@ -48,7 +54,7 @@ const OrganizationSummary = ({ - + } @@ -56,14 +62,14 @@ const OrganizationSummary = ({ /> - + } value={code} /> - + } @@ -71,7 +77,7 @@ const OrganizationSummary = ({ /> - + } > @@ -79,7 +85,7 @@ const OrganizationSummary = ({ - + } @@ -87,7 +93,25 @@ const OrganizationSummary = ({ /> - + + } + vertical + /> + + + + } + vertical + /> + + + } @@ -95,42 +119,31 @@ const OrganizationSummary = ({ /> - + - + } value={description || } /> + - - } - vertical - /> - - - - } - vertical - /> - - - + + } - value={alternativeNames || } - /> + > + + @@ -158,6 +171,7 @@ OrganizationSummary.propTypes = { OrganizationSummary.defaultProps = { aliases: [], isVendor: false, + isDonor: false, }; export default OrganizationSummary; diff --git a/src/Organizations/OrganizationForm/OrganizationSummaryForm/OrganizationSummaryForm.js b/src/Organizations/OrganizationForm/OrganizationSummaryForm/OrganizationSummaryForm.js index 816028b9..6973df2e 100644 --- a/src/Organizations/OrganizationForm/OrganizationSummaryForm/OrganizationSummaryForm.js +++ b/src/Organizations/OrganizationForm/OrganizationSummaryForm/OrganizationSummaryForm.js @@ -77,8 +77,8 @@ function OrganizationSummaryForm({ initialValues }) { onResetVendorFields(); }, [onResetVendorFields]); - const handleCheckbox = useCallback(({ target: { checked, name } }) => { - change(name, checked); + const onChangeIsVendor = useCallback(({ target: { checked } }) => { + change('isVendor', checked); if (initialValues.id && !checked) setVendorUncheckConfirm(true); }, [initialValues.id, change]); @@ -192,7 +192,6 @@ function OrganizationSummaryForm({ initialValues }) { label={} name="isDonor" type="checkbox" - onChange={handleCheckbox} vertical validateFields={[]} /> @@ -206,8 +205,8 @@ function OrganizationSummaryForm({ initialValues }) { label={} name="isVendor" type="checkbox" - onChange={handleCheckbox} vertical + onChange={onChangeIsVendor} validateFields={[]} />