Skip to content

Commit

Permalink
Merge pull request #633 from jona42-ui/tj/order
Browse files Browse the repository at this point in the history
(feat)Add missing translations to the order component
  • Loading branch information
mozzy11 authored Dec 6, 2023
2 parents 20ad34b + c4164c7 commit 7c39bf8
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 28 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/addOrder/AddOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ const AddOrder = (props) => {
<div className="inlineDiv">
<CustomDatePicker
id={"order_requestDate"}
labelText={"Request Date"}
labelText={<FormattedMessage id="sample.requestDate" />}
autofillDate={true}
value={orderFormValues.sampleOrderItems.requestDate}
className="inputDate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ const OrderEntryAdditionalQuestions = ({
<>
<Stack gap={10}>
<div className="orderLegendBody">
<h3>Program</h3>
<h3>
<FormattedMessage id="select.program" />
</h3>
<ProgramSelect programChange={handleProgramSelection} />
<Questionnaire
questionnaire={questionnaire}
Expand Down
25 changes: 14 additions & 11 deletions frontend/src/components/addOrder/OrderReferralRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import UserSessionDetailsContext from "../../UserSessionDetailsContext";
import CustomTextInput from "../common/CustomTextInput";
import CustomSelect from "../common/CustomSelect";
import CustomDatePicker from "../common/CustomDatePicker";
import { useIntl } from "react-intl";

function requiredSymbol(value) {
return (
Expand All @@ -21,17 +22,6 @@ function requiredSymbol(value) {
);
}

const header = [
{ key: "reason", header: requiredSymbol("Reason for Referral") },
{ key: "referrer", header: "Referrer" },
{
key: "institute",
header: requiredSymbol("Institute"),
},
{ key: "", header: "Sent Date\n" + "(dd/mm/yyyy)" },
{ key: "name", header: requiredSymbol("Test Name") },
];

const OrderReferralRequest = ({
index,
selectedTests,
Expand All @@ -40,6 +30,7 @@ const OrderReferralRequest = ({
referralRequests,
setReferralRequests,
}) => {
const intl = useIntl();
const [referralRows, setReferralRows] = useState([]);
const { userSessionDetails } = useContext(UserSessionDetailsContext);

Expand Down Expand Up @@ -69,6 +60,18 @@ const OrderReferralRequest = ({
}
}

const header = [
{ key: "reason", header: requiredSymbol(intl.formatMessage({ id: "referral.label.reason"})) },
{ key: "referrer", header: intl.formatMessage({ id: "referrer.label" })},
{
key: "institute",
header: requiredSymbol(intl.formatMessage({ id: "referral.label.institute"})),
},
{ key: "", header:intl.formatMessage({ id: "referral.label.sentdate"}) + "\n" + "(dd/mm/yyyy)" },
{ key: "name", header: requiredSymbol(intl.formatMessage({ id: "search.label.test" })) },

];

const updateUIRender = () => {
const rows = [];
let obj = {};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/addOrder/OrderResultReporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const RequesterEmailAndSMS = (testId, index, handleRequesterEmailAndSMS) => {
<CustomCheckBox
id={"providerEmail_" + index + "_" + testId}
onChange={(checked) => handleProviderEmail(checked)}
label="Email"
label={<FormattedMessage id="provider.email"/>}
/>
<CustomCheckBox
id={"providerSMS_" + index + "_" + testId}
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/components/addOrder/OrderSuccessMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Button, Row } from "@carbon/react";
import config from "../../config.json";
import { SampleOrderFormValues } from "../formModel/innitialValues/OrderEntryFormValues";
import { sampleObject } from "./Index";
import { FormattedMessage } from "react-intl";

const OrderSuccessMessage = (props) => {
const { orderFormValues, setOrderFormValues, setSamples, setPage } = props;
Expand Down Expand Up @@ -64,10 +65,12 @@ const OrderSuccessMessage = (props) => {
width="120"
height="120"
/>
<h4>Save successful</h4>
<h4>
<FormattedMessage id="save.success"/>
</h4>
<Row>
<Button className="" onClick={handlePrintBarCode}>
Print Barcode
<FormattedMessage id="print.barcode"/>
</Button>
</Row>
<Row>
Expand All @@ -77,7 +80,7 @@ const OrderSuccessMessage = (props) => {
kind="tertiary"
onClick={handleAnotherSiteOrder}
>
Place same site order
<FormattedMessage id="request.samesite.order"/>
</Button>
)}
</Row>
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/addOrder/SampleType.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ const SampleType = (props) => {
<Search
size="lg"
id={`panels_search_` + index}
labelText={"Search Available panel"}
placeholder={"Choose Available panel"}
labelText={<FormattedMessage id="label.search.availablepanel"/>}
placeholder={<FormattedMessage id="choose.availablepanel"/>}
onChange={handlePanelSearchChange}
value={(() => {
if (panelSearchTerm) {
Expand Down Expand Up @@ -612,12 +612,12 @@ const SampleType = (props) => {
<></>
)}
</div>
<FormGroup legendText={"Search through the available tests"}>
<FormGroup legendText={<FormattedMessage id="legend.search.availabletests"/>}>
<Search
size="lg"
id={`tests_search_` + index}
labelText={"Search Available Test"}
placeholder={"Choose Available test"}
labelText={<FormattedMessage id="label.search.available.targetest"/>}
placeholder={<FormattedMessage id="holder.choose.availabletest"/>}
onChange={handleTestSearchChange}
value={(() => {
if (testSearchTerm) {
Expand Down Expand Up @@ -650,7 +650,7 @@ const SampleType = (props) => {
<Layer>
<Tile className={"emptyFilterTests"}>
<span>
No test found matching
<FormattedMessage id="title.notestfoundmatching"/>
<strong> "{testSearchTerm}"</strong>{" "}
</span>
</Tile>
Expand Down Expand Up @@ -679,7 +679,7 @@ const SampleType = (props) => {
<div className="requestTestReferral">
<Checkbox
id={`useReferral_` + index}
labelText="Refer test to a reference lab"
labelText={<FormattedMessage id="label.refertest.referencelab"/>}
onChange={handleReferralRequest}
/>
{requestTestReferral === true && (
Expand Down
20 changes: 16 additions & 4 deletions frontend/src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,6 @@
"requester.label": "Requester",
"search.patient.label": "Search for Patient",
"referral.testresult.pastnote":"Past Notes",
"referral.label.sentdate":"Sent Date",
"referral.label.reason":"Referral Reason",
"referral.label.testtoperform":"Test to Perform",
"new.patient.label": "New Patient",
"sample.select.type": "Select sample type",
"sample.reject.label": "Reject Sample",
Expand Down Expand Up @@ -525,5 +522,20 @@
"banner.menu.resultvalidation_study": "Study",
"reports.followupRequired.byLocation": "Follow-up Required",
"button.label.loadnext": "Load Next Bundle",
"button.label.loadprevious": "Load Previous Bundle"
"button.label.loadprevious": "Load Previous Bundle",
"sample.requestDate": "Request Date",
"select.program": "Program",
"referrer.label":"referrer",
"provider.email": "Email",
"print.barcode":"Print Barcode",
"save.success":"Save successful",
"request.samesite.order":"Place same site order",
"label.search.availablepanel":"Search Available panel",
"choose.availablepanel":"Choose Available panel",
"legend.search.availabletests":"Search through the available tests",
"label.search.available.targetest":"Search Available Tests",
"holder.choose.availabletest":"Choose Available Test",
"title.notestfoundmatching":"No test Found Matching",
"label.refertest.referencelab":"Refer test to a reference lab"

}
14 changes: 14 additions & 0 deletions frontend/src/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@
"quick.entry.accession.number":"N° Labo",
"patient.subject.number":"Sujet No.",
"referral.testresult.pastnote":"Notes passées",
"referrer.label":"Référent",
"sample.entry.nextVisit.date":"Date de rendez vous",
"sample.entry.project.testName":"Nom du Test",
"sample.receivedDate":"Date de réception",
"sample.requestDate":"Date de la demande",
"select.program": "Programme",
"provider.email":"E-mail",
"label.total.tests":"Analyse au total",
"result.nonconforming.item":"L'échantillon ou l'ordonnance est non conforme OU le test a été rejetée",
"sample.entry.project.patient.and.testName":"Noms et/ou Numéro d'identité National \n Nom du Test",
Expand Down Expand Up @@ -377,6 +381,16 @@
"search.label.loadnext" : "Charger les 99 enregistrements suivants à partir du numéro de laboratoire",
"search.label.analysis" : "Sélectionnez l'état de l'analyse",
"search.label.test" : "Sélectionnez le nom du test",
"save.success": "Sauver succès",
"print.barcode":"Imprimer le code-barres",
"request.samesite.order":"Passer la commande sur le même site",
"label.search.availablepanel":"Panneau de recherche disponible",
"choose.availablepanel":"Choisir le panneau disponible",
"legend.search.availabletests":"Rechercher parmi les tests disponibles",
"label.search.available.targetest":"Rechercher les tests disponibles",
"holder.choose.availabletest":"Choisissez le test disponible",
"title.notestfoundmatching":"Aucun test trouvé correspondant",
"label.refertest.referencelab":"Référer le test à un laboratoire de référence",
"search.label.sample" : "Sélectionnez l'état de l'échantillon",
"pathology.label.report": "Rapport de Pathologie",
"patient.nationalid": "Identifiant National",
Expand Down

0 comments on commit 7c39bf8

Please sign in to comment.