diff --git a/lib/Donors/DonorsList.js b/lib/Donors/DonorsList.js index 49a3e44a..af46a299 100644 --- a/lib/Donors/DonorsList.js +++ b/lib/Donors/DonorsList.js @@ -1,6 +1,8 @@ +import { isEmpty } from 'lodash'; import PropTypes from 'prop-types'; import { MultiColumnList } from '@folio/stripes/components'; +import { useStripes } from '@folio/stripes/core'; import { alignRowProps, @@ -8,6 +10,8 @@ import { defaultVisibleColumns, } from './constants'; +import { getDonorsListFormatter } from './utils'; + export const DonorsList = ({ columnMapping, columnWidths, @@ -16,12 +20,16 @@ export const DonorsList = ({ id, visibleColumns, }) => { + const stripes = useStripes(); + const canViewOrganizations = stripes.hasPerm('ui-organizations.view'); + const defaultFormatter = isEmpty(formatter) || getDonorsListFormatter({ canViewOrganizations }); + return (