Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 2724a90

Browse files
author
shane
committed
LEAF-4888 - redo the pr for this to see if we can get around what is going on with the CodeQL
1 parent 30158dc commit 2724a90

14 files changed

Lines changed: 64 additions & 18 deletions

File tree

LEAF_Request_Portal/js/form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ var LeafForm = function (containerID) {
612612
if (arrChildConditions.some(c => c.selectedOutcome.toLowerCase() === "show")) outcomes.push("show");
613613
if (arrChildConditions.some(c => c.selectedOutcome.toLowerCase() === "pre-fill")) outcomes.push("pre-fill");
614614
if (outcomes.length > 1) {
615-
console.log("check conditions setup for", childID);
615+
console.warn("Conflicting display conditions: check setup for", childID);
616616
}
617617

618618
//update child states and/or values.

LEAF_Request_Portal/templates/print_form.tpl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,20 @@ function doSubmit(recordID) {
523523
let comparison = false;
524524
525525
for (let i in conditions) {
526+
/* Validate outcome:
527+
confirm child, i, has hide/show conditions that need to be processed.
528+
Log a message to assist with debugging if it is configured with both directives. */
529+
let outcomes = [];
530+
if (conditions.some(c => c.selectedOutcome.toLowerCase() === "hide")) outcomes.push("hide");
531+
if (conditions.some(c => c.selectedOutcome.toLowerCase() === "show")) outcomes.push("show");
532+
if (outcomes.length > 1) {
533+
console.warn("Conflicting display conditions: check setup for", c);
534+
}
535+
if (outcomes.length < 1) {
536+
continue;
537+
}
538+
const outcome = outcomes[0];
539+
526540
const parentFormat = conditions[i].parentFormat.toLowerCase();
527541
const elParentInd = document.getElementById('data_' + conditions[i].parentIndID +
528542
'_1'); //dropdown, text and radio elements
@@ -532,9 +546,8 @@ function doSubmit(recordID) {
532546
selectedParentOptionsLI.forEach(li => arrParVals.push(li.textContent.trim()));
533547
534548
const elChildInd = document.getElementById('subIndicator_' + conditions[i].childIndID + '_1');
535-
const outcome = conditions[i].selectedOutcome.toLowerCase();
536549
537-
if (['hide', 'show'].includes(outcome) && childFormatIsEnabled && (elParentInd !== null ||
550+
if (childFormatIsEnabled && (elParentInd !== null ||
538551
selectedParentOptionsLI !== null)) {
539552
540553
if (comparison !== true) { //no need to re-assess if it has already become true

app/libs/js/vue-dest/form_editor/LEAF_FormEditor.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/libs/js/vue-dest/form_editor/LEAF_FormEditor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*! #__NO_SIDE_EFFECTS__ */
22

33
/**
4-
* @vue/runtime-core v3.5.13
4+
* @vue/runtime-core v3.5.17
55
* (c) 2018-present Yuxi (Evan) You and Vue contributors
66
* @license MIT
77
**/
88

99
/**
10-
* @vue/runtime-dom v3.5.13
10+
* @vue/runtime-dom v3.5.17
1111
* (c) 2018-present Yuxi (Evan) You and Vue contributors
1212
* @license MIT
1313
**/
1414

1515
/**
16-
* @vue/shared v3.5.13
16+
* @vue/shared v3.5.17
1717
* (c) 2018-present Yuxi (Evan) You and Vue contributors
1818
* @license MIT
1919
**/

app/libs/js/vue-dest/form_editor/form-browser-view.chunk.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/libs/js/vue-dest/form_editor/restore-fields-view.chunk.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/libs/js/vue-dest/site_designer/LEAF_Designer.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)