Skip to content

Commit

Permalink
Merge branch 'main' into collectionPublish
Browse files Browse the repository at this point in the history
  • Loading branch information
BirdMachine committed Oct 18, 2024
2 parents 53575a5 + 1031ec0 commit 972d3f1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 35 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.12
2.6.13
38 changes: 17 additions & 21 deletions src/src/components/collections/collections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,18 +401,7 @@ export function CollectionForm (props){
// Only include if presnent, ignore if not
console.debug('%c⊙', 'color:#00ff7b', "contributors",contributors );
if (contributors && (contributors[0] && contributors[0].orcid!==undefined)) {
// formValuesSubmit.contributors = contributors
formValuesSubmit.contributors = contributors
setFormErrors((prevValues) => ({
...prevValues,
'contributors': "",
}))
} else{
setFormErrors((prevValues) => ({
...prevValues,
'contributors': "Contributors detected but colums are unsupported / improperly formatted. Please refer to the examples linked below and try again.",
}))
isValid = false;
}
// Do not send blank contacts
if (contacts && (contacts[0])) {
Expand Down Expand Up @@ -575,13 +564,12 @@ export function CollectionForm (props){
var contributors = []
var contacts = []
for (const row of data.data) {
contributors.push(row)
if(!row.is_contact){
row.is_contact = "NO"
}else if (row.is_contact && (row.is_contact === "TRUE"|| row.is_contact.toLowerCase()==="yes") ){
contacts.push(row)
}
contributors.push(row)

}
setFormValues ({
...formValues,
Expand All @@ -603,10 +591,14 @@ export function CollectionForm (props){
key={("rowName_" + index)}
className="row-selection"
>
<TableCell className="clicky-cell" scope="row">{row.display_name}</TableCell>
<TableCell className="clicky-cell" scope="row">{row.affiliation}</TableCell>
<TableCell className="clicky-cell" scope="row"> {row.orcid} </TableCell>
<TableCell className="clicky-cell" scope="row"> { (row.is_contact && (row.is_contact==="TRUE" || row.is_contact.toLowerCase()==="yes")) ? <FontAwesomeIcon icon={faCheck} /> : ""} </TableCell>
<TableCell className="clicky-cell" scope="row">{row.display_name}</TableCell>
<TableCell className="clicky-cell" scope="row">{row.affiliation}</TableCell>
<TableCell className="clicky-cell" scope="row">{row.orcid} </TableCell>
<TableCell className="clicky-cell" scope="row">{row.email }</TableCell>
<TableCell className="clicky-cell" scope="row"> { (row.is_contact && (row.is_contact==="TRUE" || row.is_contact.toLowerCase()==="yes")) ? <FontAwesomeIcon icon={faCheck} /> : ""} </TableCell>
<TableCell className="clicky-cell" scope="row">{row.is_principal_investigator }</TableCell>
<TableCell className="clicky-cell" scope="row">{row.is_operator }</TableCell>
<TableCell className="clicky-cell" scope="row">{row.metadata_schema_id}</TableCell>
</TableRow>
);
});
Expand All @@ -621,10 +613,14 @@ export function CollectionForm (props){
<Table stickyHeader aria-label="Associated Collaborators" size="small" className="table table-striped table-hover mb-0">
<TableHead className="thead-dark font-size-sm">
<TableRow className=" " >
<TableCell> Name</TableCell>
<TableCell component="th">Affiliation</TableCell>
<TableCell component="th">Orcid</TableCell>
<TableCell component="th">Is Contact</TableCell>
<TableCell> Name</TableCell>
<TableCell component="th">Affiliation</TableCell>
<TableCell component="th">Orcid</TableCell>
<TableCell component="th">Email</TableCell>
<TableCell component="th">Is Contact</TableCell>
<TableCell component="th">Is Principal Investigator</TableCell>
<TableCell component="th">Is Operator</TableCell>
<TableCell component="th">Metadata Schema ID</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand Down
23 changes: 10 additions & 13 deletions src/src/components/collections/epicollections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,18 +404,7 @@ export function EPICollectionForm (props){
// Only include if presnent, ignore if not
console.debug('%c⊙', 'color:#00ff7b', "contributors",contributors );
if (contributors && (contributors[0] && contributors[0].orcid!==undefined)) {
// formValuesSubmit.contributors = contributors
formValuesSubmit.contributors = contributors
setFormErrors((prevValues) => ({
...prevValues,
'contributors': "",
}))
} else{
setFormErrors((prevValues) => ({
...prevValues,
'contributors': "Contributors detected but colums are unsupported / improperly formatted. Please refer to the examples linked below and try again.",
}))
isValid = false;
}
// Do not send blank contacts
if (contacts && (contacts[0])) {
Expand Down Expand Up @@ -590,7 +579,7 @@ export function EPICollectionForm (props){
}else if(row.is_contact && (row.is_contact === "TRUE"|| row.is_contact.toLowerCase()==="yes") ){
contacts.push(row)
}
contributors.push(row)
// contributors.push(row)
}
setFormValues ({
...formValues,
Expand All @@ -614,8 +603,12 @@ export function EPICollectionForm (props){
>
<TableCell className="clicky-cell" scope="row">{row.display_name}</TableCell>
<TableCell className="clicky-cell" scope="row">{row.affiliation}</TableCell>
<TableCell className="clicky-cell" scope="row"> {row.orcid} </TableCell>
<TableCell className="clicky-cell" scope="row">{row.orcid} </TableCell>
<TableCell className="clicky-cell" scope="row">{row.email }</TableCell>
<TableCell className="clicky-cell" scope="row"> { (row.is_contact && (row.is_contact==="TRUE" || row.is_contact.toLowerCase()==="yes")) ? <FontAwesomeIcon icon={faCheck} /> : ""} </TableCell>
<TableCell className="clicky-cell" scope="row">{row.is_principal_investigator }</TableCell>
<TableCell className="clicky-cell" scope="row">{row.is_operator }</TableCell>
<TableCell className="clicky-cell" scope="row">{row.metadata_schema_id}</TableCell>
</TableRow>
);
});
Expand All @@ -634,7 +627,11 @@ export function EPICollectionForm (props){
<TableCell> Name</TableCell>
<TableCell component="th">Affiliation</TableCell>
<TableCell component="th">Orcid</TableCell>
<TableCell component="th">Email</TableCell>
<TableCell component="th">Is Contact</TableCell>
<TableCell component="th">Is Principal Investigator</TableCell>
<TableCell component="th">Is Operator</TableCell>
<TableCell component="th">Metadata Schema ID</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand Down

0 comments on commit 972d3f1

Please sign in to comment.