Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eliminate Requirement for contributors data, check against is_contact…
Browse files Browse the repository at this point in the history
… using both YES and TRUE
BirdMachine committed Oct 4, 2024
1 parent 50def43 commit 58ecae4
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/src/components/collections/collections.jsx
Original file line number Diff line number Diff line change
@@ -373,7 +373,12 @@ export function CollectionForm (props){
//Logic Flipped here to handle check for presence of object details not lack of
// Only include if presnent, ignore if not
console.debug('%c⊙', 'color:#00ff7b', "contributors",contributors );
if (contributors && (contributors[0] && contributors[0].orcid!==undefined)) {
if (!contributors || contributors.length === 0) {
setFormErrors((prevValues) => ({
...prevValues,
'contributors': "",
}))
}else if (contributors && (contributors[0] && contributors[0].orcid!==undefined)) {
// formValuesSubmit.contributors = contributors
formValuesSubmit.contributors = contributors
setFormErrors((prevValues) => ({
@@ -516,7 +521,7 @@ export function CollectionForm (props){
var contacts = []
for (const row of data.data) {
contributors.push(row)
if(row.is_contact === "TRUE"){
if(row.is_contact === "TRUE" || row.is_contact === "YES"){
contacts.push(row)
}
}
9 changes: 7 additions & 2 deletions src/src/components/collections/epicollections.jsx
Original file line number Diff line number Diff line change
@@ -374,7 +374,12 @@ export function EPICollectionForm (props){
//Logic Flipped here to handle check for presence of object details not lack of
// Only include if presnent, ignore if not
console.debug('%c⊙', 'color:#00ff7b', "contributors",contributors );
if (contributors && (contributors[0] && contributors[0].orcid!==undefined)) {
if (!contributors || contributors.length === 0) {
setFormErrors((prevValues) => ({
...prevValues,
'contributors': "",
}))
}else if (contributors && (contributors[0] && contributors[0].orcid!==undefined)) {
// formValuesSubmit.contributors = contributors
formValuesSubmit.contributors = contributors
setFormErrors((prevValues) => ({
@@ -523,7 +528,7 @@ export function EPICollectionForm (props){
var contacts = []
for (const row of data.data) {
contributors.push(row)
if(row.is_contact === "TRUE"){
if(row.is_contact === "TRUE" || row.is_contact === "YES"){
contacts.push(row)
console.debug('%c◉ contact ', 'color:#00ff7b', row);
}

0 comments on commit 58ecae4

Please sign in to comment.