Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Creation of Collections/EPICollections for Admin users #1496

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
11 changes: 11 additions & 0 deletions src/src/assets/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
23 changes: 8 additions & 15 deletions src/src/components/collections/collections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -631,7 +631,6 @@ export function CollectionForm (props){
</>
)
}

var renderAssociationTable = () => {
var hiddenFields = [];
var uniqueTypes = new Set(associatedEntities.map(obj => obj.entity_type.toLowerCase()));
Expand Down Expand Up @@ -724,6 +723,11 @@ export function CollectionForm (props){
{!props.newForm && (
<h5>{props.editingCollection.title}</h5>
)}
{editingCollection && editingCollection.doi_url && (
<h4 className="title_badge">
doi: <a href={editingCollection.doi_url} target='_blank' >{editingCollection.doi_url} </a><FontAwesomeIcon icon={faUpRightFromSquare}/>
</h4>
)}
</div>
</div>

Expand Down Expand Up @@ -919,18 +923,7 @@ export function CollectionForm (props){
value={formValues.title}
/>
</FormControl>
{editingCollection && editingCollection.doi_url && (
<FormControl>
<TextField
label="DOI url"
name="DOIurl"
id="DOIurl"
disabled={true}
variant="standard"
value={editingCollection.doi_url}
/>
</FormControl>
)}

<FormControl>
<TextField
label="Description"
Expand Down Expand Up @@ -979,7 +972,7 @@ export function CollectionForm (props){

<div className="row">
<div className="buttonWrapRight">
{userAdmin === true && !editingCollection.doi_url && (
{userAdmin === true && (editingCollection && !editingCollection.doi_url) && (
<LoadingButton
loading={publishing}
onClick={() => handlePublish()}
Expand Down
21 changes: 7 additions & 14 deletions src/src/components/collections/epicollections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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, faExclamationTriangle, faCheck, faPlus,faPenToSquare } from "@fortawesome/free-solid-svg-icons";
import { faQuestionCircle, faSpinner, faUpRightFromSquare, faTrash, faExclamationTriangle, faCheck, 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';
Expand Down Expand Up @@ -743,6 +743,11 @@ export function EPICollectionForm (props){
{!props.newForm && (
<h5>{props.editingCollection.title}</h5>
)}
{editingCollection && editingCollection.doi_url && (
<h4 className="title_badge">
doi: <a href={editingCollection.doi_url} target='_blank' >{editingCollection.doi_url} </a><FontAwesomeIcon icon={faUpRightFromSquare}/>
</h4>
)}
</div>
</div>

Expand Down Expand Up @@ -938,18 +943,6 @@ export function EPICollectionForm (props){
value={formValues.title}
/>
</FormControl>
{editingCollection && editingCollection.doi_url && (
<FormControl>
<TextField
label="DOI url"
name="DOIurl"
id="DOIurl"
disabled={true}
variant="standard"
value={editingCollection.doi_url}
/>
</FormControl>
)}
<FormControl>
<TextField
label="Description"
Expand Down Expand Up @@ -1000,7 +993,7 @@ export function EPICollectionForm (props){

<div className="row">
<div className="buttonWrapRight">
{userAdmin === true && !editingCollection.doi_url && (
{userAdmin === true && (editingCollection && !editingCollection.doi_url) && (
<LoadingButton
loading={publishing}
onClick={() => handlePublish()}
Expand Down
Loading