From 24a5b82c2d8440df95214d8eed14446720c3e6fa Mon Sep 17 00:00:00 2001 From: charlottesce <75381352+charlottesce@users.noreply.github.com> Date: Wed, 16 Aug 2023 09:34:11 -0400 Subject: [PATCH] [candidate_parameters] Participant status - mandatory comments if not active or complete (#8731) For Participant Status, make comments mandatory when setting the status to anything other than "Active" or "Complete". --- .../candidate_parameters/jsx/ParticipantStatus.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/candidate_parameters/jsx/ParticipantStatus.js b/modules/candidate_parameters/jsx/ParticipantStatus.js index 84cd5d30b6f..97fa3db749a 100644 --- a/modules/candidate_parameters/jsx/ParticipantStatus.js +++ b/modules/candidate_parameters/jsx/ParticipantStatus.js @@ -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)) { @@ -246,7 +256,7 @@ class ParticipantStatus extends Component { onUserInput={this.setFormData} ref="reasonSpecify" disabled={disabled} - required={false} + required={commentsRequired} /> {updateButton} {formattedHistory}