From d4456a1babf2e485de06196a51d6d1fdf331916a Mon Sep 17 00:00:00 2001 From: Harris Tzovanakis Date: Mon, 16 Dec 2024 14:32:18 +0100 Subject: [PATCH] ui: addition of collaborations in Data collection * ref: cern-sis/issues-inspire/issues/640 --- .../components/__tests__/LiteratureRecordsList.test.jsx | 2 +- ui/src/data/components/DataItem.jsx | 2 ++ .../components/__tests__/__snapshots__/DataItem.test.jsx.snap | 4 ++-- .../containers/DetailPageContainer/DetailPageContainer.tsx | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/src/common/components/__tests__/LiteratureRecordsList.test.jsx b/ui/src/common/components/__tests__/LiteratureRecordsList.test.jsx index 2f0ccdedad..9c5ae988e5 100644 --- a/ui/src/common/components/__tests__/LiteratureRecordsList.test.jsx +++ b/ui/src/common/components/__tests__/LiteratureRecordsList.test.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { fromJS } from 'immutable'; -import LiteratureRecordsList from '../../../common/components/LiteratureRecordsList'; +import LiteratureRecordsList from '../LiteratureRecordsList'; describe('LiteratureRecordsList', () => { it('renders with multiple records', () => { diff --git a/ui/src/data/components/DataItem.jsx b/ui/src/data/components/DataItem.jsx index f9acbea90e..e6f46af2c3 100644 --- a/ui/src/data/components/DataItem.jsx +++ b/ui/src/data/components/DataItem.jsx @@ -23,6 +23,7 @@ function DataItem({ metadata, page }) { const recordId = metadata.get('control_number'); const urls = metadata.get('urls'); const canEdit = metadata.get('can_edit', false); + const collaborations = metadata.get('collaborations', []); return (
@@ -74,6 +75,7 @@ function DataItem({ metadata, page }) {
diff --git a/ui/src/data/components/__tests__/__snapshots__/DataItem.test.jsx.snap b/ui/src/data/components/__tests__/__snapshots__/DataItem.test.jsx.snap index 9e1b0d2367..b1ae10a970 100644 --- a/ui/src/data/components/__tests__/__snapshots__/DataItem.test.jsx.snap +++ b/ui/src/data/components/__tests__/__snapshots__/DataItem.test.jsx.snap @@ -90,7 +90,7 @@ exports[`DataItem renders with all props set 1`] = ` }, ] } - collaborations={Immutable.List []} + collaborations={Array []} collaborationsWithSuffix={Immutable.List []} enableAuthorsShowAll={false} /> @@ -154,7 +154,7 @@ exports[`DataItem renders with only needed props 1`] = ` diff --git a/ui/src/data/containers/DetailPageContainer/DetailPageContainer.tsx b/ui/src/data/containers/DetailPageContainer/DetailPageContainer.tsx index 9e4dfec118..5ba1dd91cf 100644 --- a/ui/src/data/containers/DetailPageContainer/DetailPageContainer.tsx +++ b/ui/src/data/containers/DetailPageContainer/DetailPageContainer.tsx @@ -42,6 +42,7 @@ const DetailPage = ({ const dois = filterDoisByMaterial(metadata.get('dois', [])); const recordId = metadata.get('control_number'); const literatureRecords = metadata.get('literature'); + const collaborations = metadata.get('collaborations'); const urls = metadata.get('urls'); @@ -82,6 +83,7 @@ const DetailPage = ({