Skip to content

Commit

Permalink
Merge pull request #598 from CBIIT/CRDCDH-2291
Browse files Browse the repository at this point in the history
CRDCDH-2291 Re-enable ORCID in the Submission Request form
  • Loading branch information
amattu2 authored Jan 22, 2025
2 parents 93cad2a + e8f9ef8 commit f2bcc96
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
5 changes: 0 additions & 5 deletions src/components/Contexts/FormContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,6 @@ export const FormProvider: FC<ProviderProps> = ({ children, id }: ProviderProps)
};
}

// TODO: Remove in 3.2.0
if (questionnaireData.pi) {
questionnaireData.pi.ORCID = "";
}

setState({
status: Status.LOADED,
data: {
Expand Down
22 changes: 18 additions & 4 deletions src/content/questionnaire/sections/A.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import SectionGroup from "../../../components/Questionnaire/SectionGroup";
import TextInput from "../../../components/Questionnaire/TextInput";
import AutocompleteInput from "../../../components/Questionnaire/AutocompleteInput";
import AddRemoveButton from "../../../components/AddRemoveButton";
import { filterForNumbers, mapObjectWithKey, validateEmail } from "../../../utils";
import {
filterForNumbers,
formatORCIDInput,
isValidORCID,
mapObjectWithKey,
validateEmail,
} from "../../../utils";
import TransitionGroupWrapper from "../../../components/Questionnaire/TransitionGroupWrapper";
import { InitialQuestionnaire } from "../../../config/InitialValues";
import SectionMetadata from "../../../config/SectionMetadata";
Expand Down Expand Up @@ -83,9 +89,6 @@ const FormSectionA: FC<FormSectionProps> = ({ SectionOption, refs }: FormSection
combinedData.primaryContact = null;
}

// TODO: Remove in 3.2.0
combinedData.pi.ORCID = "";

return { ref: formRef, data: combinedData };
};

Expand Down Expand Up @@ -174,6 +177,17 @@ const FormSectionA: FC<FormSectionProps> = ({ SectionOption, refs }: FormSection
required
readOnly={readOnlyInputs}
/>
<TextInput
id="section-a-pi-orcid"
label="ORCID"
name="pi[ORCID]"
value={pi?.ORCID}
placeholder="e.g. 0000-0001-2345-6789"
validate={(val) => val?.length === 0 || isValidORCID(val)}
filter={formatORCIDInput}
errorText="Please provide a valid ORCID"
readOnly={readOnlyInputs}
/>
<AutocompleteInput
id="section-a-pi-institution"
label="Institution"
Expand Down
8 changes: 1 addition & 7 deletions src/content/questionnaire/sections/Review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ const StyledDivider = styled(Divider)(() => ({
marginBottom: "8px",
}));

const BlankGrid = styled(Grid)(() => ({
"&.MuiGrid-item": {
paddingTop: 0,
},
}));

/**
* Form Section Review View
*
Expand Down Expand Up @@ -132,7 +126,7 @@ const FormSectionReview: FC<FormSectionProps> = ({ SectionOption, refs }: FormSe
label="Institution Name"
value={pi.institution}
/>
<BlankGrid md={6} xs={12} item />
<ReviewDataListingProperty idPrefix="review-pi-orcid" label="ORCID" value={pi.ORCID} />
<ReviewDataListingProperty
idPrefix="review-pi-institution-address"
label="Institution Address"
Expand Down

0 comments on commit f2bcc96

Please sign in to comment.