@measurequick/measurequick-report-generator 1.2.2 → 1.2.3
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.
- package/package.json +1 -1
- package/report-gen-scripts/photos-report.js +4 -5
- package/util.js +2 -4
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@ export async function getReport(payload) { console.log("Photos Report"); console
|
|
|
26
26
|
for (let i = 0; i < pageCount; i++) {
|
|
27
27
|
const doc = await PDFDocument.load(util._base64ToArrayBuffer(page.base64));
|
|
28
28
|
const form = doc.getForm();
|
|
29
|
-
form.getTextField("Header").setText(`${util.
|
|
29
|
+
form.getTextField("Header").setText(`${util.capitalizeFirstLetter(keys[k])} Photos`);
|
|
30
30
|
const mqLogoBytes = util._base64ToArrayBuffer(base64.mqLogo);
|
|
31
31
|
const mqLogo = await doc.embedPng(mqLogoBytes);
|
|
32
32
|
form.getButton("FullWidthLogo").setImage(mqLogo);
|
|
@@ -47,10 +47,9 @@ export async function getReport(payload) { console.log("Photos Report"); console
|
|
|
47
47
|
else if (photo.includes("image/png")) image = await doc.embedPng(util._base64ToArrayBuffer(photo));
|
|
48
48
|
if (image) form.getButton(`photo${size}${j}`).setImage(image);
|
|
49
49
|
let firstPhoto = (lastTag != currentTag);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
50
|
+
let notes = payload.photos[keys[k]][sections[sectionNum]].name;
|
|
51
|
+
if (payload.photos[keys[k]][sections[sectionNum]].hasNotes && firstPhoto) notes += ": " + payload.photos[keys[k]][sections[sectionNum]].notes;
|
|
52
|
+
form.getTextField(`Notes${j}`).setText(`${notes}`);
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
}
|
package/util.js
CHANGED
|
@@ -35,10 +35,8 @@ export function getColorFromGrade(grade) {
|
|
|
35
35
|
else return "Red";
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export function
|
|
39
|
-
|
|
40
|
-
// properNoun = improperNoun.CAPITALIZE_FIRST_LETTER();
|
|
41
|
-
return properNoun;
|
|
38
|
+
export function capitalizeFirstLetter(string) {
|
|
39
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
export function getToolIcon(test, ref, embeddedIcons) {
|