diff --git a/frontend/src/components/workplan/TestSelectForm.js b/frontend/src/components/workplan/TestSelectForm.js index c0278733c6..04540bf02e 100644 --- a/frontend/src/components/workplan/TestSelectForm.js +++ b/frontend/src/components/workplan/TestSelectForm.js @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from "react"; import { Column, Grid, Select, SelectItem } from "@carbon/react"; -import { FormattedMessage, injectIntl } from "react-intl"; +import { FormattedMessage, injectIntl, useIntl } from "react-intl"; import "../Style.css"; import { getFromOpenElisServer } from "../utils/Utils"; @@ -20,13 +20,15 @@ function TestSelectForm(props) { } }; + const intl = useIntl(); + useEffect(() => { mounted.current = true; let testId = new URLSearchParams(window.location.search).get("testId"); testId = testId ? testId : ""; getFromOpenElisServer("/rest/tests", (fetchedTests) => { let test = fetchedTests.find((test) => test.id === testId); - let testLabel = test ? test.value : ""; + let testLabel = test ? test.value : intl.formatMessage({id:"input.placeholder.selectTest"}); setDefaultTestId(testId); setDefaultTestLabel(testLabel); props.value(testId, testLabel); @@ -66,4 +68,4 @@ function TestSelectForm(props) { ); } -export default injectIntl(TestSelectForm); +export default injectIntl(TestSelectForm); \ No newline at end of file diff --git a/frontend/src/components/workplan/WorkplanSearchForm.js b/frontend/src/components/workplan/WorkplanSearchForm.js index a6fdd170bf..16780b5426 100644 --- a/frontend/src/components/workplan/WorkplanSearchForm.js +++ b/frontend/src/components/workplan/WorkplanSearchForm.js @@ -152,7 +152,7 @@ export default function WorkplanSearchForm(props) { {selectedLabel && (
-

  {selectedLabel}

+

 

)}
diff --git a/frontend/src/languages/en.json b/frontend/src/languages/en.json index c68cb90264..353bebc35d 100644 --- a/frontend/src/languages/en.json +++ b/frontend/src/languages/en.json @@ -1,5 +1,4 @@ { - "language.select.label": "English", "label.button.submit": "Submit", "label.button.changepassword": "Change Password", @@ -761,5 +760,6 @@ "input.placeholder.requesterLastName":"Enter Requester's Last Name", "input.placeholder.providerWorkPhone":"Enter Requester's Phone Number", "input.placeholder.providerFax":"Enter Requester's Fax Number", - "input.placeholder.providerEmail":"Enter Requester's Email" + "input.placeholder.providerEmail":"Enter Requester's Email", + "input.placeholder.selectTest":"Select Test Type" } diff --git a/frontend/src/languages/fr.json b/frontend/src/languages/fr.json index be101b5094..0eff903596 100644 --- a/frontend/src/languages/fr.json +++ b/frontend/src/languages/fr.json @@ -1,4 +1,3 @@ - { "language.select.label": "French", "label.button.submit": "Connecter", @@ -708,5 +707,6 @@ "input.placeholder.requesterLastName":"Saisir le nom de famille du demandeur", "input.placeholder.providerWorkPhone":"Saisir le numéro de téléphone du demandeur", "input.placeholder.providerFax":"Saisir le numéro de fax du demandeur", - "input.placeholder.providerEmail":"Saisir l'adresse e-mail du demandeur" + "input.placeholder.providerEmail":"Saisir l'adresse e-mail du demandeur", + "input.placeholder.selectTest":"Sélectionnez le type de test" }