Skip to content

Commit

Permalink
[candidate_parameters] Participant status - mandatory comments if not…
Browse files Browse the repository at this point in the history
… active or complete (#8731)

For Participant Status, make comments mandatory when setting the status to anything other than "Active" or "Complete".
  • Loading branch information
charlottesce authored Aug 16, 2023
1 parent 6041759 commit 24a5b82
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion modules/candidate_parameters/jsx/ParticipantStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ class ParticipantStatus extends Component {
suboptionsRequired = true;
}

let commentsRequired = false;
let statusOpts = this.state.Data.statusOptions;
if (
statusOpts &&
statusOpts[participantStatus] !== 'Active' &&
statusOpts[participantStatus] !== 'Complete'
) {
commentsRequired = true;
}

let formattedHistory = [];
for (let statusKey in this.state.Data.history) {
if (this.state.Data.history.hasOwnProperty(statusKey)) {
Expand Down Expand Up @@ -246,7 +256,7 @@ class ParticipantStatus extends Component {
onUserInput={this.setFormData}
ref="reasonSpecify"
disabled={disabled}
required={false}
required={commentsRequired}
/>
{updateButton}
{formattedHistory}
Expand Down

0 comments on commit 24a5b82

Please # to comment.