Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
caleballdrin committed Oct 22, 2024
1 parent e16d369 commit 2075281
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions app/scripts/services/validateRegistrant.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ angular
conference,
) => {
const blocks = conference
? _.flatten(_.map(conference.registrationPages, 'blocks'))
? _.flatMap(conference.registrationPages, 'blocks')
: undefined;

let answers = registrant.answers;
Expand Down Expand Up @@ -82,24 +82,28 @@ angular
? parseFloat(rule.value)
: rule.value;
}
// Hide this block if the question that the rule is based on (parentBlock) is hidden.
let parentBlock = _.find(blocks, { id: rule.parentBlockId });
if (
conference &&
blockVisibleRuleCheck(
_.find(blocks, { id: rule.parentBlockId }),
!blockVisibleRuleCheck(
parentBlock,
registrant,
ruleType,
conference,
)
) {
if (rule.operator === '=' && answerValue === ruleValue) {
validRuleCount++;
} else if (rule.operator === '!=' && answerValue !== ruleValue) {
validRuleCount++;
} else if (rule.operator === '>' && answerValue > ruleValue) {
validRuleCount++;
} else if (rule.operator === '<' && answerValue < ruleValue) {
validRuleCount++;
}
return false;

Check warning on line 96 in app/scripts/services/validateRegistrant.js

View check run for this annotation

Codecov / codecov/patch

app/scripts/services/validateRegistrant.js#L96

Added line #L96 was not covered by tests
}

if (rule.operator === '=' && answerValue === ruleValue) {
validRuleCount++;
} else if (rule.operator === '!=' && answerValue !== ruleValue) {
validRuleCount++;
} else if (rule.operator === '>' && answerValue > ruleValue) {
validRuleCount++;
} else if (rule.operator === '<' && answerValue < ruleValue) {
validRuleCount++;
}
}
if (
Expand Down

0 comments on commit 2075281

Please sign in to comment.