accessibility-checker 3.1.49 → 3.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.md +75 -67
  2. package/bin/achecker.js +14 -17
  3. package/bin/achecker.js.map +1 -1
  4. package/index.d.ts +6 -4
  5. package/index.js +9 -8
  6. package/index.js.map +1 -1
  7. package/lib/ACBrowserManager.d.ts +2 -2
  8. package/lib/ACBrowserManager.js +2 -3
  9. package/lib/ACBrowserManager.js.map +1 -1
  10. package/lib/ACEngineManager.d.ts +1 -12
  11. package/lib/ACEngineManager.js +72 -40
  12. package/lib/ACEngineManager.js.map +1 -1
  13. package/lib/ACHelper.js +126 -137
  14. package/lib/ACHelper.js.map +1 -1
  15. package/lib/api/IChecker.d.ts +3 -114
  16. package/lib/api/IChecker.js +1 -1
  17. package/lib/api/IChecker.js.map +1 -1
  18. package/lib/common/api-ext/Fetch.d.ts +16 -0
  19. package/lib/common/api-ext/Fetch.js +83 -0
  20. package/lib/common/api-ext/Fetch.js.map +1 -0
  21. package/lib/common/api-ext/IAbstractAPI.d.ts +34 -0
  22. package/lib/common/api-ext/IAbstractAPI.js +18 -0
  23. package/lib/common/api-ext/IAbstractAPI.js.map +1 -0
  24. package/lib/common/config/ACConfigManager.d.ts +7 -0
  25. package/lib/{ACConfigManager.js → common/config/ACConfigManager.js} +28 -19
  26. package/lib/common/config/ACConfigManager.js.map +1 -0
  27. package/lib/{ACConstants.d.ts → common/config/ACConstants.d.ts} +2 -2
  28. package/lib/{ACConstants.js → common/config/ACConstants.js} +7 -5
  29. package/lib/common/config/ACConstants.js.map +1 -0
  30. package/lib/common/config/IArchive.d.ts +37 -0
  31. package/lib/{reporters/multiScanReportUtil.d.ts → common/config/IArchive.js} +4 -5
  32. package/lib/common/config/IArchive.js.map +1 -0
  33. package/lib/common/config/IConfig.d.ts +146 -0
  34. package/lib/common/config/IConfig.js +36 -0
  35. package/lib/common/config/IConfig.js.map +1 -0
  36. package/lib/common/report/ACReporterCSV.d.ts +27 -0
  37. package/lib/common/report/ACReporterCSV.js +105 -0
  38. package/lib/common/report/ACReporterCSV.js.map +1 -0
  39. package/lib/common/report/ACReporterHTML.d.ts +26 -0
  40. package/lib/common/report/ACReporterHTML.js +94 -0
  41. package/lib/common/report/ACReporterHTML.js.map +1 -0
  42. package/lib/common/report/ACReporterJSON.d.ts +46 -0
  43. package/lib/common/report/ACReporterJSON.js +140 -0
  44. package/lib/common/report/ACReporterJSON.js.map +1 -0
  45. package/lib/{log/ACMetricsLogger.d.ts → common/report/ACReporterMetrics.d.ts} +11 -6
  46. package/lib/{log/ACMetricsLogger.js → common/report/ACReporterMetrics.js} +85 -70
  47. package/lib/common/report/ACReporterMetrics.js.map +1 -0
  48. package/lib/common/report/ACReporterXLSX.d.ts +37 -0
  49. package/lib/common/report/ACReporterXLSX.js +1004 -0
  50. package/lib/common/report/ACReporterXLSX.js.map +1 -0
  51. package/lib/common/report/BaselineManager.d.ts +169 -0
  52. package/lib/common/report/BaselineManager.js +355 -0
  53. package/lib/common/report/BaselineManager.js.map +1 -0
  54. package/lib/common/report/ReporterManager.d.ts +79 -0
  55. package/lib/common/report/ReporterManager.js +552 -0
  56. package/lib/common/report/ReporterManager.js.map +1 -0
  57. package/lib/common/report/genReport.js.map +1 -0
  58. package/package.json +1 -1
  59. package/lib/ACConfigManager.d.ts +0 -7
  60. package/lib/ACConfigManager.js.map +0 -1
  61. package/lib/ACConstants.js.map +0 -1
  62. package/lib/ACReportManager.d.ts +0 -590
  63. package/lib/ACReportManager.js +0 -1201
  64. package/lib/ACReportManager.js.map +0 -1
  65. package/lib/api/IEngine.d.ts +0 -129
  66. package/lib/api/IEngine.js +0 -110
  67. package/lib/api/IEngine.js.map +0 -1
  68. package/lib/log/ACMetricsLogger.js.map +0 -1
  69. package/lib/reporters/ACReporterCSV.d.ts +0 -103
  70. package/lib/reporters/ACReporterCSV.js +0 -193
  71. package/lib/reporters/ACReporterCSV.js.map +0 -1
  72. package/lib/reporters/ACReporterHTML.d.ts +0 -114
  73. package/lib/reporters/ACReporterHTML.js +0 -360
  74. package/lib/reporters/ACReporterHTML.js.map +0 -1
  75. package/lib/reporters/ACReporterJSON.d.ts +0 -114
  76. package/lib/reporters/ACReporterJSON.js +0 -277
  77. package/lib/reporters/ACReporterJSON.js.map +0 -1
  78. package/lib/reporters/ACReporterXLSX.d.ts +0 -109
  79. package/lib/reporters/ACReporterXLSX.js +0 -405
  80. package/lib/reporters/ACReporterXLSX.js.map +0 -1
  81. package/lib/reporters/ReportUtil.d.ts +0 -33
  82. package/lib/reporters/ReportUtil.js +0 -65
  83. package/lib/reporters/ReportUtil.js.map +0 -1
  84. package/lib/reporters/genReport.js.map +0 -1
  85. package/lib/reporters/multiScanData.d.ts +0 -27
  86. package/lib/reporters/multiScanData.js +0 -190
  87. package/lib/reporters/multiScanData.js.map +0 -1
  88. package/lib/reporters/multiScanReport.d.ts +0 -25
  89. package/lib/reporters/multiScanReport.js +0 -1729
  90. package/lib/reporters/multiScanReport.js.map +0 -1
  91. package/lib/reporters/multiScanReportUtil.js +0 -49
  92. package/lib/reporters/multiScanReportUtil.js.map +0 -1
  93. /package/lib/{reporters → common/report}/genReport.d.ts +0 -0
  94. /package/lib/{reporters → common/report}/genReport.js +0 -0
@@ -1,1729 +0,0 @@
1
- "use strict";
2
- /******************************************************************************
3
- Copyright:: 2020- IBM, Inc
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- *****************************************************************************/
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- // import ReportSummaryUtil from '../../../util/reportSummaryUtil';
55
- // import ExcelJS from "exceljs"
56
- var ExcelJS = require('exceljs');
57
- var fs = require('fs');
58
- var MultiScanReport = /** @class */ (function () {
59
- function MultiScanReport() {
60
- }
61
- MultiScanReport.multiScanXlsxDownload = function (storedScans, scanType, storedScanCount, archives, toolID, fileName) {
62
- return __awaiter(this, void 0, void 0, function () {
63
- var reportWorkbook, buffer;
64
- return __generator(this, function (_a) {
65
- switch (_a.label) {
66
- case 0:
67
- reportWorkbook = MultiScanReport.createReportWorkbook(storedScans, scanType, storedScanCount, archives, toolID);
68
- return [4 /*yield*/, reportWorkbook.xlsx.writeBuffer()];
69
- case 1:
70
- buffer = _a.sent();
71
- fs.writeFileSync(fileName, buffer);
72
- return [2 /*return*/];
73
- }
74
- });
75
- });
76
- };
77
- MultiScanReport.createReportWorkbook = function (storedScans, scanType, storedScanCount, archives, toolID) {
78
- // create workbook
79
- // @ts-ignore
80
- var workbook = new ExcelJS.Workbook({ useStyles: true });
81
- // create worksheets
82
- this.createOverviewSheet(storedScans, scanType, storedScanCount, archives, workbook, toolID);
83
- this.createScanSummarySheet(storedScans, scanType, workbook);
84
- this.createIssueSummarySheet(storedScans, scanType, workbook);
85
- this.createIssuesSheet(storedScans, scanType, workbook);
86
- this.createDefinitionsSheet(workbook);
87
- return workbook;
88
- };
89
- MultiScanReport.createOverviewSheet = function (storedScans, scanType, storedScanCount, archives, workbook, toolID) {
90
- var violations = 0;
91
- var needsReviews = 0;
92
- var recommendations = 0;
93
- var totalIssues = 0;
94
- // if scanType is "selected" need to recalculate storedScanCount
95
- var selectedStoredScanCount = 0;
96
- // BIG QUESTION: is report
97
- // 1. for current scan (from menu)
98
- // 2. all stored scans (from menu)
99
- // 3. selected stored scans (from scan manager)
100
- var theCurrentScan = storedScans[storedScans.length - 1];
101
- if (scanType === "current") {
102
- violations = theCurrentScan.violations;
103
- needsReviews = theCurrentScan.needsReviews;
104
- recommendations = theCurrentScan.recommendations;
105
- totalIssues = theCurrentScan.violations + theCurrentScan.needsReviews + theCurrentScan.recommendations;
106
- }
107
- else if (scanType === "all") {
108
- for (var i = 0; i < storedScans.length; i++) {
109
- violations += storedScans[i].violations;
110
- needsReviews += storedScans[i].needsReviews;
111
- recommendations += storedScans[i].recommendations;
112
- }
113
- totalIssues = violations + needsReviews + recommendations;
114
- }
115
- else if (scanType === "selected") {
116
- for (var i = 0; i < storedScans.length; i++) {
117
- if (storedScans[i].isSelected === true) {
118
- selectedStoredScanCount++;
119
- violations += storedScans[i].violations;
120
- needsReviews += storedScans[i].needsReviews;
121
- recommendations += storedScans[i].recommendations;
122
- }
123
- }
124
- totalIssues = violations + needsReviews + recommendations;
125
- }
126
- var worksheet = workbook.addWorksheet("Overview");
127
- // Report Title
128
- worksheet.mergeCells('A1', "D1");
129
- var titleRow = worksheet.getRow(1);
130
- titleRow.height = "27";
131
- var cellA1 = worksheet.getCell('A1');
132
- cellA1.value = "Accessibility Scan Report";
133
- cellA1.alignment = { vertical: "middle", horizontal: "left" };
134
- cellA1.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
135
- cellA1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
136
- // what are column widths - can't get it till you set it
137
- var colWidthData = [
138
- { col: 'A', width: '15.1' },
139
- { col: 'B', width: '15.9' },
140
- { col: 'C', width: '16.23' },
141
- { col: 'D', width: '19.4' },
142
- ];
143
- for (var i = 0; i < 4; i++) {
144
- worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
145
- }
146
- // set row height for rows 2-10
147
- for (var i = 2; i < 11; i++) {
148
- if (i == 7) {
149
- worksheet.getRow(i).height = 36;
150
- }
151
- else {
152
- worksheet.getRow(i).height = 12; // results in a row height of 16
153
- }
154
- }
155
- // note except for Report Date this is the same for all scans
156
- var rowData = [
157
- { key1: 'Tool:', key2: 'IBM Equal Access Accessibility Checker' },
158
- // {key1: 'Version:', key2: "chrome.runtime.getManifest().version"},
159
- { key1: 'Version:', key2: toolID },
160
- //@ts-ignore
161
- // {key1: 'Rule set:', key2: (theCurrentScan.ruleSet === "Latest Deployment") ? archives[1].name : theCurrentScan.ruleSet },
162
- { key1: 'Rule set:', key2: theCurrentScan.ruleSet },
163
- { key1: 'Guidelines:', key2: theCurrentScan.guidelines },
164
- { key1: 'Report date:', key2: theCurrentScan.reportDate },
165
- { key1: 'Platform:', key2: "N/A" },
166
- { key1: 'Scans:', key2: scanType === "current" ? 1 : scanType === "all" ? storedScanCount : selectedStoredScanCount },
167
- { key1: 'Pages:', key2: "" }
168
- ];
169
- worksheet.mergeCells('B2', "D2");
170
- worksheet.mergeCells('B3', "D3");
171
- worksheet.mergeCells('B4', "D4");
172
- worksheet.mergeCells('B5', "D5");
173
- worksheet.mergeCells('B6', "D6");
174
- worksheet.mergeCells('B7', "D7");
175
- worksheet.mergeCells('B8', "D8");
176
- worksheet.mergeCells('B9', "D9");
177
- worksheet.mergeCells('A10', "D10");
178
- for (var i = 2; i < 10; i++) {
179
- worksheet.getRow(i).getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
180
- worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
181
- worksheet.getRow(i).getCell(1).alignment = { horizontal: "left" };
182
- worksheet.getRow(i).getCell(2).alignment = { horizontal: "left" };
183
- if (i == 7) {
184
- worksheet.getRow(i).getCell(1).alignment = { vertical: "top" };
185
- worksheet.getRow(i).getCell(2).alignment = { wrapText: true };
186
- }
187
- }
188
- for (var i = 2; i < 10; i++) {
189
- worksheet.getRow(i).getCell(1).value = rowData[i - 2].key1;
190
- worksheet.getRow(i).getCell(2).value = rowData[i - 2].key2;
191
- }
192
- // Summary Title
193
- worksheet.mergeCells('A11', "D11");
194
- var summaryRow = worksheet.getRow(11);
195
- summaryRow.height = "27";
196
- var cellA11 = worksheet.getCell('A11');
197
- cellA11.value = "Summary";
198
- cellA11.alignment = { vertical: "middle", horizontal: "left" };
199
- cellA11.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
200
- cellA11.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
201
- // Scans info Headers
202
- worksheet.getRow(12).height = 16; // actual height is
203
- var cellA12 = worksheet.getCell('A12');
204
- cellA12.value = "Total issues";
205
- var cellB12 = worksheet.getCell('B12');
206
- cellB12.value = "Violations";
207
- var cellC12 = worksheet.getCell('C12');
208
- cellC12.value = "Needs review";
209
- var cellD12 = worksheet.getCell('D12');
210
- cellD12.value = "Recommendations";
211
- var cellObjects1 = [cellA12, cellB12, cellC12, cellD12];
212
- for (var i = 0; i < 4; i++) {
213
- cellObjects1[i].alignment = { vertical: "middle", horizontal: "center" };
214
- if (i == 1 || i == 2 || i == 3) {
215
- cellObjects1[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
216
- }
217
- else {
218
- cellObjects1[i].font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
219
- }
220
- // cellObjects1[i].fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFC65911'} };
221
- cellObjects1[i].border = {
222
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
223
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
224
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
225
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
226
- };
227
- }
228
- cellA12.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
229
- cellB12.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
230
- cellC12.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
231
- cellD12.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
232
- // Scans info Values
233
- worksheet.getRow(13).height = 27; // actual height is
234
- var cellA13 = worksheet.getCell('A13');
235
- cellA13.value = totalIssues;
236
- var cellB13 = worksheet.getCell('B13');
237
- cellB13.value = violations;
238
- var cellC13 = worksheet.getCell('C13');
239
- cellC13.value = needsReviews;
240
- var cellD13 = worksheet.getCell('D13');
241
- cellD13.value = recommendations;
242
- var cellObjects2 = [cellA13, cellB13, cellC13, cellD13];
243
- for (var i = 0; i < 4; i++) {
244
- cellObjects2[i].alignment = { vertical: "middle", horizontal: "center" };
245
- cellObjects2[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
246
- // cellObjects2[i].fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
247
- cellObjects2[i].border = {
248
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
249
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
250
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
251
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
252
- };
253
- }
254
- };
255
- MultiScanReport.createScanSummarySheet = function (storedScans, scanType, workbook) {
256
- var worksheet = workbook.addWorksheet("Scan summary");
257
- // Scans info Headers
258
- worksheet.getRow(1).height = 39; // actual height is 52
259
- var colWidthData = [
260
- { col: 'A', width: '27.0' },
261
- { col: 'B', width: '46.0' },
262
- { col: 'C', width: '20.17' },
263
- { col: 'D', width: '18.5' },
264
- { col: 'E', width: '17.17' },
265
- { col: 'F', width: '17.17' },
266
- { col: 'G', width: '17.17' },
267
- { col: 'H', width: '17.17' },
268
- { col: 'I', width: '17.17' },
269
- ];
270
- for (var i = 0; i < 9; i++) {
271
- worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
272
- }
273
- var cellA1 = worksheet.getCell('A1');
274
- cellA1.value = "Page title";
275
- var cellB1 = worksheet.getCell('B1');
276
- cellB1.value = "Page url";
277
- var cellC1 = worksheet.getCell('C1');
278
- cellC1.value = "Scan label";
279
- var cellD1 = worksheet.getCell('D1');
280
- cellD1.value = "Base scan";
281
- var cellObjects1 = [cellA1, cellB1, cellC1, cellD1];
282
- for (var i = 0; i < 4; i++) {
283
- cellObjects1[i].alignment = { vertical: "middle", horizontal: "left" };
284
- cellObjects1[i].font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
285
- cellObjects1[i].fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
286
- cellObjects1[i].border = {
287
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
288
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
289
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
290
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
291
- };
292
- }
293
- var cellE1 = worksheet.getCell('E1');
294
- cellE1.value = "Violations";
295
- var cellF1 = worksheet.getCell('F1');
296
- cellF1.value = "Needs review";
297
- var cellG1 = worksheet.getCell('G1');
298
- cellG1.value = "Recommendations";
299
- var cellH1 = worksheet.getCell('H1');
300
- cellH1.value = "% elements without violations";
301
- var cellI1 = worksheet.getCell('I1');
302
- cellI1.value = "% elements without violations or items to review";
303
- var cellObjects2 = [cellE1, cellF1, cellG1, cellH1, cellI1];
304
- for (var i = 0; i < 5; i++) {
305
- cellObjects2[i].alignment = { vertical: "middle", horizontal: "center", wrapText: true };
306
- if (i == 0 || i == 1 || i == 2) {
307
- cellObjects2[i].font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
308
- }
309
- else {
310
- cellObjects2[i].font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
311
- }
312
- // cellObjects2[i].fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFC65911'} };
313
- cellObjects2[i].border = {
314
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
315
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
316
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
317
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
318
- };
319
- }
320
- cellE1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
321
- cellF1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
322
- cellG1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
323
- cellH1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
324
- cellI1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
325
- // if current scan use last scan, if
326
- // if current scan use only the last scan otherwise loop through each scan an create row
327
- var j = scanType === "current" ? storedScans.length - 1 : 0; // NEED TO FIX for selected
328
- for (j; j < storedScans.length; j++) { // for each scan
329
- // console.log("scanType = ", scanType, " storedScans[j].isSelected = ", storedScans[j].isSelected);
330
- if (scanType === "selected" && storedScans[j].isSelected === true) {
331
- var row = worksheet.addRow([storedScans[j].pageTitle,
332
- storedScans[j].url,
333
- storedScans[j].userScanLabel,
334
- "none",
335
- storedScans[j].violations,
336
- storedScans[j].needsReviews,
337
- storedScans[j].recommendations,
338
- storedScans[j].elementsNoViolations,
339
- storedScans[j].elementsNoFailures
340
- ]);
341
- row.height = 37; // actual height is
342
- for (var i = 1; i < 5; i++) {
343
- row.getCell(i).alignment = { vertical: "middle", horizontal: "left", wrapText: true };
344
- row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: "12" };
345
- }
346
- for (var i = 5; i < 10; i++) {
347
- row.getCell(i).alignment = { vertical: "middle", horizontal: "center", wrapText: true };
348
- row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: "12" };
349
- // row.getCell(i).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
350
- row.getCell(i).border = {
351
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
352
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
353
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
354
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
355
- };
356
- }
357
- }
358
- else if (scanType === "all") {
359
- var row = worksheet.addRow([storedScans[j].pageTitle,
360
- storedScans[j].url,
361
- storedScans[j].userScanLabel,
362
- "none",
363
- storedScans[j].violations,
364
- storedScans[j].needsReviews,
365
- storedScans[j].recommendations,
366
- storedScans[j].elementsNoViolations,
367
- storedScans[j].elementsNoFailures
368
- ]);
369
- row.height = 37; // actual height is
370
- for (var i = 1; i < 5; i++) {
371
- row.getCell(i).alignment = { vertical: "middle", horizontal: "left", wrapText: true };
372
- row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: "12" };
373
- }
374
- for (var i = 5; i < 10; i++) {
375
- row.getCell(i).alignment = { vertical: "middle", horizontal: "center", wrapText: true };
376
- row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: "12" };
377
- // row.getCell(i).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
378
- row.getCell(i).border = {
379
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
380
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
381
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
382
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
383
- };
384
- }
385
- }
386
- else if (scanType === "current") {
387
- var row = worksheet.addRow([storedScans[j].pageTitle,
388
- storedScans[j].url,
389
- storedScans[j].userScanLabel,
390
- "none",
391
- storedScans[j].violations,
392
- storedScans[j].needsReviews,
393
- storedScans[j].recommendations,
394
- storedScans[j].elementsNoViolations,
395
- storedScans[j].elementsNoFailures
396
- ]);
397
- row.height = 37; // actual height is
398
- for (var i = 1; i < 5; i++) {
399
- row.getCell(i).alignment = { vertical: "middle", horizontal: "left", wrapText: true };
400
- row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: "12" };
401
- }
402
- for (var i = 5; i < 10; i++) {
403
- row.getCell(i).alignment = { vertical: "middle", horizontal: "center", wrapText: true };
404
- row.getCell(i).font = { name: "Calibri", color: { argb: "00000000" }, size: "12" };
405
- // row.getCell(i).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
406
- row.getCell(i).border = {
407
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
408
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
409
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
410
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
411
- };
412
- }
413
- }
414
- }
415
- };
416
- MultiScanReport.createIssueSummarySheet = function (storedScans, scanType, workbook) {
417
- var violations = 0;
418
- var needsReviews = 0;
419
- var recommendations = 0;
420
- var totalIssues = 0;
421
- // question 1: is report for current scans or all available scans?
422
- var theCurrentScan = storedScans[storedScans.length - 1];
423
- if (scanType === "current") {
424
- violations = theCurrentScan.violations;
425
- needsReviews = theCurrentScan.needsReviews;
426
- recommendations = theCurrentScan.recommendations;
427
- totalIssues = theCurrentScan.violations + theCurrentScan.needsReviews + theCurrentScan.recommendations;
428
- }
429
- else if (scanType === "all") {
430
- for (var i = 0; i < storedScans.length; i++) {
431
- violations += storedScans[i].violations;
432
- needsReviews += storedScans[i].needsReviews;
433
- recommendations += storedScans[i].recommendations;
434
- }
435
- totalIssues = violations + needsReviews + recommendations;
436
- }
437
- else if (scanType === "selected") {
438
- for (var i = 0; i < storedScans.length; i++) {
439
- if (storedScans[i].isSelected === true) {
440
- violations += storedScans[i].violations;
441
- needsReviews += storedScans[i].needsReviews;
442
- recommendations += storedScans[i].recommendations;
443
- }
444
- }
445
- totalIssues = violations + needsReviews + recommendations;
446
- }
447
- // counts
448
- var level1Counts = [0, 0, 0, 0]; // level 1 total issues, violations, needs reviews, recommendations
449
- var level2Counts = [0, 0, 0, 0];
450
- var level3Counts = [0, 0, 0, 0];
451
- var level4Counts = [0, 0, 0, 0];
452
- var level1V = [];
453
- var level2V = [];
454
- var level3V = [];
455
- var level4V = [];
456
- var level1NR = [];
457
- var level2NR = [];
458
- var level3NR = [];
459
- var level4NR = [];
460
- var level1R = [];
461
- var level2R = [];
462
- var level3R = [];
463
- var level4R = [];
464
- var j = scanType === "current" ? storedScans.length - 1 : 0; // NEED TO FIX for selected
465
- for (j; j < storedScans.length; j++) { // for each scan
466
- var myStoredData = storedScans[j].storedScanData;
467
- if (scanType === "selected" && storedScans[j].isSelected === true) {
468
- for (var i = 0; i < myStoredData.length; i++) { // for each issue row
469
- if (myStoredData[i][5] == 1) { // if level 1
470
- level1Counts[0]++;
471
- if (myStoredData[i][4] === "Violation") {
472
- level1Counts[1]++;
473
- level1V.push(myStoredData[i][9]);
474
- }
475
- if (myStoredData[i][4] === "Needs review") {
476
- level1Counts[2]++;
477
- level1NR.push(myStoredData[i][9]);
478
- }
479
- if (myStoredData[i][4] === "Recommendation") {
480
- level1Counts[3]++;
481
- level1R.push(myStoredData[i][9]);
482
- }
483
- }
484
- if (myStoredData[i][5] == 2) { // if level 2
485
- level2Counts[0]++;
486
- if (myStoredData[i][4] === "Violation") {
487
- level2Counts[1]++;
488
- level2V.push(myStoredData[i][9]);
489
- }
490
- if (myStoredData[i][4] === "Needs review") {
491
- level2Counts[2]++;
492
- level2NR.push(myStoredData[i][9]);
493
- }
494
- if (myStoredData[i][4] === "Recommendation") {
495
- level2Counts[3]++;
496
- level2R.push(myStoredData[i][9]);
497
- }
498
- }
499
- if (myStoredData[i][5] == 3) { // if level 3
500
- level3Counts[0]++;
501
- if (myStoredData[i][4] === "Violation") {
502
- level3Counts[1]++;
503
- level3V.push(myStoredData[i][9]);
504
- }
505
- if (myStoredData[i][4] === "Needs review") {
506
- level3Counts[2]++;
507
- level3NR.push(myStoredData[i][9]);
508
- }
509
- if (myStoredData[i][4] === "Recommendation") {
510
- level3Counts[3]++;
511
- level3R.push(myStoredData[i][9]);
512
- }
513
- }
514
- if (myStoredData[i][5] == 4) { // if level 4
515
- level4Counts[0]++;
516
- if (myStoredData[i][4] === "Violation") {
517
- level4Counts[1]++;
518
- level4V.push(myStoredData[i][9]);
519
- }
520
- if (myStoredData[i][4] === "Needs review") {
521
- level4Counts[2]++;
522
- level4NR.push(myStoredData[i][9]);
523
- }
524
- if (myStoredData[i][4] === "Recommendation") {
525
- level4Counts[3]++;
526
- level4R.push(myStoredData[i][9]);
527
- }
528
- }
529
- }
530
- }
531
- else if (scanType === "all") {
532
- for (var i = 0; i < myStoredData.length; i++) { // for each issue row
533
- if (myStoredData[i][5] == 1) { // if level 1
534
- level1Counts[0]++;
535
- if (myStoredData[i][4] === "Violation") {
536
- level1Counts[1]++;
537
- level1V.push(myStoredData[i][9]);
538
- }
539
- if (myStoredData[i][4] === "Needs review") {
540
- level1Counts[2]++;
541
- level1NR.push(myStoredData[i][9]);
542
- }
543
- if (myStoredData[i][4] === "Recommendation") {
544
- level1Counts[3]++;
545
- level1R.push(myStoredData[i][9]);
546
- }
547
- }
548
- if (myStoredData[i][5] == 2) { // if level 2
549
- level2Counts[0]++;
550
- if (myStoredData[i][4] === "Violation") {
551
- level2Counts[1]++;
552
- level2V.push(myStoredData[i][9]);
553
- }
554
- if (myStoredData[i][4] === "Needs review") {
555
- level2Counts[2]++;
556
- level2NR.push(myStoredData[i][9]);
557
- }
558
- if (myStoredData[i][4] === "Recommendation") {
559
- level2Counts[3]++;
560
- level2R.push(myStoredData[i][9]);
561
- }
562
- }
563
- if (myStoredData[i][5] == 3) { // if level 3
564
- level3Counts[0]++;
565
- if (myStoredData[i][4] === "Violation") {
566
- level3Counts[1]++;
567
- level3V.push(myStoredData[i][9]);
568
- }
569
- if (myStoredData[i][4] === "Needs review") {
570
- level3Counts[2]++;
571
- level3NR.push(myStoredData[i][9]);
572
- }
573
- if (myStoredData[i][4] === "Recommendation") {
574
- level3Counts[3]++;
575
- level3R.push(myStoredData[i][9]);
576
- }
577
- }
578
- if (myStoredData[i][5] == 4) { // if level 4
579
- level4Counts[0]++;
580
- if (myStoredData[i][4] === "Violation") {
581
- level4Counts[1]++;
582
- level4V.push(myStoredData[i][9]);
583
- }
584
- if (myStoredData[i][4] === "Needs review") {
585
- level4Counts[2]++;
586
- level4NR.push(myStoredData[i][9]);
587
- }
588
- if (myStoredData[i][4] === "Recommendation") {
589
- level4Counts[3]++;
590
- level4R.push(myStoredData[i][9]);
591
- }
592
- }
593
- }
594
- }
595
- else if (scanType === "current") {
596
- for (var i = 0; i < myStoredData.length; i++) { // for each issue row
597
- if (myStoredData[i][5] == 1) { // if level 1
598
- level1Counts[0]++;
599
- if (myStoredData[i][4] === "Violation") {
600
- level1Counts[1]++;
601
- level1V.push(myStoredData[i][9]);
602
- }
603
- if (myStoredData[i][4] === "Needs review") {
604
- level1Counts[2]++;
605
- level1NR.push(myStoredData[i][9]);
606
- }
607
- if (myStoredData[i][4] === "Recommendation") {
608
- level1Counts[3]++;
609
- level1R.push(myStoredData[i][9]);
610
- }
611
- }
612
- if (myStoredData[i][5] == 2) { // if level 2
613
- level2Counts[0]++;
614
- if (myStoredData[i][4] === "Violation") {
615
- level2Counts[1]++;
616
- level2V.push(myStoredData[i][9]);
617
- }
618
- if (myStoredData[i][4] === "Needs review") {
619
- level2Counts[2]++;
620
- level2NR.push(myStoredData[i][9]);
621
- }
622
- if (myStoredData[i][4] === "Recommendation") {
623
- level2Counts[3]++;
624
- level2R.push(myStoredData[i][9]);
625
- }
626
- }
627
- if (myStoredData[i][5] == 3) { // if level 3
628
- level3Counts[0]++;
629
- if (myStoredData[i][4] === "Violation") {
630
- level3Counts[1]++;
631
- level3V.push(myStoredData[i][9]);
632
- }
633
- if (myStoredData[i][4] === "Needs review") {
634
- level3Counts[2]++;
635
- level3NR.push(myStoredData[i][9]);
636
- }
637
- if (myStoredData[i][4] === "Recommendation") {
638
- level3Counts[3]++;
639
- level3R.push(myStoredData[i][9]);
640
- }
641
- }
642
- if (myStoredData[i][5] == 4) { // if level 4
643
- level4Counts[0]++;
644
- if (myStoredData[i][4] === "Violation") {
645
- level4Counts[1]++;
646
- level4V.push(myStoredData[i][9]);
647
- }
648
- if (myStoredData[i][4] === "Needs review") {
649
- level4Counts[2]++;
650
- level4NR.push(myStoredData[i][9]);
651
- }
652
- if (myStoredData[i][4] === "Recommendation") {
653
- level4Counts[3]++;
654
- level4R.push(myStoredData[i][9]);
655
- }
656
- }
657
- }
658
- }
659
- }
660
- // @ts-ignore
661
- var level1VrowValues = this.countDuplicatesInArray(level1V); // note this returns an object
662
- // @ts-ignore
663
- var level1NRrowValues = this.countDuplicatesInArray(level1NR);
664
- // @ts-ignore
665
- var level1RrowValues = this.countDuplicatesInArray(level1R);
666
- // @ts-ignore
667
- var level2VrowValues = this.countDuplicatesInArray(level2V); // note this returns an object
668
- // @ts-ignore
669
- var level2NRrowValues = this.countDuplicatesInArray(level2NR);
670
- // @ts-ignore
671
- var level2RrowValues = this.countDuplicatesInArray(level2R);
672
- // @ts-ignore
673
- var level3VrowValues = this.countDuplicatesInArray(level3V); // note this returns an object
674
- // @ts-ignore
675
- var level3NRrowValues = this.countDuplicatesInArray(level3NR);
676
- // @ts-ignore
677
- var level3RrowValues = this.countDuplicatesInArray(level3R);
678
- // @ts-ignore
679
- var level4VrowValues = this.countDuplicatesInArray(level4V); // note this returns an object
680
- // @ts-ignore
681
- var level4NRrowValues = this.countDuplicatesInArray(level4NR);
682
- // @ts-ignore
683
- var level4RrowValues = this.countDuplicatesInArray(level4R);
684
- var worksheet = workbook.addWorksheet("Issue summary");
685
- // Approach:
686
- // 1. sort by levels
687
- // 2. for each level sort by V, NR and R
688
- // 3. for each V, NR, and R in a level get issue dup counts
689
- // 4. build the rows
690
- // build Issue summary title
691
- worksheet.mergeCells('A1', "B1");
692
- var titleRow = worksheet.getRow(1);
693
- titleRow.height = "27"; // actual is 36
694
- var cellA1 = worksheet.getCell('A1');
695
- cellA1.value = "Issue summary";
696
- cellA1.alignment = { vertical: "middle", horizontal: "left" };
697
- cellA1.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
698
- cellA1.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
699
- var colWidthData = [
700
- { col: 'A', width: '155.51' },
701
- { col: 'B', width: '21.16' },
702
- ];
703
- for (var i = 0; i < 2; i++) {
704
- worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
705
- }
706
- // build Description title
707
- worksheet.mergeCells('A2', "B2");
708
- var descriptionRow = worksheet.getRow(2);
709
- descriptionRow.height = "20.25"; // actual is 27
710
- var cellA2 = worksheet.getCell("A2");
711
- cellA2.value = " In the IBM Equal Access Toolkit, issues are divided into three levels (1-3). Tackle the levels in order to address some of the most impactful issues first.";
712
- cellA2.alignment = { vertical: "middle", horizontal: "left" };
713
- cellA2.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
714
- // cellA2.fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFCCC0DA'} };
715
- // build Total issues found: title
716
- // worksheet.mergeCells('A3', "B3");
717
- var totalIssuesRow = worksheet.getRow(3);
718
- totalIssuesRow.height = "27"; // actual is 36
719
- var cellA3 = worksheet.getCell("A3");
720
- cellA3.value = "Total issues found:";
721
- cellA3.alignment = { vertical: "middle", horizontal: "left" };
722
- cellA3.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
723
- cellA3.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
724
- var cellB3 = worksheet.getCell("B3");
725
- cellB3.value = totalIssues;
726
- cellB3.alignment = { vertical: "middle", horizontal: "right" };
727
- cellB3.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
728
- cellB3.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF000000' } };
729
- // build Number of issues title
730
- var numberOfIssuesRow = worksheet.getRow(4);
731
- numberOfIssuesRow.height = "20.25"; // actual is 27
732
- var cellA4 = worksheet.getCell("A4");
733
- // no value
734
- cellA4.alignment = { vertical: "middle", horizontal: "left" };
735
- cellA4.border = {
736
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
737
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
738
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
739
- right: { style: 'thin', color: { argb: 'FFFFFFFF' } }
740
- };
741
- var cellB4 = worksheet.getCell("B4");
742
- cellB4.value = "Number of issues";
743
- cellB4.alignment = { vertical: "middle", horizontal: "right" };
744
- cellB4.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
745
- cellB4.border = {
746
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
747
- left: { style: 'thin', color: { argb: 'FFFFFFFF' } },
748
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
749
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
750
- };
751
- /////////////////////////////
752
- // build Level 1 title
753
- /////////////////////////////
754
- var level1Row = worksheet.getRow(5);
755
- level1Row.height = "27"; // actual is 36
756
- var cellA5 = worksheet.getCell("A5");
757
- cellA5.value = "Level 1 - the most essential issues to address";
758
- cellA5.alignment = { vertical: "middle", horizontal: "left" };
759
- cellA5.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
760
- cellA5.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
761
- var cellB5 = worksheet.getCell("B5");
762
- cellB5.value = level1Counts[0]; // total Level 1 issues
763
- cellB5.alignment = { vertical: "middle", horizontal: "right" };
764
- cellB5.font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
765
- cellB5.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
766
- // Level 1 Violation title
767
- var level1ViolationRow = worksheet.getRow(6);
768
- level1ViolationRow.height = "18"; // target is 21
769
- var cellA6 = worksheet.getCell("A6");
770
- cellA6.value = " Violation";
771
- cellA6.alignment = { vertical: "middle", horizontal: "left" };
772
- cellA6.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
773
- cellA6.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
774
- level1ViolationRow.getCell(1).border = {
775
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
776
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
777
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
778
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
779
- };
780
- var cellB6 = worksheet.getCell("B6");
781
- cellB6.value = level1Counts[1]; // total level 1 violations
782
- cellB6.alignment = { vertical: "middle", horizontal: "right" };
783
- cellB6.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
784
- cellB6.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
785
- level1ViolationRow.getCell(2).border = {
786
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
787
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
788
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
789
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
790
- };
791
- // Level 1 Violation Rows
792
- // build rows
793
- var rowArray = [];
794
- // let row:any =[];
795
- for (var property in level1VrowValues) {
796
- var row = [" " + "".concat(property), parseInt("".concat(level1VrowValues[property]))
797
- ];
798
- rowArray.push(row);
799
- }
800
- // sort array according to count
801
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
802
- // add array of rows
803
- var rows = worksheet.addRows(rowArray);
804
- rows.forEach(function (row) {
805
- row.height = 14;
806
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
807
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
808
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
809
- // row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
810
- // row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
811
- row.getCell(1).border = {
812
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
813
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
814
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
815
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
816
- };
817
- row.getCell(2).border = {
818
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
819
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
820
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
821
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
822
- };
823
- });
824
- // Level 1 Needs review title
825
- var level1NeedsReviewRow = worksheet.addRow(["", 0]);
826
- level1NeedsReviewRow.height = "18"; // target is 21
827
- level1NeedsReviewRow.getCell(1).value = " Needs review";
828
- level1NeedsReviewRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
829
- level1NeedsReviewRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
830
- level1NeedsReviewRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
831
- level1NeedsReviewRow.getCell(1).border = {
832
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
833
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
834
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
835
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
836
- };
837
- level1NeedsReviewRow.getCell(2).value = level1Counts[2]; // total level 1 needs review
838
- level1NeedsReviewRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
839
- level1NeedsReviewRow.getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
840
- level1NeedsReviewRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
841
- level1NeedsReviewRow.getCell(2).border = {
842
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
843
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
844
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
845
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
846
- };
847
- // Level 1 Needs review Rows
848
- // build rows
849
- rowArray = [];
850
- for (var property in level1NRrowValues) {
851
- var row = [" " + "".concat(property), parseInt("".concat(level1NRrowValues[property]))
852
- ];
853
- rowArray.push(row);
854
- }
855
- // sort array according to count
856
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
857
- // add array of rows
858
- rows = [];
859
- rows = worksheet.addRows(rowArray);
860
- rows.forEach(function (row) {
861
- row.height = 14;
862
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
863
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
864
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
865
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
866
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
867
- row.getCell(1).border = {
868
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
869
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
870
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
871
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
872
- };
873
- row.getCell(2).border = {
874
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
875
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
876
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
877
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
878
- };
879
- });
880
- // Level 1 Recommendation title
881
- var level1RecommendationRow = worksheet.addRow(["", 0]);
882
- level1RecommendationRow.height = "18"; // target is 21
883
- level1RecommendationRow.getCell(1).value = " Recommendation";
884
- level1RecommendationRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
885
- level1RecommendationRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
886
- level1RecommendationRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
887
- level1RecommendationRow.getCell(1).border = {
888
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
889
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
890
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
891
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
892
- };
893
- level1RecommendationRow.getCell(2).value = level1Counts[3]; // total level 1 recommendations
894
- level1RecommendationRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
895
- level1RecommendationRow.getCell(2).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
896
- level1RecommendationRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
897
- level1RecommendationRow.getCell(2).border = {
898
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
899
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
900
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
901
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
902
- };
903
- // Level 1 Recommendation Rows
904
- // build rows
905
- rowArray = [];
906
- for (var property in level1RrowValues) {
907
- var row = [" " + "".concat(property), parseInt("".concat(level1RrowValues[property]))
908
- ];
909
- rowArray.push(row);
910
- }
911
- // sort array according to count
912
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
913
- // add array of rows
914
- rows = [];
915
- rows = worksheet.addRows(rowArray);
916
- rows.forEach(function (row) {
917
- row.height = 14;
918
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
919
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
920
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
921
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
922
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
923
- row.getCell(1).border = {
924
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
925
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
926
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
927
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
928
- };
929
- row.getCell(2).border = {
930
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
931
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
932
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
933
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
934
- };
935
- });
936
- /////////////////////////////
937
- // build Level 2 title
938
- /////////////////////////////
939
- var level2Row = worksheet.addRow(["", 0]);
940
- level2Row.height = "27"; // actual is 36
941
- level2Row.getCell(1).value = "Level 2 - the next most important issues";
942
- level2Row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
943
- level2Row.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
944
- level2Row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
945
- level2Row.getCell(2).value = level2Counts[0]; // total Level 2 issues
946
- level2Row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
947
- level2Row.getCell(2).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
948
- level2Row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
949
- // Level 2 Violation title
950
- var level2ViolationRow = worksheet.addRow(["", 0]);
951
- level2ViolationRow.height = "18"; // target is 21
952
- level2ViolationRow.getCell(1).value = " Violation";
953
- level2ViolationRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
954
- level2ViolationRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
955
- level2ViolationRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
956
- level2ViolationRow.getCell(1).border = {
957
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
958
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
959
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
960
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
961
- };
962
- level2ViolationRow.getCell(2).value = level2Counts[1]; // total level 2 violations
963
- level2ViolationRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
964
- level2ViolationRow.getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
965
- level2ViolationRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
966
- level2ViolationRow.getCell(2).border = {
967
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
968
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
969
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
970
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
971
- };
972
- // Level 2 Violation Rows
973
- // build rows
974
- rowArray = [];
975
- for (var property in level2VrowValues) {
976
- var row = [" " + "".concat(property), parseInt("".concat(level2VrowValues[property]))
977
- ];
978
- rowArray.push(row);
979
- }
980
- // sort array according to count
981
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
982
- // add array of rows
983
- rows = worksheet.addRows(rowArray);
984
- rows.forEach(function (row) {
985
- row.height = 14;
986
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
987
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
988
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
989
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
990
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
991
- row.getCell(1).border = {
992
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
993
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
994
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
995
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
996
- };
997
- row.getCell(2).border = {
998
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
999
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1000
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1001
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1002
- };
1003
- });
1004
- // Level 2 Needs review title
1005
- var level2NeedsReviewRow = worksheet.addRow(["", 0]);
1006
- level2NeedsReviewRow.height = "18"; // target is 21
1007
- level2NeedsReviewRow.getCell(1).value = " Needs review";
1008
- level2NeedsReviewRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1009
- level2NeedsReviewRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1010
- level2NeedsReviewRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
1011
- level2NeedsReviewRow.getCell(1).border = {
1012
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1013
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1014
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1015
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1016
- };
1017
- level2NeedsReviewRow.getCell(2).value = level2Counts[2]; // total level 2 needs review
1018
- level2NeedsReviewRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1019
- level2NeedsReviewRow.getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1020
- level2NeedsReviewRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
1021
- level2NeedsReviewRow.getCell(2).border = {
1022
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1023
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1024
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1025
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1026
- };
1027
- // Level 2 Needs review Rows
1028
- // build rows
1029
- rowArray = [];
1030
- for (var property in level2NRrowValues) {
1031
- var row = [" " + "".concat(property), parseInt("".concat(level2NRrowValues[property]))
1032
- ];
1033
- rowArray.push(row);
1034
- }
1035
- // sort array according to count
1036
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
1037
- // add array of rows
1038
- rows = [];
1039
- rows = worksheet.addRows(rowArray);
1040
- rows.forEach(function (row) {
1041
- row.height = 14;
1042
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1043
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1044
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1045
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1046
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1047
- row.getCell(1).border = {
1048
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1049
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1050
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1051
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1052
- };
1053
- row.getCell(2).border = {
1054
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1055
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1056
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1057
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1058
- };
1059
- });
1060
- // Level 2 Recommendation title
1061
- var level2RecommendationRow = worksheet.addRow(["", 0]);
1062
- level2RecommendationRow.height = "18"; // target is 21
1063
- level2RecommendationRow.getCell(1).value = " Recommendation";
1064
- level2RecommendationRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1065
- level2RecommendationRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1066
- level2RecommendationRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
1067
- level2RecommendationRow.getCell(1).border = {
1068
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1069
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1070
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1071
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1072
- };
1073
- level2RecommendationRow.getCell(2).value = level2Counts[3]; // total level 2 recommendations
1074
- level2RecommendationRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1075
- level2RecommendationRow.getCell(2).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
1076
- level2RecommendationRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
1077
- level2RecommendationRow.getCell(2).border = {
1078
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1079
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1080
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1081
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1082
- };
1083
- // Level 2 Recommendation Rows
1084
- // build rows
1085
- rowArray = [];
1086
- for (var property in level2RrowValues) {
1087
- var row = [" " + "".concat(property), parseInt("".concat(level2RrowValues[property]))
1088
- ];
1089
- rowArray.push(row);
1090
- }
1091
- // sort array according to count
1092
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
1093
- // add array of rows
1094
- rows = [];
1095
- rows = worksheet.addRows(rowArray);
1096
- rows.forEach(function (row) {
1097
- row.height = 14;
1098
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1099
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1100
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1101
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1102
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1103
- row.getCell(1).border = {
1104
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1105
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1106
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1107
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1108
- };
1109
- row.getCell(2).border = {
1110
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1111
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1112
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1113
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1114
- };
1115
- });
1116
- /////////////////////////////
1117
- // build Level 3 title
1118
- /////////////////////////////
1119
- var level3Row = worksheet.addRow(["", 0]);
1120
- level3Row.height = "27"; // actual is 36
1121
- level3Row.getCell(1).value = "Level 3 - necessary to meet requirements";
1122
- level3Row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1123
- level3Row.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
1124
- level3Row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
1125
- level3Row.getCell(2).value = level3Counts[0]; // total Level 3 issues
1126
- level3Row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1127
- level3Row.getCell(2).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
1128
- level3Row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
1129
- // Level 3 Violation title
1130
- var level3ViolationRow = worksheet.addRow(["", 0]);
1131
- level3ViolationRow.height = "18"; // target is 21
1132
- level3ViolationRow.getCell(1).value = " Violation";
1133
- level3ViolationRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1134
- level3ViolationRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1135
- level3ViolationRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
1136
- level3ViolationRow.getCell(1).border = {
1137
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1138
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1139
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1140
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1141
- };
1142
- level3ViolationRow.getCell(2).value = level3Counts[1]; // total level 3 violations
1143
- level3ViolationRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1144
- level3ViolationRow.getCell(2).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
1145
- level3ViolationRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
1146
- level3ViolationRow.getCell(2).border = {
1147
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1148
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1149
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1150
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1151
- };
1152
- // Level 3 Violation Rows
1153
- // build rows
1154
- rowArray = [];
1155
- for (var property in level3VrowValues) {
1156
- var row = [" " + "".concat(property), parseInt("".concat(level3VrowValues[property]))
1157
- ];
1158
- rowArray.push(row);
1159
- }
1160
- // sort array according to count
1161
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
1162
- // add array of rows
1163
- rows = worksheet.addRows(rowArray);
1164
- rows.forEach(function (row) {
1165
- row.height = 14;
1166
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1167
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1168
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1169
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1170
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1171
- row.getCell(1).border = {
1172
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1173
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1174
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1175
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1176
- };
1177
- row.getCell(2).border = {
1178
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1179
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1180
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1181
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1182
- };
1183
- });
1184
- // Level 3 Needs review title
1185
- var level3NeedsReviewRow = worksheet.addRow(["", 0]);
1186
- level3NeedsReviewRow.height = "18"; // target is 21
1187
- level3NeedsReviewRow.getCell(1).value = " Needs review";
1188
- level3NeedsReviewRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1189
- level3NeedsReviewRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1190
- level3NeedsReviewRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
1191
- level3NeedsReviewRow.getCell(1).border = {
1192
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1193
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1194
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1195
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1196
- };
1197
- level3NeedsReviewRow.getCell(2).value = level3Counts[2]; // total level 3 needs review
1198
- level3NeedsReviewRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1199
- level3NeedsReviewRow.getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1200
- level3NeedsReviewRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
1201
- level3NeedsReviewRow.getCell(2).border = {
1202
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1203
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1204
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1205
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1206
- };
1207
- // Level 3 Needs review Rows
1208
- // build rows
1209
- rowArray = [];
1210
- for (var property in level3NRrowValues) {
1211
- var row = [" " + "".concat(property), parseInt("".concat(level3NRrowValues[property]))
1212
- ];
1213
- rowArray.push(row);
1214
- }
1215
- // sort array according to count
1216
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
1217
- // add array of rows
1218
- rows = [];
1219
- rows = worksheet.addRows(rowArray);
1220
- rows.forEach(function (row) {
1221
- row.height = 14;
1222
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1223
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1224
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1225
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1226
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1227
- row.getCell(1).border = {
1228
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1229
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1230
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1231
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1232
- };
1233
- row.getCell(2).border = {
1234
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1235
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1236
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1237
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1238
- };
1239
- });
1240
- // Level 3 Recommendation title
1241
- var level3RecommendationRow = worksheet.addRow(["", 0]);
1242
- level3RecommendationRow.height = "18"; // target is 21
1243
- level3RecommendationRow.getCell(1).value = " Recommendation";
1244
- level3RecommendationRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1245
- level3RecommendationRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1246
- level3RecommendationRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
1247
- level3RecommendationRow.getCell(1).border = {
1248
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1249
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1250
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1251
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1252
- };
1253
- level3RecommendationRow.getCell(2).value = level3Counts[3]; // total level 3 recommendations
1254
- level3RecommendationRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1255
- level3RecommendationRow.getCell(2).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
1256
- level3RecommendationRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
1257
- level3RecommendationRow.getCell(2).border = {
1258
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1259
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1260
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1261
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1262
- };
1263
- // Level 3 Recommendation Rows
1264
- // build rows
1265
- rowArray = [];
1266
- for (var property in level3RrowValues) {
1267
- var row = [" " + "".concat(property), parseInt("".concat(level3RrowValues[property]))
1268
- ];
1269
- rowArray.push(row);
1270
- }
1271
- // sort array according to count
1272
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
1273
- // add array of rows
1274
- rows = [];
1275
- rows = worksheet.addRows(rowArray);
1276
- rows.forEach(function (row) {
1277
- row.height = 14;
1278
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1279
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1280
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1281
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1282
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1283
- row.getCell(1).border = {
1284
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1285
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1286
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1287
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1288
- };
1289
- row.getCell(2).border = {
1290
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1291
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1292
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1293
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1294
- };
1295
- });
1296
- /////////////////////////////
1297
- // build Level 4 title
1298
- /////////////////////////////
1299
- var level4Row = worksheet.addRow(["", 0]);
1300
- level4Row.height = "27"; // actual is 36
1301
- level4Row.getCell(1).value = "Level 4 - further recommended improvements to accessibility";
1302
- level4Row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1303
- level4Row.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
1304
- level4Row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
1305
- level4Row.getCell(2).value = level4Counts[0]; // total Level 4 issues
1306
- level4Row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1307
- level4Row.getCell(2).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
1308
- level4Row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
1309
- // Level 4 Violation title
1310
- var level4ViolationRow = worksheet.addRow(["", 0]);
1311
- level4ViolationRow.height = "18"; // target is 21
1312
- level4ViolationRow.getCell(1).value = " Violation";
1313
- level4ViolationRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1314
- level4ViolationRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1315
- level4ViolationRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
1316
- level4ViolationRow.getCell(1).border = {
1317
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1318
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1319
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1320
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1321
- };
1322
- level4ViolationRow.getCell(2).value = level4Counts[1]; // total level 4 violations
1323
- level4ViolationRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1324
- level4ViolationRow.getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1325
- level4ViolationRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFE4AAAF' } };
1326
- level4ViolationRow.getCell(2).border = {
1327
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1328
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1329
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1330
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1331
- };
1332
- // Level 4 Violation Rows
1333
- // build rows
1334
- rowArray = [];
1335
- for (var property in level4VrowValues) {
1336
- var row = [" " + "".concat(property), parseInt("".concat(level4VrowValues[property]))
1337
- ];
1338
- rowArray.push(row);
1339
- }
1340
- // sort array according to count
1341
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
1342
- // add array of rows
1343
- rows = worksheet.addRows(rowArray);
1344
- rows.forEach(function (row) {
1345
- row.height = 14;
1346
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1347
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1348
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1349
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1350
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1351
- row.getCell(1).border = {
1352
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1353
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1354
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1355
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1356
- };
1357
- row.getCell(2).border = {
1358
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1359
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1360
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1361
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1362
- };
1363
- });
1364
- // Level 4 Needs review title
1365
- var level4NeedsReviewRow = worksheet.addRow(["", 0]);
1366
- level4NeedsReviewRow.height = "18"; // target is 21
1367
- level4NeedsReviewRow.getCell(1).value = " Needs review";
1368
- level4NeedsReviewRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1369
- level4NeedsReviewRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1370
- level4NeedsReviewRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
1371
- level4NeedsReviewRow.getCell(1).border = {
1372
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1373
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1374
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1375
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1376
- };
1377
- level4NeedsReviewRow.getCell(2).value = level4Counts[2]; // total level 4 needs review
1378
- level4NeedsReviewRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1379
- level4NeedsReviewRow.getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1380
- level4NeedsReviewRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFF4E08A' } };
1381
- level4NeedsReviewRow.getCell(2).border = {
1382
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1383
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1384
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1385
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1386
- };
1387
- // Level 4 Needs review Rows
1388
- // build rows
1389
- rowArray = [];
1390
- for (var property in level4NRrowValues) {
1391
- var row = [" " + "".concat(property), parseInt("".concat(level4NRrowValues[property]))
1392
- ];
1393
- rowArray.push(row);
1394
- }
1395
- // sort array according to count
1396
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
1397
- // add array of rows
1398
- rows = [];
1399
- rows = worksheet.addRows(rowArray);
1400
- rows.forEach(function (row) {
1401
- row.height = 14;
1402
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1403
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1404
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1405
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1406
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1407
- row.getCell(1).border = {
1408
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1409
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1410
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1411
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1412
- };
1413
- row.getCell(2).border = {
1414
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1415
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1416
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1417
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1418
- };
1419
- });
1420
- // Level 4 Recommendation title
1421
- var level4RecommendationRow = worksheet.addRow(["", 0]);
1422
- level4RecommendationRow.height = "18"; // target is 21
1423
- level4RecommendationRow.getCell(1).value = " Recommendation";
1424
- level4RecommendationRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1425
- level4RecommendationRow.getCell(1).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1426
- level4RecommendationRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
1427
- level4RecommendationRow.getCell(1).border = {
1428
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1429
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1430
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1431
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1432
- };
1433
- level4RecommendationRow.getCell(2).value = level4Counts[3]; // total level 4 recommendations
1434
- level4RecommendationRow.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1435
- level4RecommendationRow.getCell(2).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
1436
- level4RecommendationRow.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF96A9D7' } };
1437
- level4RecommendationRow.getCell(2).border = {
1438
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1439
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1440
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1441
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1442
- };
1443
- // Level 4 Recommendation Rows
1444
- // build rows
1445
- rowArray = [];
1446
- for (var property in level4RrowValues) {
1447
- var row = [" " + "".concat(property), parseInt("".concat(level4RrowValues[property]))
1448
- ];
1449
- rowArray.push(row);
1450
- }
1451
- // sort array according to count
1452
- rowArray.sort(function (a, b) { return (a[1] < b[1]) ? 1 : -1; });
1453
- // add array of rows
1454
- rows = [];
1455
- rows = worksheet.addRows(rowArray);
1456
- rows.forEach(function (row) {
1457
- row.height = 14;
1458
- row.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1459
- row.getCell(2).alignment = { vertical: "middle", horizontal: "right" };
1460
- row.font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1461
- //row.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1462
- //row.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor:{argb:'FFf8cbad'} };
1463
- row.getCell(1).border = {
1464
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1465
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1466
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1467
- // right: {style:'thin', color: {argb: 'FFA6A6A6'}}
1468
- };
1469
- row.getCell(2).border = {
1470
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1471
- // left: {style:'thin', color: {argb: 'FFA6A6A6'}},
1472
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1473
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1474
- };
1475
- });
1476
- };
1477
- MultiScanReport.createIssuesSheet = function (storedScans, scanType, workbook) {
1478
- var worksheet = workbook.addWorksheet("Issues");
1479
- // build rows
1480
- var rowArray = [];
1481
- var j = scanType === "current" ? storedScans.length - 1 : 0; // NEED TO FIX for selected
1482
- for (j; j < storedScans.length; j++) {
1483
- var myStoredData = storedScans[j].storedScanData;
1484
- if (scanType === "selected" && storedScans[j].isSelected === true) {
1485
- for (var i = 0; i < myStoredData.length; i++) {
1486
- var row = [myStoredData[i][0], myStoredData[i][1], storedScans[j].userScanLabel,
1487
- myStoredData[i][3], myStoredData[i][4], Number.isNaN(myStoredData[i][5]) ? "n/a" : myStoredData[i][5],
1488
- myStoredData[i][6], Number.isNaN(myStoredData[i][5]) ? "n/a" : myStoredData[i][7], myStoredData[i][8],
1489
- myStoredData[i][9], myStoredData[i][10], myStoredData[i][11],
1490
- myStoredData[i][12], myStoredData[i][13]
1491
- ];
1492
- rowArray.push(row);
1493
- }
1494
- }
1495
- else if (scanType === "all") {
1496
- for (var i = 0; i < myStoredData.length; i++) {
1497
- var row = [myStoredData[i][0], myStoredData[i][1], storedScans[j].userScanLabel,
1498
- myStoredData[i][3], myStoredData[i][4], Number.isNaN(myStoredData[i][5]) ? "n/a" : myStoredData[i][5],
1499
- myStoredData[i][6], Number.isNaN(myStoredData[i][5]) ? "n/a" : myStoredData[i][7], myStoredData[i][8],
1500
- myStoredData[i][9], myStoredData[i][10], myStoredData[i][11],
1501
- myStoredData[i][12], myStoredData[i][13]
1502
- ];
1503
- rowArray.push(row);
1504
- }
1505
- }
1506
- else if (scanType === "current") {
1507
- for (var i = 0; i < myStoredData.length; i++) {
1508
- var row = [myStoredData[i][0], myStoredData[i][1], storedScans[j].userScanLabel,
1509
- myStoredData[i][3], myStoredData[i][4], Number.isNaN(myStoredData[i][5]) ? "n/a" : myStoredData[i][5],
1510
- myStoredData[i][6], Number.isNaN(myStoredData[i][5]) ? "n/a" : myStoredData[i][7], myStoredData[i][8],
1511
- myStoredData[i][9], myStoredData[i][10], myStoredData[i][11],
1512
- myStoredData[i][12], myStoredData[i][13]
1513
- ];
1514
- rowArray.push(row);
1515
- }
1516
- }
1517
- }
1518
- // column widths
1519
- var colWidthData = [
1520
- { col: 'A', width: '18.0', alignment: { vertical: "middle", horizontal: "left" } },
1521
- { col: 'B', width: '20.5', alignment: { vertical: "middle", horizontal: "left" } },
1522
- { col: 'C', width: '21.0', alignment: { vertical: "middle", horizontal: "center" } },
1523
- { col: 'D', width: '18.5', alignment: { vertical: "middle", horizontal: "left" } },
1524
- { col: 'E', width: '17.0', alignment: { vertical: "middle", horizontal: "center" } },
1525
- { col: 'F', width: '17.17', alignment: { vertical: "middle", horizontal: "center" } },
1526
- { col: 'G', width: '17.17', alignment: { vertical: "middle", horizontal: "left" } },
1527
- { col: 'H', width: '17.17', alignment: { vertical: "middle", horizontal: "center" } },
1528
- { col: 'I', width: '17.17', alignment: { vertical: "middle", horizontal: "left" } },
1529
- { col: 'J', width: '17.17', alignment: { vertical: "middle", horizontal: "left" } },
1530
- { col: 'K', width: '14.00', alignment: { vertical: "middle", horizontal: "center" } },
1531
- { col: 'L', width: '17.17', alignment: { vertical: "middle", horizontal: "left" } },
1532
- { col: 'M', width: '43.00', alignment: { vertical: "middle", horizontal: "left" } },
1533
- { col: 'N', width: '17.17', alignment: { vertical: "middle", horizontal: "fill" } },
1534
- ];
1535
- for (var i = 0; i < 14; i++) {
1536
- worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
1537
- worksheet.getColumn(colWidthData[i].col).alignment = colWidthData[i].alignment;
1538
- }
1539
- // set font and alignment for the header cells
1540
- for (var i = 1; i < 15; i++) {
1541
- worksheet.getRow(1).getCell(i).alignment = { vertical: "middle", horizontal: "center", wrapText: true };
1542
- worksheet.getRow(1).getCell(i).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "12" };
1543
- worksheet.getRow(1).getCell(i).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
1544
- worksheet.getRow(1).getCell(i).border = {
1545
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1546
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1547
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1548
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1549
- };
1550
- }
1551
- // height for header row
1552
- worksheet.getRow(1).height = 24;
1553
- // add table to a sheet
1554
- worksheet.addTable({
1555
- name: 'MyTable',
1556
- ref: 'A1',
1557
- headerRow: true,
1558
- // totalsRow: true,
1559
- style: {
1560
- theme: 'TableStyleMedium2',
1561
- showRowStripes: true,
1562
- },
1563
- columns: [
1564
- { name: 'Page title', filterButton: true },
1565
- { name: 'Page URL', filterButton: true },
1566
- { name: 'Scan label', filterButton: true },
1567
- { name: 'Issue ID', filterButton: true },
1568
- { name: 'Issue type', filterButton: true },
1569
- { name: 'Toolkit level', filterButton: true },
1570
- { name: 'Checkpoint', filterButton: true },
1571
- { name: 'WCAG level', filterButton: true },
1572
- { name: 'Rule', filterButton: true },
1573
- { name: 'Issue', filterButton: true },
1574
- { name: 'Element', filterButton: true },
1575
- { name: 'Code', filterButton: true },
1576
- { name: 'Xpath', filterButton: true },
1577
- { name: 'Help', filterButton: true },
1578
- ],
1579
- rows: rowArray
1580
- });
1581
- for (var i = 2; i <= rowArray.length + 1; i++) {
1582
- worksheet.getRow(i).height = 14;
1583
- for (var j_1 = 1; j_1 <= 14; j_1++) {
1584
- worksheet.getRow(i).getCell(j_1).border = {
1585
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1586
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1587
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1588
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1589
- };
1590
- }
1591
- }
1592
- };
1593
- MultiScanReport.createDefinitionsSheet = function (workbook) {
1594
- var worksheet = workbook.addWorksheet("Definition of fields");
1595
- // "Definition of fields" title
1596
- worksheet.mergeCells('A1', "B1");
1597
- var titleRow = worksheet.getRow(1);
1598
- titleRow.height = "36"; // actual is 48
1599
- titleRow.getCell(1).value = "Definition of fields";
1600
- titleRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1601
- titleRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "20" };
1602
- titleRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
1603
- var colWidthData = [
1604
- { col: 'A', width: '41.51' },
1605
- { col: 'B', width: '119.51' },
1606
- ];
1607
- for (var i = 0; i < 2; i++) {
1608
- worksheet.getColumn(colWidthData[i].col).width = colWidthData[i].width;
1609
- }
1610
- // blank row
1611
- worksheet.mergeCells('A2', "B2");
1612
- var blankRow = worksheet.getRow(2);
1613
- blankRow.height = "12"; // actual is 16
1614
- // "Scan summary and Issue summary" title
1615
- worksheet.mergeCells('A3', "B3");
1616
- var summaryRow = worksheet.getRow(3);
1617
- summaryRow.height = "20"; // actual is 26.75
1618
- summaryRow.getCell(1).value = "Scan summary and Issue summary";
1619
- summaryRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1620
- summaryRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
1621
- summaryRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
1622
- // row 4 Field / Definition
1623
- var row4 = worksheet.getRow(4);
1624
- row4.height = "16"; // actual is
1625
- row4.getCell(1).value = "Field";
1626
- row4.getCell(2).value = "Definition";
1627
- row4.getCell(1).alignment = row4.getCell(2).alignment = { vertical: "middle", horizontal: "left" };
1628
- row4.getCell(1).font = row4.getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "16" };
1629
- row4.getCell(1).fill = row4.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFCCC0DA' } };
1630
- row4.getCell(1).border = row4.getCell(2).border = {
1631
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1632
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1633
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1634
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1635
- };
1636
- // rows 5-13
1637
- // set row height for rows 5-13
1638
- for (var i = 5; i < 14; i++) {
1639
- worksheet.getRow(i).height = 12; // results in a row height of 16
1640
- }
1641
- var rowData = [
1642
- { key1: 'Page', key2: 'Identifies the page or html file that was scanned.' },
1643
- { key1: 'Scan label', key2: 'Label for the scan. Default values can be edited in the Accessibility Checker before saving this report, or programmatically assigned in automated testing.' },
1644
- { key1: 'Base scan', key2: 'Scan label for a previous scan against which this scan was compared. Only new issues are reported when a base scan is used.' },
1645
- { key1: 'Violations', key2: 'Accessibility failures that need to be corrected.' },
1646
- { key1: 'Needs review', key2: 'Issues that may not be a violation. These need a manual review to identify whether there is an accessibility problem.' },
1647
- { key1: 'Recommendations', key2: 'Opportunities to apply best practices to further improve accessibility.' },
1648
- { key1: '% elements without violations', key2: 'Percentage of elements on the page that had no violations found.' },
1649
- { key1: '% elements without violations or items to review', key2: 'Percentage of elements on the page that had no violations found and no items to review.' },
1650
- { key1: 'Level 1,2,3', key2: 'Priority level defined by the IBM Equal Access Toolkit. See https://www.ibm.com/able/toolkit/plan#pace-of-completion for details.' }
1651
- ];
1652
- for (var i = 5; i < 14; i++) {
1653
- worksheet.getRow(i).getCell(1).font = worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1654
- worksheet.getRow(i).getCell(1).alignment = worksheet.getRow(i).getCell(2).alignment = { horizontal: "left" };
1655
- }
1656
- for (var i = 5; i < 14; i++) {
1657
- worksheet.getRow(i).getCell(1).value = rowData[i - 5].key1;
1658
- worksheet.getRow(i).getCell(2).value = rowData[i - 5].key2;
1659
- }
1660
- // "Scan summary and Issue summary" title
1661
- worksheet.mergeCells('A14', "B14");
1662
- var issuesRow = worksheet.getRow(14);
1663
- issuesRow.height = "20"; // actual is 26.75
1664
- issuesRow.getCell(1).value = "Issues";
1665
- issuesRow.getCell(1).alignment = { vertical: "middle", horizontal: "left" };
1666
- issuesRow.getCell(1).font = { name: "Calibri", color: { argb: "FFFFFFFF" }, size: "16" };
1667
- issuesRow.getCell(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF403151' } };
1668
- // row 15 Field / Definition
1669
- var row15 = worksheet.getRow(15);
1670
- row15.height = "16"; // actual is
1671
- row15.getCell(1).value = "Field";
1672
- row15.getCell(2).value = "Definition";
1673
- row15.getCell(1).alignment = row15.getCell(2).alignment = { vertical: "middle", horizontal: "left" };
1674
- row15.getCell(1).font = row15.getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "16" };
1675
- row15.getCell(1).fill = row15.getCell(2).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFCCC0DA' } };
1676
- row15.getCell(1).border = row15.getCell(2).border = {
1677
- top: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1678
- left: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1679
- bottom: { style: 'thin', color: { argb: 'FFA6A6A6' } },
1680
- right: { style: 'thin', color: { argb: 'FFA6A6A6' } }
1681
- };
1682
- // rows 16-28
1683
- // set row height for rows 16-28
1684
- for (var i = 16; i < 29; i++) {
1685
- worksheet.getRow(i).height = 12; // results in a row height of 16
1686
- }
1687
- rowData = [];
1688
- rowData = [
1689
- { key1: 'Page', key2: 'Identifies the page or html file that was scanned.' },
1690
- { key1: 'Scan label', key2: 'Label for the scan. Default values can be edited in the Accessibility Checker before saving this report, or programmatically assigned in automated testing.' },
1691
- { key1: 'Issue ID', key2: 'Identifier for this issue within this page. Rescanning the same page will produce the same issue ID. ' },
1692
- { key1: 'Issue type', key2: 'Violation, needs review, or recommendation' },
1693
- { key1: 'Toolkit level', key2: '1, 2 or 3. Priority level defined by the IBM Equal Access Toolkit. See https://www.ibm.com/able/toolkit/plan#pace-of-completion for details' },
1694
- { key1: 'Checkpoint', key2: 'Web Content Accessibility Guidelines (WCAG) checkpoints this issue falls into.' },
1695
- { key1: 'WCAG level', key2: 'A, AA or AAA. WCAG level for this issue.' },
1696
- { key1: 'Rule', key2: 'Name of the accessibility test rule that detected this issue.' },
1697
- { key1: 'Issue', key2: 'Message describing the issue.' },
1698
- { key1: 'Element', key2: 'Type of HTML element where the issue is found.' },
1699
- { key1: 'Code', key2: 'Actual HTML element where the issue is found.' },
1700
- { key1: 'Xpath', key2: 'Xpath of the HTML element where the issue is found.' },
1701
- { key1: 'Help', key2: 'Link to a more detailed description of the issue and suggested solutions.' },
1702
- ];
1703
- for (var i = 16; i < 29; i++) {
1704
- worksheet.getRow(i).getCell(1).font = worksheet.getRow(i).getCell(2).font = { name: "Calibri", color: { argb: "FF000000" }, size: "12" };
1705
- worksheet.getRow(i).getCell(1).alignment = worksheet.getRow(i).getCell(2).alignment = { horizontal: "left" };
1706
- }
1707
- for (var i = 16; i < 29; i++) {
1708
- worksheet.getRow(i).getCell(1).value = rowData[i - 16].key1;
1709
- worksheet.getRow(i).getCell(2).value = rowData[i - 16].key2;
1710
- }
1711
- };
1712
- MultiScanReport.countDuplicatesInArray = function (array) {
1713
- var count = {};
1714
- // let result = [];
1715
- array.forEach(function (item) {
1716
- if (count[item]) {
1717
- //@ts-ignore
1718
- count[item] += 1;
1719
- return;
1720
- }
1721
- //@ts-ignore
1722
- count[item] = 1;
1723
- });
1724
- return count;
1725
- };
1726
- return MultiScanReport;
1727
- }());
1728
- exports.default = MultiScanReport;
1729
- //# sourceMappingURL=multiScanReport.js.map