ebta-workflow-prod 4.0.10 → 4.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ebta-workflow-prod",
3
3
  "private": false,
4
- "version": "4.0.10",
4
+ "version": "4.0.12",
5
5
  "description": "",
6
6
  "license": "UNLICENSED",
7
7
  "author": "",
@@ -571,18 +571,19 @@ export default class PDFMapGeneratorActivity implements IActivityHandler {
571
571
  const revField = form.getTextField('Rev.' + i)
572
572
  revField.setText(inputs.Rev)
573
573
  revField.updateAppearances(font)
574
- if (inputs.template=='VMP'){
575
- //supervisor
576
- const supervisorField = form.getTextField('Supervisor')
577
- supervisorField.setText(inputs.extraField['supervisor'])
578
- supervisorField.setAlignment(TextAlignment.Center)
579
- supervisorField.updateAppearances(font)
580
- //UHF
581
- const uhfField = form.getTextField('UHF')
582
- uhfField.setText(inputs.extraField['UHF'])
583
- uhfField.setAlignment(TextAlignment.Center)
584
- uhfField.updateAppearances(font)
585
- }
574
+ if (inputs.template == 'VMP') {
575
+ //supervisor
576
+ const supervisorField = form.getTextField('Supervisor')
577
+ supervisorField.setText(inputs.extraField['supervisor'])
578
+ supervisorField.setAlignment(TextAlignment.Center)
579
+ supervisorField.updateAppearances(font)
580
+ //UHF
581
+ const uhfField = form.getTextField('UHF')
582
+ uhfField.setText(inputs.extraField['UHF'])
583
+ uhfField.setAlignment(TextAlignment.Center)
584
+ uhfField.updateAppearances(font)
585
+ console.log('VMP text inserted successful')
586
+ }
586
587
  //date
587
588
  const today = new Date();
588
589
  const formattedDate = today.toLocaleDateString('en-AU');
@@ -611,24 +612,26 @@ export default class PDFMapGeneratorActivity implements IActivityHandler {
611
612
  }
612
613
  }
613
614
  console.log('Text Fields removal successful')
614
- //draw a QR Code image only when Qr URL is given && QR image not given
615
615
  const boldFont = await doc.embedFont(StandardFonts.HelveticaBold);
616
-
616
+ console.log('bold font embed successful')
617
617
  if (inputs.template == 'VMP') {
618
+ console.log('start to put text1 in VMP')
618
619
  newPage.drawText('Maximum Speed 10KM/h within Work Area', {
619
- x: 28+150,
620
+ x: (28 + 150),
620
621
  y: 145,
621
622
  size: 10.5,
622
- color: rgb(255, 255, 255), // White color
623
- font: boldFont,
623
+ color: rgb(1, 1, 1), // White color, IGNORE VSCODE COLOR
624
+ font: font,
624
625
  });
626
+ console.log('start to put text2 in VMP')
625
627
  newPage.drawText('Maximum Speed 10KM/h within Work Area', {
626
- x: 28+151,
628
+ x: (28 + 151),
627
629
  y: 145,
628
630
  size: 10,
629
- color: rgb(255, 0, 0), // red color
631
+ color: rgb(1, 0, 0), // red color, IGNORE VSCODE COLOR
630
632
  font: boldFont,
631
633
  });
634
+ console.log('speed limit text inserted')
632
635
  }
633
636
 
634
637
  if (inputs.buttonLink && inputs.buttonLink.length > 0) {
@@ -645,20 +648,18 @@ export default class PDFMapGeneratorActivity implements IActivityHandler {
645
648
  width: buttonW,
646
649
  height: buttonH,
647
650
  });
648
-
651
+
649
652
  newPage.drawText('Go to EBTA GIS', {
650
653
  x: buttonX + 5,
651
654
  y: buttonY + 22,
652
655
  size: 10,
653
- color: rgb(1, 1, 1), // White color
656
+ color: rgb(1, 1, 1), // White color, VS CODE COLOR PICKER IS WRONG
654
657
  font: boldFont,
655
658
  });
656
659
 
657
-
658
660
  const existingAnnots = newPage.node.lookup(PDFName.of('Annots'));
659
661
  let annotationsArray = existingAnnots instanceof PDFArray ? existingAnnots : doc.context.obj([]);
660
662
 
661
-
662
663
  const linkAnnotation = doc.context.register(
663
664
  doc.context.obj({
664
665
  Type: 'Annot',
@@ -676,8 +677,11 @@ export default class PDFMapGeneratorActivity implements IActivityHandler {
676
677
  annotationsArray.push(linkAnnotation);
677
678
  // Set the updated annotations array back to the page
678
679
  newPage.node.set(PDFName.of('Annots'), annotationsArray);
680
+ console.log('EBTA button inserted')
679
681
  }
680
682
 
683
+
684
+ //draw a QR Code image only when Qr URL is given && QR image not given
681
685
  if (inputs.QrUrl && inputs.QrUrl.length > 0 && (inputs.QrCodeImage == undefined)) {
682
686
  //QR Code
683
687
  // eslint-disable-next-line @typescript-eslint/no-var-requires