-
Notifications
You must be signed in to change notification settings - Fork 4
DT-108: Submit Progress Report Application #2879
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
base: develop
Are you sure you want to change the base?
Conversation
cleanup styling for closeout
TODO: pull this into a helper method so we're using the keys in all places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments for reviewers
export interface Collaborator { | ||
uuid: string; | ||
name: string; | ||
eraCommonsId: string; | ||
email: string; | ||
title: string; | ||
institution: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this type in favor of the "Collaborator" type in the main type file. This meant removing the "institution" field, which is not currently tracked in consent and we are moving away from tracking anyway. A corresponding change is made in the CollaboratorAddEdit component to no longer capture "institution".
<div style={{ marginTop: '20px' }}> | ||
<h4>Reasons for Project Closeout</h4> | ||
<FormField | ||
id={FormStateKey.CLOSEOUT_SUPPLEMENT} | ||
type={FormFieldTypes.RADIOGROUP} | ||
orientation="vertical" | ||
options={[ | ||
{ text: 'The Requestor has completed his/her project', name: CloseOutSupplement.PROJECT_COMPLETED }, | ||
{ text: 'The Requestor has moved institutions (If the project will be continued in a new institution or by a new PI, they must go through Project Transfer)', name: CloseOutSupplement.REQUESTOR_MOVED_INSTITUTION }, | ||
{ text: 'The project is being transferred to a new Requestor at the same institution', name: CloseOutSupplement.PROJECT_TRANSFERRED }, | ||
{ text: 'The project is being superseded by a new project', name: CloseOutSupplement.PROJECT_SUPERSEDED } | ||
]} | ||
disabled={readOnly} | ||
defaultValue={formState.closeoutSupplement} | ||
onChange={({ key, value }: Partial<FormState>) => { | ||
onFormChange({ [key]: value } as Partial<FormState>); | ||
}} | ||
/> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The back end currently expects a single value for the closeout field. So, this changes from a multi-select to a single select. We will revisit this when taking a closer look at the closeout process.
@@ -1,4 +1,4 @@ | |||
export interface Publication { | |||
export interface PublicationOrPresentation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed this to make it clearer when we are using the main "publication" type vs. the type that is now shared with presentation.
title: number; | ||
uuid: number; | ||
title: string | ||
uuid: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed these types to match types in consent
<FormField | ||
id={FormStateKey.CLOSEOUT_YES_NO} | ||
type={FormFieldTypes.YESNORADIOGROUP} | ||
title='5.1 Closeouts' | ||
description={<span>Are you ready to finish work on this project?</span>} | ||
orientation='horizontal' | ||
onChange={({ key, value }: Partial<FormState>) => { | ||
onFormChange({ [key]: value } as Partial<FormState>); | ||
}} | ||
disabled={readOnly} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a yes/no radio button to the closeout section. Otherwise, we don't really have a way to clear out the radio button selection.
|
@@ -39,7 +44,7 @@ export const ProgressReportApplication = ({ dar, datasets, readOnlyMode = true } | |||
...(dar?.closeOutSupplement && { | |||
closeoutYesNo: !!dar.closeOutSupplement | |||
}), | |||
} | |||
}; | |||
|
|||
const [formState, setFormState] = useState<FormState>(initialState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter in my IDE is complaining about this because the initial state is actually the union of FormState and DataAccessRequest types.
Addresses
Summary
Have you read Terra's Contributing Guide lately? If not, do that first.