Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[candidate_parameters] Add date restriction for consent withdrawal #8298

Merged
merged 1 commit into from
Dec 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions modules/candidate_parameters/jsx/ConsentStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,29 @@ class ConsentStatus extends Component {
let consentWithdrawal = consentStatus + '_withdrawal';
let consentWithdrawal2 = consentStatus + '_withdrawal2';

date1 = myFormData[consentWithdrawal] ?
const withdrawDate1 = myFormData[consentWithdrawal] ?
myFormData[consentWithdrawal] : null;
date2 = myFormData[consentWithdrawal2] ?
const withdrawDate2 = myFormData[consentWithdrawal2] ?
myFormData[consentWithdrawal2] : null;

if (date1 !== date2) {
if (withdrawDate1 !== withdrawDate2) {
alert(label + ' withdrawal dates do not match!');
return;
}
if (date1 > today) {
if (withdrawDate1 > today) {
alert(
label
+ ' withdrawal date cannot be later than today!'
);
return;
}
if (withdrawDate1 < date1) {
alert(
zaliqarosli marked this conversation as resolved.
Show resolved Hide resolved
label
+ ' withdrawal date cannot be earlier than response date!'
);
return;
}
}
}
// Set form data
Expand Down