From 96c51cdc65261c7c00a00a324b3ca5f97a088c75 Mon Sep 17 00:00:00 2001 From: learner97 Date: Fri, 14 Jun 2024 15:27:23 -0600 Subject: [PATCH 1/2] fixed bug with displaying of role and type --- frontend/components/Viewing/MetadataInfo.js | 8 +++++--- frontend/public/commitHash.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/components/Viewing/MetadataInfo.js b/frontend/components/Viewing/MetadataInfo.js index ae6a3216..057e2d1a 100644 --- a/frontend/components/Viewing/MetadataInfo.js +++ b/frontend/components/Viewing/MetadataInfo.js @@ -25,14 +25,16 @@ export default function MetadataInfo({ title, link, label, icon, specific, uri } if (Array.isArray(title) && label === 'Type' || label === 'Role') { const concatenatedTitle = title.map(item => { // Accessing the extra_work property for each object in the title array - if (item.props && item.props.sections && item.props.sections.extra_work && - item.props.sections.extra_work.length > 0) { - return item.props.sections.extra_work[0].result.extra_work; + if (item.props && item.props.children && item.props.children.props.children.props.sections && + item.props.children.props.children.props.sections.extra_work && + item.props.children.props.children.props.sections.extra_work.length > 0) { + return item.props.children.props.children.props.sections.extra_work[0].result.extra_work; } return ''; // Return an empty string if the path doesn't exist }).filter(item => item !== '').join(", "); // Filter out empty strings and join [title, link] = formatMultipleTitles(concatenatedTitle); } + // console.log(title); if (Array.isArray(title) && label === 'Sequence') { const concatenatedTitle = title.map(item => { // Accessing the extra_work property for each object in the title array diff --git a/frontend/public/commitHash.txt b/frontend/public/commitHash.txt index 82a2091d..e5df4d5a 100644 --- a/frontend/public/commitHash.txt +++ b/frontend/public/commitHash.txt @@ -1 +1 @@ -6238315c3165b4b56b39662e692e283f325ee006 \ No newline at end of file +4b214d663d2a8faf784303aee3e886818e3c73e8 \ No newline at end of file From 581918b07d682f4549abf461ce119141cf9b6216 Mon Sep 17 00:00:00 2001 From: learner97 Date: Fri, 14 Jun 2024 15:28:34 -0600 Subject: [PATCH 2/2] removed comment --- frontend/components/Viewing/MetadataInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/Viewing/MetadataInfo.js b/frontend/components/Viewing/MetadataInfo.js index 057e2d1a..3ad084dd 100644 --- a/frontend/components/Viewing/MetadataInfo.js +++ b/frontend/components/Viewing/MetadataInfo.js @@ -34,7 +34,7 @@ export default function MetadataInfo({ title, link, label, icon, specific, uri } }).filter(item => item !== '').join(", "); // Filter out empty strings and join [title, link] = formatMultipleTitles(concatenatedTitle); } - // console.log(title); + if (Array.isArray(title) && label === 'Sequence') { const concatenatedTitle = title.map(item => { // Accessing the extra_work property for each object in the title array