From a8157332564aadfa5833a069c67372fdb0b9afd5 Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Tue, 20 Aug 2024 23:13:37 +0300 Subject: [PATCH] Fixups --- ...t-identifier-sticker-content.component.tsx | 15 +-- .../print-identifier-sticker.modal.tsx | 114 +++++++++--------- .../banner-tags/print-identifier-sticker.scss | 2 +- .../translations/en.json | 10 +- 4 files changed, 72 insertions(+), 69 deletions(-) diff --git a/packages/esm-patient-banner-app/src/banner-tags/print-identifier-sticker-content.component.tsx b/packages/esm-patient-banner-app/src/banner-tags/print-identifier-sticker-content.component.tsx index e56d75d759..710ca77098 100644 --- a/packages/esm-patient-banner-app/src/banner-tags/print-identifier-sticker-content.component.tsx +++ b/packages/esm-patient-banner-app/src/banner-tags/print-identifier-sticker-content.component.tsx @@ -1,21 +1,18 @@ -import React, { forwardRef } from 'react'; +import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react'; import { useConfig } from '@openmrs/esm-framework'; import { type ConfigObject } from '../config-schema'; -import styles from './print-identifier-sticker-content.scss'; import IdentifierSticker from './print-identifier-sticker.component'; -import { useImperativeHandle } from 'react'; -import { useRef } from 'react'; -import { useEffect } from 'react'; +import styles from './print-identifier-sticker-content.scss'; interface PrintIdentifierStickerContentProps { - numberOfLabelRowsPerPage: number; - numberOfLabelColumns: number; labels: Array<{}>; + numberOfLabelColumns: number; + numberOfLabelRowsPerPage: number; patient: fhir.Patient; } const PrintIdentifierStickerContent = forwardRef( - ({ numberOfLabelRowsPerPage, numberOfLabelColumns, labels, patient }, ref) => { + ({ labels, numberOfLabelColumns, numberOfLabelRowsPerPage, patient }, ref) => { const { printIdentifierStickerWidth, printIdentifierStickerHeight, printIdentifierStickerPaperSize } = useConfig(); const divRef = useRef(); @@ -32,10 +29,10 @@ const PrintIdentifierStickerContent = forwardRef void; @@ -61,45 +61,62 @@ const PrintIdentifierStickerModal: React.FC = closeModal={closeModal} title={getCoreTranslation('printIdentifierSticker', 'Print identifier sticker')} /> - - ) => - setNumberOfLabelColumns(parseInt(event.target.value || '1')) - } - value={numberOfLabelColumns} - hideSteppers={true} - /> - ) => - setNumberOfLabelRowsPerPage(parseInt(event.target.value || '1')) - } - value={numberOfLabelRowsPerPage} - hideSteppers={true} - /> - ) => - setNumberOfLabels(parseInt(event.target.value || '1')) - } - value={numberOfLabels} - hideSteppers={true} - /> -
- - - - -
+ + + ) => + setNumberOfLabelColumns(parseInt(event.target.value || '1')) + } + value={numberOfLabelColumns} + /> + ) => + setNumberOfLabelRowsPerPage(parseInt(event.target.value || '1')) + } + value={numberOfLabelRowsPerPage} + /> + ) => + setNumberOfLabels(parseInt(event.target.value || '1')) + } + value={numberOfLabels} + /> +
+ + + + +
+
+
+ +
+
+
-
-
- -
-
); }; diff --git a/packages/esm-patient-banner-app/src/banner-tags/print-identifier-sticker.scss b/packages/esm-patient-banner-app/src/banner-tags/print-identifier-sticker.scss index 5235e2744c..a8cc055584 100644 --- a/packages/esm-patient-banner-app/src/banner-tags/print-identifier-sticker.scss +++ b/packages/esm-patient-banner-app/src/banner-tags/print-identifier-sticker.scss @@ -54,7 +54,7 @@ max-height: 10rem; overflow-y: scroll; background-color: white; - width: 96%; + width: 100%; border: 1px solid $ui-03; margin-left: auto; margin-right: auto; diff --git a/packages/esm-patient-banner-app/translations/en.json b/packages/esm-patient-banner-app/translations/en.json index 0b6e5127ac..f177cb1283 100644 --- a/packages/esm-patient-banner-app/translations/en.json +++ b/packages/esm-patient-banner-app/translations/en.json @@ -7,13 +7,13 @@ "countyDistrict": "District", "district": "District", "dob": "DOB", - "hidePreview": "Hide Preview", - "numberOfLabelColumns": "Number of patient Id sticker columns", - "numberOfLabelRowsPerPage": "Number of patient Id sticker rows per page", - "numberOfLabels": "Number of patient Id stickers", + "hidePreview": "Hide preview", + "numberOfLabelColumns": "No. of patient ID sticker columns", + "numberOfLabelRowsPerPage": "No. of patient ID sticker rows per page", + "numberOfLabels": "No. of patient ID stickers", "patientIdentifierSticker": "Patient identifier sticker", "postalCode": "Postal code", - "preview": "Preview", + "showPreview": "Show preview", "state": "State", "stateProvince": "State" }