diff --git a/client/src/pages/jobs-create/jobs-create.component.jsx b/client/src/pages/jobs-create/jobs-create.component.jsx index 744f3c9ab..d8f7c8dcc 100644 --- a/client/src/pages/jobs-create/jobs-create.component.jsx +++ b/client/src/pages/jobs-create/jobs-create.component.jsx @@ -1,5 +1,5 @@ -import { Button, Result, Space, Steps } from "antd"; import { PageHeader } from "@ant-design/pro-layout"; +import { Button, Result, Space, Steps } from "antd"; import React, { useContext, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -9,7 +9,6 @@ import JobsCreateJobsInfo from "../../components/jobs-create-jobs-info/jobs-crea import JobsCreateOwnerInfoContainer from "../../components/jobs-create-owner-info/jobs-create-owner-info.container"; import JobsCreateVehicleInfoContainer from "../../components/jobs-create-vehicle-info/jobs-create-vehicle-info.container"; import JobCreateContext from "../../pages/jobs-create/jobs-create.context"; -import FormsFieldChanged from "../../components/form-fields-changed-alert/form-fields-changed-alert.component"; export default function JobsCreateComponent({ form }) { const [pageIndex, setPageIndex] = useState(0); @@ -41,10 +40,11 @@ export default function JobsCreateComponent({ form }) { const next = () => { setPageIndex(pageIndex + 1); - console.log("NExt"); + console.log("Next"); }; const prev = () => { setPageIndex(pageIndex - 1); + console.log("Previous"); }; const { Step } = Steps; @@ -53,26 +53,26 @@ export default function JobsCreateComponent({ form }) { - {pageIndex > 0 && } + {pageIndex > 0 && } {pageIndex < steps.length - 1 && ( )} {pageIndex === steps.length - 1 && ( @@ -104,17 +104,17 @@ export default function JobsCreateComponent({ form }) { }} onClick={() => { setPageIndex(idx); - // form - // .validateFields() - // .then((r) => { - // if (steps[pageIndex].validation) { - // setErrorMessage(null); - // setPageIndex(idx); - // } else { - // setErrorMessage(steps[pageIndex].error); - // } - // }) - // .catch((error) => console.log("error", error)); + form + .validateFields() + .then((r) => { + if (steps[pageIndex].validation) { + setErrorMessage(null); + setPageIndex(idx); + } else { + setErrorMessage(steps[pageIndex].error); + } + }) + .catch((error) => console.log("error", error)); }} /> ))} @@ -144,7 +144,7 @@ export default function JobsCreateComponent({ form }) { ) : (
- + {errorMessage ? (
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 0011cede6..8fe9e30ba 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1139,6 +1139,8 @@ "download": "Download", "edit": "Edit", "login": "Login", + "next": "Next", + "previous": "Previous", "print": "Print", "refresh": "Refresh", "remove": "Remove", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 463e310e6..8a14ae894 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1139,6 +1139,8 @@ "download": "", "edit": "Editar", "login": "", + "next": "", + "previous": "", "print": "", "refresh": "", "remove": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 8ddbeef43..3615e31b2 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1139,6 +1139,8 @@ "download": "", "edit": "modifier", "login": "", + "next": "", + "previous": "", "print": "", "refresh": "", "remove": "",