Unverified Commit 648f8705 authored by ggrund-tsi's avatar ggrund-tsi Committed by GitHub
Browse files

Fix/update localstorage (#84)



* manually set value to undefined for not required fields/comboboxes

* handle optionals
Co-authored-by: default avatarfOppenheimer <Fatma.Krueger@T-Systems.com>
Co-authored-by: default avatarGordon Grund <gordon.grund@outlook.de>
parent 544f269e
......@@ -80,7 +80,7 @@ export const FormGroupValueSetSelect = (props: any) => {
placeholder={props.placeholder ? props.placeholder : props.title}
required={props.required}
>
<option disabled={props.required} key={0} value={props.required ? '' : undefined} >{props.placeholder ? props.placeholder : props.title}</option>
<option disabled={props.required} key={0} value=''>{props.placeholder ? props.placeholder : props.title}</option>
{options}
</Form.Control>
</Col>
......
......@@ -258,7 +258,7 @@ const usePdfGenerator = (qrCodeCanvasElementProp: any, eudgcProp: EUDGC | undefi
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [qrCodeCanvasElement, ci, isInit, eudgc]);
React.useEffect(() => {
if (co && isInit && eudgc) {
prepareFirstPage();
......@@ -733,7 +733,7 @@ const usePdfGenerator = (qrCodeCanvasElementProp: any, eudgcProp: EUDGC | undefi
y = printVerticalBlock(x, y,
t('translation:pdfTestName'),
french.translation.pdfTestName,
testSet.nm ? testSet.nm : ' ',
testSet.nm,
lineHeight, true);
y = printVerticalBlock(x, y,
......@@ -751,7 +751,7 @@ const usePdfGenerator = (qrCodeCanvasElementProp: any, eudgcProp: EUDGC | undefi
y = printVerticalBlock(x, y,
t('translation:pdfDateTestResult'),
french.translation.pdfDateTestResult,
convertDateToOutputFormat(testSet.dr ? testSet.dr : ' '),
testSet.dr ? convertDateToOutputFormat(testSet.dr) : '',
lineHeight, true);
y = printVerticalBlock(x, y,
......@@ -997,7 +997,7 @@ const usePdfGenerator = (qrCodeCanvasElementProp: any, eudgcProp: EUDGC | undefi
let result = y;
lineHeight = lineHeight ? lineHeight : params.lineHeight;
if (value && pdf) {
if (pdf) {
pdf.setFont('arial', 'bold');
lbl = pdf.splitTextToSize(lbl, lblLength);
pdf.text(lbl, x, y);
......@@ -1010,11 +1010,15 @@ const usePdfGenerator = (qrCodeCanvasElementProp: any, eudgcProp: EUDGC | undefi
pdf.text(frenchText, x, y);
y += lineHeight * frenchText.length;
pdf.setFont('arial', 'normal');
const valueText = pdf.splitTextToSize(value, lblLength);
pdf.text(valueText, x, y);
if (value) {
pdf.setFont('arial', 'normal');
const valueText = pdf.splitTextToSize(value, lblLength);
pdf.text(valueText, x, y);
y += lineHeight * valueText.length;
}
result = y + lineHeight * valueText.length + mm2point(2);
result = y + mm2point(2);
}
return result;
......
......@@ -118,7 +118,6 @@ const RecordTestCertData = (props: any) => {
setTestDateTime(date);
}
const handleDateTimeChange = (evt: Date | [Date, Date] | null) => {
let date: Date;
......@@ -147,8 +146,8 @@ const RecordTestCertData = (props: any) => {
const test: TestEntry = {
tg: disease,
tt: testType,
nm: testName,
ma: testManufacturers,
nm: testName ? testName : undefined,
ma: testManufacturers ? testManufacturers : undefined,
sc: sampleDateTime!.toISOString(),
dr: testDateTime ? testDateTime.toISOString() : undefined,
tr: testResult,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment