Skip to content

Commit

Permalink
Merge pull request #739 from PR4NJ41/develop_3x
Browse files Browse the repository at this point in the history
Guiding text added to select element in TestSelectForm.js
  • Loading branch information
mozzy11 authored Mar 21, 2024
2 parents 07fed38 + 96b0632 commit 01d3a0a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions frontend/src/components/workplan/TestSelectForm.js
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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);
Expand Down Expand Up @@ -66,4 +68,4 @@ function TestSelectForm(props) {
);
}

export default injectIntl(TestSelectForm);
export default injectIntl(TestSelectForm);
2 changes: 1 addition & 1 deletion frontend/src/components/workplan/WorkplanSearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default function WorkplanSearchForm(props) {
<Column lg={16} md={8} sm={4}>
{selectedLabel && (
<Section>
<h4 className="contentHeader1">&nbsp; {selectedLabel} </h4>
<h4 className="contentHeader1">&nbsp;</h4>
</Section>
)}
</Column>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/languages/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{

"language.select.label": "English",
"label.button.submit": "Submit",
"label.button.changepassword": "Change Password",
Expand Down Expand Up @@ -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"
}
4 changes: 2 additions & 2 deletions frontend/src/languages/fr.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"language.select.label": "French",
"label.button.submit": "Connecter",
Expand Down Expand Up @@ -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"
}

0 comments on commit 01d3a0a

Please sign in to comment.