Skip to content

Commit

Permalink
Apply validation even if you don't use the row
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter York committed Sep 25, 2024
1 parent 0c12293 commit cbb18cc
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/routes/route_check/results_export/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,22 @@ function policyConflictLog(state: State, workbook: ExcelJS.Workbook) {

for (let [i, pc] of state.policyConflictLog.entries()) {
sheet.getCell("F" + (8 + i)).value = getFullPolicyConflict(pc.conflict);
sheet.getCell("F" + (8 + i)).dataValidation = {
type: 'list',
allowBlank: true,
formulae: ["'8.2 Lookups&Forumlae2'!$B$7:$B$12"]
};

sheet.getCell("H" + (8 + i)).value = pc.stage;
sheet.getCell("I" + (8 + i)).value = point(pc.point);
sheet.getCell("J" + (8 + i)).value = pc.locationName;
// if the issue is noted on Design stage then it is not resolved by design
sheet.getCell("K" + (8 + i)).value =
pc.stage === "Design" ? "No" : pc.resolved;
sheet.getCell("L" + (8 + i)).value = pc.notes;

}

for(let i = 0; i <42; i++) {
sheet.getCell("F" + (8 + i)).dataValidation = {
type: 'list',
allowBlank: true,
formulae: ["'8.2 Lookups&Forumlae2'!$B$7:$B$12"]
};
}
}

Expand All @@ -170,12 +173,6 @@ function criticalIssueLog(state: State, workbook: ExcelJS.Workbook) {

for (let [i, ci] of state.criticalIssues.entries()) {
sheet.getCell("F" + (8 + i)).value = getFullCriticalIssue(ci.criticalIssue);
sheet.getCell("F" + (8 + i)).dataValidation = {
type: 'list',
allowBlank: true,
formulae: ["'8.2 Lookups&Forumlae2'!$B$16:$B$39"]
};

sheet.getCell("H" + (8 + i)).value = ci.stage;
sheet.getCell("I" + (8 + i)).value = point(ci.point);
sheet.getCell("J" + (8 + i)).value = ci.locationName;
Expand All @@ -184,6 +181,14 @@ function criticalIssueLog(state: State, workbook: ExcelJS.Workbook) {
ci.stage === "Design" ? "No" : ci.resolved;
sheet.getCell("L" + (8 + i)).value = ci.notes;
}

for(let i = 0; i <42; i++) {
sheet.getCell("F" + (8 + i)).dataValidation = {
type: 'list',
allowBlank: true,
formulae: ["'8.2 Lookups&Forumlae2'!$B$16:$B$39"]
};
}
}

function populateScorecard(
Expand Down

0 comments on commit cbb18cc

Please sign in to comment.