From e8e5371c5ee07e77d98262c7df4844b9bf6bd1d9 Mon Sep 17 00:00:00 2001 From: Birdmachine Date: Mon, 21 Oct 2024 15:39:01 -0400 Subject: [PATCH 1/2] Enable Creation of Collections/EPICollections for Admin users --- src/src/components/collections/collections.jsx | 2 +- src/src/components/collections/epicollections.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/src/components/collections/collections.jsx b/src/src/components/collections/collections.jsx index fb829b3b..5bb14623 100644 --- a/src/src/components/collections/collections.jsx +++ b/src/src/components/collections/collections.jsx @@ -979,7 +979,7 @@ export function CollectionForm (props){
- {userAdmin === true && !editingCollection.doi_url && ( + {userAdmin === true && (editingCollection && !editingCollection.doi_url) && ( handlePublish()} diff --git a/src/src/components/collections/epicollections.jsx b/src/src/components/collections/epicollections.jsx index 3f787ee5..6c727273 100644 --- a/src/src/components/collections/epicollections.jsx +++ b/src/src/components/collections/epicollections.jsx @@ -1000,7 +1000,7 @@ export function EPICollectionForm (props){
- {userAdmin === true && !editingCollection.doi_url && ( + {userAdmin === true && (editingCollection && !editingCollection.doi_url) && ( handlePublish()} From b5a32fcd1fb4b86f4dc34c05b4af11ffe6bc74e8 Mon Sep 17 00:00:00 2001 From: Birdmachine Date: Mon, 21 Oct 2024 20:29:08 -0400 Subject: [PATCH 2/2] Move doi out of form into header area (similar to Portal style) --- src/src/App.css | 12 +++++++++++ src/src/assets/App.css | 11 ++++++++++ .../components/collections/collections.jsx | 21 +++++++------------ .../components/collections/epicollections.jsx | 19 ++++++----------- 4 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/src/App.css b/src/src/App.css index c74bdf08..5b1165db 100644 --- a/src/src/App.css +++ b/src/src/App.css @@ -909,4 +909,16 @@ svg.invalid { padding: 5px; border-radius: 5px; font-size: inherit!important; +} + +.title_badge{ + align-items: center; + color: rgb(42, 111, 184); + display: inline-flex; + flex-direction: row; + flex-wrap: wrap; + font-size: 0.95rem; + font-weight: 300; + gap: 4px; + line-height: 1.5; } \ No newline at end of file diff --git a/src/src/assets/App.css b/src/src/assets/App.css index 69f594a7..b0933339 100644 --- a/src/src/assets/App.css +++ b/src/src/assets/App.css @@ -844,4 +844,15 @@ svg.invalid{ padding: 5px; border-radius: 5px; font-size: inherit!important; +} +.title_badge{ + align-items: center; + color: rgb(42, 111, 184); + display: inline-flex; + flex-direction: row; + flex-wrap: wrap; + font-size: 0.95rem; + font-weight: 300; + gap: 4px; + line-height: 1.5; } \ No newline at end of file diff --git a/src/src/components/collections/collections.jsx b/src/src/components/collections/collections.jsx index 5bb14623..ca53e197 100644 --- a/src/src/components/collections/collections.jsx +++ b/src/src/components/collections/collections.jsx @@ -29,7 +29,7 @@ import Alert from '@mui/material/Alert'; import Collapse from '@mui/material/Collapse'; import LinearProgress from '@material-ui/core/LinearProgress'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faQuestionCircle, faSpinner, faTrash, faCheck,faExclamationTriangle, faPlus,faPenToSquare } from "@fortawesome/free-solid-svg-icons"; +import { faQuestionCircle, faUpRightFromSquare, faSpinner, faTrash, faCheck,faExclamationTriangle, faPlus,faPenToSquare } from "@fortawesome/free-solid-svg-icons"; import Typography from '@mui/material/Typography'; import IconButton from '@mui/material/IconButton'; import CancelPresentationIcon from '@mui/icons-material/CancelPresentation'; @@ -631,7 +631,6 @@ export function CollectionForm (props){ ) } - var renderAssociationTable = () => { var hiddenFields = []; var uniqueTypes = new Set(associatedEntities.map(obj => obj.entity_type.toLowerCase())); @@ -724,6 +723,11 @@ export function CollectionForm (props){ {!props.newForm && (
{props.editingCollection.title}
)} + {editingCollection && editingCollection.doi_url && ( +

+ doi: {editingCollection.doi_url} +

+ )}
@@ -919,18 +923,7 @@ export function CollectionForm (props){ value={formValues.title} /> - {editingCollection && editingCollection.doi_url && ( - - - - )} + {props.editingCollection.title} )} + {editingCollection && editingCollection.doi_url && ( +

+ doi: {editingCollection.doi_url} +

+ )}
@@ -938,18 +943,6 @@ export function EPICollectionForm (props){ value={formValues.title} /> - {editingCollection && editingCollection.doi_url && ( - - - - )}