From 9ab83efedc0f952a05bd4d4b555c5ec823b4aa7f Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Thu, 16 Jan 2025 14:05:52 +0000 Subject: [PATCH] rep defect 41 update final comments in line --- components/pdftemplates/finalComments_pdf.js | 81 +++++++++++++++++--- 1 file changed, 70 insertions(+), 11 deletions(-) diff --git a/components/pdftemplates/finalComments_pdf.js b/components/pdftemplates/finalComments_pdf.js index be300697..64edec6f 100644 --- a/components/pdftemplates/finalComments_pdf.js +++ b/components/pdftemplates/finalComments_pdf.js @@ -1,20 +1,17 @@ -import ReactPDF, { +import { Document, + Image, Page, + StyleSheet, Text, View, - Image, - StyleSheet, - PDFViewer, Font, } from "@react-pdf/renderer"; -import { createElement } from "react"; import Html from "react-pdf-html"; import { getFormCollectionByID, bytesToSize } from "../../components/utils"; import transLookupCY from "../../locales/cy/myrepresentations.json"; import transLookupEN from "../../locales/en/myrepresentations.json"; -import { JSONPath as jsonpath } from "jsonpath-plus"; const getTrans = (locale, key) => { let jsonQuery = `$.${key}`; @@ -56,6 +53,28 @@ const styles = StyleSheet.create({ paddingLeft: 10, backgroundColor: "white", }, + questionAnswerSmall: { + color: "#757575", + width: "300", + fontSize: 12, + padding: 5, + border: 1, + borderColor: "#eee", + paddingLeft: 10, + paddingRight: 10, + backgroundColor: "white", + marginRight: 10, + }, + questionAnswerSmaller: { + color: "#757575", + width: "90", + fontSize: 12, + padding: 5, + border: 1, + borderColor: "#eee", + paddingLeft: 10, + backgroundColor: "white", + }, questionAnswerMid: { color: "#757575", width: "20%", @@ -242,7 +261,7 @@ export const finalComments_pdf = ({ docProps }) => { {CleanHTML( values.conditional_representationCapacity_Comments - )} + ) || "N/A"} @@ -443,7 +462,7 @@ export const finalComments_pdf = ({ docProps }) => { }} > {getTrans( docProps.locale, @@ -451,7 +470,18 @@ export const finalComments_pdf = ({ docProps }) => { )} : - + {values.firstname} {values.lastname} @@ -462,14 +492,20 @@ export const finalComments_pdf = ({ docProps }) => { alignItems: "center", }} > - + {getTrans( docProps.locale, "statement-date-label" )} : - + {signedDate} @@ -482,6 +518,7 @@ export const finalComments_pdf = ({ docProps }) => { style={{ flexDirection: "row", marginBottom: 10, + alignItems: "center", }} > { : ""} + ) : values.hasOwnProperty("onBehalfOfLPA") ? ( + + + {getTrans( + docProps.locale, + "statement-onbehalf-label" + )} + : + + + {values.onBehalfOfLPA} + + ) : ( )}