diff --git a/src/modules/records/components/RecordDescription/index.js b/src/modules/records/components/RecordDescription/index.js deleted file mode 100644 index 3db4ef92..00000000 --- a/src/modules/records/components/RecordDescription/index.js +++ /dev/null @@ -1,20 +0,0 @@ -import { getField, getFieldValue } from '../../utilities'; -import PropTypes from 'prop-types'; -import React from 'react'; - -const RecordDescription = ({ record }) => { - const descField = getField(record.fields, 'abstract') || getField(record.fields, 'description'); - const [description] = getFieldValue(descField); - - if (!description) { - return null; - } - - return
; -}; - -RecordDescription.propTypes = { - record: PropTypes.object -}; - -export default RecordDescription; diff --git a/src/modules/records/components/RecordFull/index.js b/src/modules/records/components/RecordFull/index.js index 15a5c725..81f8dc0c 100644 --- a/src/modules/records/components/RecordFull/index.js +++ b/src/modules/records/components/RecordFull/index.js @@ -10,7 +10,6 @@ import { FullRecordPlaceholder, Metadata, RecommendedResource, - RecordDescription, RecordFullFormats, ViewMARC, Zotero @@ -31,25 +30,25 @@ let prejudiceInstance = prejudice.createVariableStorageDriverInstance(); const FullRecord = () => { const [activeAction, setActiveAction] = useState(''); - const params = useParams(); + const { recordUid } = useParams(); const navigate = useNavigate(); - const record = useSelector((state) => { - return state.records.record; + const { record } = useSelector((state) => { + return state.records; }); - const datastores = useSelector((state) => { + const { active: datastoreUid, datastores } = useSelector((state) => { return state.datastores; }); - const list = useSelector((state) => { - return state.lists[datastores.active]; + const { [datastoreUid]: list } = useSelector((state) => { + return state.lists; }); - const { recordUid } = params; - const datastoreUid = datastores.active; - const datastore = findWhere(datastores.datastores, { + const datastore = findWhere(datastores, { uid: datastoreUid }); + const { name: datastoreName, slug: datastoreSlug } = datastore; + useEffect(() => { requestRecord({ datastoreUid, recordUid }); prejudiceInstance = prejudice.createVariableStorageDriverInstance(); @@ -67,23 +66,23 @@ const FullRecord = () => { // Treat as an aleph id navigate(`/onlinejournals/record/${record.uid}`); } else if (record.alt_ids.includes(recordUid)) { - navigate(`/${datastore.slug}/record/${record.uid}`); + navigate(`/${datastoreSlug}/record/${record.uid}`); } else { requestRecord({ datastoreUid, recordUid }); } } - const activeDatastore = findWhere(datastores.datastores, { - uid: datastores.active + const { name: activeDatastore } = findWhere(datastores, { + uid: datastoreUid }); setDocumentTitle([ [].concat(record.names).join().slice(0, 120), 'Record', - activeDatastore.name + activeDatastore ]); } - }, [record, recordUid, datastores, navigate, datastore.slug, datastoreUid]); + }, [record, recordUid, datastores, navigate, datastoreSlug]); if (!record) { return ( @@ -91,8 +90,8 @@ const FullRecord = () => {The University of Michigan Library aims to describe its collections in a way that respects the people and communities who create, use, and are represented in them. We encourage you to @@ -178,10 +179,10 @@ const FullRecord = () => { Available at:
- {indexingDate.name}: {indexingDate.value} + {indexingName || 'Date Last Indexed'}: {indexingValue}
); })()} - {datastoreUid === 'mirlyn' &&