diff --git a/src/components/modal/InspectionScheduleModal.tsx b/src/components/modal/InspectionScheduleModal.tsx index 9df24f85676636f6e08d1d6acf321b9a4fb91fab..955147c472f7676dd975fde8c86010fda2b4edd2 100644 --- a/src/components/modal/InspectionScheduleModal.tsx +++ b/src/components/modal/InspectionScheduleModal.tsx @@ -7,7 +7,7 @@ import { SelectField, TextField } from "../form-elements"; import { BtnOne } from "../buttons"; import { HeadingFive } from "../headings"; import moment from "moment"; -import { APP } from "../../constants"; +import { APP, LANG } from "../../constants"; import { ReviewService } from "../../services"; import Notify from "../../helpers/notify"; import { useHistory } from "react-router-dom"; @@ -322,7 +322,7 @@ export const InspectionScheduleModal = ({ ReviewService.assignToInspection(payload).then( (response) => { if (response.statusInfo.statusCode === APP.CODE.SUCCESS) { - Notify.success("Sent for inspection."); + Notify.success(`${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}.`); history.push(APP.ROUTES.DASHBOARD); setCuratedAssitingInspectors([]); setCuratedLeadInspectors([]); diff --git a/src/components/modal/ModalOne.tsx b/src/components/modal/ModalOne.tsx index 77bd0c4ac8e992b10d0cd62e91ea0e38cc80fe29..5769ac7a44d8890561c85ec91a06578e831d1ada 100644 --- a/src/components/modal/ModalOne.tsx +++ b/src/components/modal/ModalOne.tsx @@ -20,7 +20,7 @@ export const ModalOne = ({ heading, list, id, ariaLabel }: ModalOneProps) => { let formatedStatus = ""; switch (status) { case LANG.FORM_STATUS.INSPECTION_COMPLETED: - formatedStatus = "Inspection completed"; + formatedStatus = `${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`; break; case LANG.FORM_STATUS.RETURNED: formatedStatus = "Returned"; @@ -47,7 +47,7 @@ export const ModalOne = ({ heading, list, id, ariaLabel }: ModalOneProps) => { formatedStatus = "Unpublished"; break; case LANG.FORM_STATUS.SENT_FOR_INSPECTION: - formatedStatus = "Sent for inspection"; + formatedStatus = `${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`; break; default: formatedStatus = ""; diff --git a/src/components/status-bar/StatusBar.tsx b/src/components/status-bar/StatusBar.tsx index 51a621bd1d1c9b0ad4c1b1ec5bdbc960212cca55..1a10b9354cf79b855652c1100e798d2193563ed7 100644 --- a/src/components/status-bar/StatusBar.tsx +++ b/src/components/status-bar/StatusBar.tsx @@ -41,12 +41,12 @@ export const StatusBar = ({ label, status }: StatusBarProps) => { {status && status === LANG.FORM_STATUS.SENT_FOR_INSPECTION && ( <label className={`${styles.status_two_label} px-3 m-0`} - >{`Status: Sent for inspection`}</label> + >{`Status: ${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`}</label> )} {status && status === LANG.FORM_STATUS.INSPECTION_COMPLETED && ( <label className={`${styles.status_one_label} px-3 m-0`} - >{`Status: Inspection completed`}</label> + >{`Status: ${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`}</label> )} {status && status === LANG.FORM_STATUS.APPROVED && ( <label diff --git a/src/components/status-bar/StatusBarLarge.tsx b/src/components/status-bar/StatusBarLarge.tsx index 3f92338bad130fdc991d331dc14f2fb0f1164beb..0ebfc04f0080995ac3aa9ea2a5f1881b43cdfc21 100644 --- a/src/components/status-bar/StatusBarLarge.tsx +++ b/src/components/status-bar/StatusBarLarge.tsx @@ -72,14 +72,14 @@ export const StatusBarLarge = ({ <div className={`${styles.status_bar_large_indicator} text-center mx-3 mt-3 ${styles.status_bar_large_amber}`} > - <label>{`Status: Sent for inspection`}</label> + <label>{`Status: ${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`}</label> </div> )} {status === LANG.FORM_STATUS.INSPECTION_COMPLETED && ( <div className={`${styles.status_bar_large_indicator} text-center mx-3 mt-3 ${styles.status_bar_large_green}`} > - <label>{`Status: Inspection completed`}</label> + <label>{`Status: ${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`}</label> </div> )} {status === LANG.FORM_STATUS.APPROVED && ( @@ -134,7 +134,7 @@ export const StatusBarLarge = ({ </> )} {label && label === LANG.FORM_STATUS.INSPECTION_COMPLETED && ( - <p className="text-center pt-3">Inspection completed!</p> + <p className="text-center pt-3">{`${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`}!</p> )} {label && label === LANG.FORM_STATUS.APPROVED && ( <p className="text-center pt-3"> diff --git a/src/constants/LangConstants.ts b/src/constants/LangConstants.ts index 42189d3f6a686baaabcbcbf3adba198c6a188960..7de3d5a506565d307983a2e195b411f827d0007b 100644 --- a/src/constants/LangConstants.ts +++ b/src/constants/LangConstants.ts @@ -54,4 +54,9 @@ export const LANG = { CONFIRM_TO_REMOVE: "Confirm to remove", HEADING_REMOVAL_WARNING: "Are you sure deleting the header?", CONFIRM_TO_REMOVE_2: "This action will move the question section to the general header category.", + FORM_STATUS_TEXT: { + SENT_FOR_INSPECTION:"Sent for assessment", + INSPECTION_COMPLETED: "Assessment completed", + }, + SEND_FOR_INSPECTION:"Send for assessment" }; diff --git a/src/layouts/Inspector/FormView.tsx b/src/layouts/Inspector/FormView.tsx index cf640c56ef5d1ec146807b348ce2f577ceafd198..fd33fe4d6d612f5f8d16992e54369102ac4019bc 100644 --- a/src/layouts/Inspector/FormView.tsx +++ b/src/layouts/Inspector/FormView.tsx @@ -26,6 +26,7 @@ import { dataObjectFileUpload as dataObjectFileUploadAtom, } from "../../states/atoms"; import { useHistory } from "react-router-dom"; +import { LANG } from "../../constants"; /** * FormView component renders @@ -2497,7 +2498,7 @@ export const FormView = ({ applicationData, formData }: FormViewProps) => { /> ) : enableInspectioComplete ? ( <BtnTwo - label="Inspection completed" + label={`${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`} btnType="button" isLink={true} link={`/inspection-summary/${formData.id}/${applicationData.applicationId}`} @@ -2513,7 +2514,7 @@ export const FormView = ({ applicationData, formData }: FormViewProps) => { className={`${btnStylesTwo.btn_two_disabled}`} disabled={true} > - Inspection completed + {`${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`} </button> )} </div> diff --git a/src/layouts/Inspector/InspectionCompleteLayout.tsx b/src/layouts/Inspector/InspectionCompleteLayout.tsx index 992c0c406f1bcbb3d8f0817f040a4f8cb7f98d3b..bebda789170883f548274884335bfa3045d8b1ae 100644 --- a/src/layouts/Inspector/InspectionCompleteLayout.tsx +++ b/src/layouts/Inspector/InspectionCompleteLayout.tsx @@ -1,5 +1,6 @@ import { BtnTwo } from "../../components/buttons"; import { HeadingOne } from "../../components/headings"; +import { LANG } from "../../constants"; import styles from "./InspectionCompleteLayout.module.css"; /** @@ -24,7 +25,7 @@ export const InspectionCompleteLayout = ({ </div> </div> <div className=""> - <HeadingOne heading="Inspection completed" /> + <HeadingOne heading={`${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`} /> </div> <div className="mt-4"> <BtnTwo label="View pending applications" showIcon={false} isLink={true} isModal={false} btnType="button" link="/all-applications" /> diff --git a/src/layouts/Regulator/ReviewApplicationLayout.tsx b/src/layouts/Regulator/ReviewApplicationLayout.tsx index 0a1d76bcd0dd60165180bf0f4264ff00538604b9..e22f89416cd4664d3f88f5e67a50cbfb93a84245 100644 --- a/src/layouts/Regulator/ReviewApplicationLayout.tsx +++ b/src/layouts/Regulator/ReviewApplicationLayout.tsx @@ -420,7 +420,7 @@ export const ReviewApplicationLayout = ({ </div> <div className="mr-3"> <BtnSix - label="Send for inspection" + label={`${LANG.SEND_FOR_INSPECTION}`} showIcon={true} iconValue={`arrow_forward`} isLink={false} diff --git a/src/pages/Regulator/RegulatorAllApplications.tsx b/src/pages/Regulator/RegulatorAllApplications.tsx index 1f42f98d41192c691ccfb777d4030110aa3d591c..fa2a0680a02d771202cb7955870e7c5c07e9c981 100644 --- a/src/pages/Regulator/RegulatorAllApplications.tsx +++ b/src/pages/Regulator/RegulatorAllApplications.tsx @@ -11,7 +11,7 @@ import { } from "../../states/atoms"; import Helper from "./../../helpers/auth"; import { FormService } from "./../../services/form.service"; -import { APP } from "./../../constants"; +import { APP, LANG } from "./../../constants"; import Notify from "./../../helpers/notify"; /** @@ -55,13 +55,13 @@ export const RegulatorAllApplications = ({ }, { id: "sentForInspection", - label: "Sent for inspection", + label: `${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`, ariaLabelled: "sent-for-inpection-tab", children: <AllApplicationsTab />, }, { id: "inspectionCompleted", - label: "Inspection completed", + label: `${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`, ariaLabelled: "inspection-completed-tab", children: <AllApplicationsTab />, }, @@ -144,11 +144,11 @@ export const RegulatorAllApplications = ({ tempStatus = "returned"; break; - case "Sent for inspection": + case `${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`: tempStatus = "sentforins"; break; - case "Inspection completed": + case `${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`: tempStatus = "inscompleted"; break; diff --git a/src/pages/Reviewer/ReviewerApplications.tsx b/src/pages/Reviewer/ReviewerApplications.tsx index 853aef0f9ea841a2bd813f5b1e5dcad3f714d4e8..fa8505b4d6b2e0c0c231d9ab40927c58ddf60240 100644 --- a/src/pages/Reviewer/ReviewerApplications.tsx +++ b/src/pages/Reviewer/ReviewerApplications.tsx @@ -2,7 +2,7 @@ import { Component, Fragment } from "react"; import Header from "./../../components/common/Header"; import { Link } from "react-router-dom"; import { FormService } from "./../../services/form.service"; -import { APP } from "./../../constants"; +import { APP, LANG } from "./../../constants"; import Notify from "./../../helpers/notify"; import Helper from "./../../helpers/auth"; import { ViewApplications } from ".."; @@ -40,8 +40,8 @@ const FORM_STATUS = [ "New", "Under review", "Returned", - "Sent for inspection", - "Inspection completed", + `${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`, + `${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`, "Approved" ]; class ReviewerApplications extends Component<ReviewerApplicationsProps, ReviewerApplicationsState> { diff --git a/src/pages/Reviewer/ReviewerHome.tsx b/src/pages/Reviewer/ReviewerHome.tsx index b931554e69ba68544fc621dc281e7dd3316ed573..0b28b4915618e1e78b076693aec7d718fc1a9cf4 100644 --- a/src/pages/Reviewer/ReviewerHome.tsx +++ b/src/pages/Reviewer/ReviewerHome.tsx @@ -125,10 +125,10 @@ export const ReviewerHome = ({ data }: ReviewerProps) => { lowerLabel = "Under review"; return lowerLabel; case "Sentforins": - lowerLabel = "Sent for inspection"; + lowerLabel = `${LANG.FORM_STATUS_TEXT.SENT_FOR_INSPECTION}`; return lowerLabel; case "Inscompleted": - lowerLabel = "Inspection completed"; + lowerLabel = `${LANG.FORM_STATUS_TEXT.INSPECTION_COMPLETED}`; return lowerLabel; default: return lowerLabel;