diff --git a/src/Organizations/OrganizationDetails/OrganizationDetails.js b/src/Organizations/OrganizationDetails/OrganizationDetails.js index 6c6a71d1..68251aff 100644 --- a/src/Organizations/OrganizationDetails/OrganizationDetails.js +++ b/src/Organizations/OrganizationDetails/OrganizationDetails.js @@ -61,6 +61,20 @@ import { OrganizationAgreements } from './OrganizationAgreements'; import { OrganizationAccounts } from './OrganizationAccounts'; import { IntegrationDetails } from './IntegrationDetails'; +const { + summarySection, + contactInformationSection, + contactPeopleSection, + interfacesSection, + vendorInformationSection, + vendorTermsSection, + integrationDetailsSection, + accountsSection, + notesSection, + agreements, + donorContacts, +} = ORGANIZATION_SECTIONS; + const OrganizationDetails = ({ onClose, onEdit, @@ -75,16 +89,16 @@ const OrganizationDetails = ({ const stripes = useStripes(); const [isRemoveModalOpened, toggleRemoveModal] = useModalToggle(); const initialAccordionStatus = { - [ORGANIZATION_SECTIONS.summarySection]: true, - [ORGANIZATION_SECTIONS.contactInformationSection]: false, - [ORGANIZATION_SECTIONS.contactPeopleSection]: true, - [ORGANIZATION_SECTIONS.interfacesSection]: false, - [ORGANIZATION_SECTIONS.vendorInformationSection]: false, - [ORGANIZATION_SECTIONS.vendorTermsSection]: false, - [ORGANIZATION_SECTIONS.integrationDetailsSection]: false, - [ORGANIZATION_SECTIONS.accountsSection]: false, - [ORGANIZATION_SECTIONS.notesSection]: false, - [ORGANIZATION_SECTIONS.agreements]: false, + [summarySection]: true, + [contactInformationSection]: false, + [contactPeopleSection]: true, + [interfacesSection]: false, + [vendorInformationSection]: false, + [vendorTermsSection]: false, + [integrationDetailsSection]: false, + [accountsSection]: false, + [notesSection]: false, + [agreements]: false, }; const [isTagsOpened, toggleTagsPane] = useModalToggle(); const paneTitleRef = useRef(); @@ -259,8 +273,8 @@ const OrganizationDetails = ({ + { + Boolean(organization.isVendor && organization.isDonor) && ( + + {/* + TODO: add donor contacts list component https://issues.folio.org/browse/UIORGS-394 + */} + + ) + } + { organization.isVendor && ( <> diff --git a/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js b/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js index ae5cb36a..ee57a036 100644 --- a/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js +++ b/src/Organizations/OrganizationDetails/OrganizationSummary/OrganizationSummary.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useMemo } from 'react'; import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; @@ -6,7 +6,6 @@ import { Checkbox, Col, KeyValue, - MultiColumnList, NoValue, Row, } from '@folio/stripes/components'; @@ -18,12 +17,6 @@ import { import { ORGANIZATION_SECTIONS } from '../../constants'; -const aliasesColumnMapping = { - value: , - description: , -}; -const aliasesVisibleColumns = ['value', 'description']; - const OrganizationSummary = ({ acqUnitIds, aliases, @@ -39,6 +32,7 @@ const OrganizationSummary = ({ organizationTypes, }) => { const defaultLanguageValue = LANG_LABEL_BY_CODE[language] || language; + const alternativeNames = useMemo(() => aliases.map(({ value }) => value).join(', '), [aliases]); return ( <> @@ -54,7 +48,7 @@ const OrganizationSummary = ({ - + } @@ -62,14 +56,14 @@ const OrganizationSummary = ({ /> - + } value={code} /> - + } @@ -77,7 +71,7 @@ const OrganizationSummary = ({ /> - + } > @@ -85,7 +79,7 @@ const OrganizationSummary = ({ - + } @@ -93,25 +87,7 @@ const OrganizationSummary = ({ /> - - } - vertical - /> - - - - } - vertical - /> - - - + } @@ -119,31 +95,42 @@ const OrganizationSummary = ({ /> - + - + } value={description || } /> - - - + + } + vertical + /> + + + + } + vertical + /> + + + } - > - - + value={alternativeNames || } + /> diff --git a/src/Organizations/constants.js b/src/Organizations/constants.js index 457a9a5d..a279fe54 100644 --- a/src/Organizations/constants.js +++ b/src/Organizations/constants.js @@ -12,6 +12,7 @@ export const ORGANIZATION_SECTIONS = { notesSection: 'notesSection', integrationDetailsSection: 'integrationDetailsSection', agreements: 'linkedAgreements', + donorContacts: 'donorContacts', }; export const ORGANIZATION_SECTION_LABELS = { @@ -24,6 +25,7 @@ export const ORGANIZATION_SECTION_LABELS = { [ORGANIZATION_SECTIONS.accountsSection]: , [ORGANIZATION_SECTIONS.integrationDetailsSection]: , [ORGANIZATION_SECTIONS.agreements]: , + [ORGANIZATION_SECTIONS.donorContacts]: , }; export const CREATE_UNITS_PERM = 'organizations.acquisitions-units-assignments.assign'; diff --git a/translations/ui-organizations/en.json b/translations/ui-organizations/en.json index c591d8b2..a89fc668 100644 --- a/translations/ui-organizations/en.json +++ b/translations/ui-organizations/en.json @@ -87,6 +87,7 @@ "contactPeople": "Contact people", "agreements": "Agreements", "vendorInformation": "Vendor information", + "donorContacts": "Donor contacts", "ediInformation": "EDI information", "interface": "Interface", "accounts": "Accounts",