TF-103 debug make all places province and national code text and other actions same as together

This commit is contained in:
2023-09-27 16:03:58 +03:30
parent 0f487f5152
commit dbd3b032b4
3 changed files with 36 additions and 36 deletions

View File

@@ -125,8 +125,8 @@
"error_message_vehicle_type": "لطفا نوع وسیله نقلیه خود را وارد کنید!",
"error_message_plate_number": "لطفا شماره پلاک خود را وارد کنید!",
"error_message_navgan_id": "لطفا کد ناوگان خود را وارد کنید!",
"error_message_province": "لطفا استان خود را وارد کنید!",
"error_message_national_code": "لطفا کد ملی خود را وارد کنید!",
"error_message_province_id": "لطفا استان خود را وارد کنید!",
"error_message_national_id": "لطفا کد ملی خود را وارد کنید!",
"error_message_shenasname_id": "لطفا شماره شناسنامه خود را وارد کنید!",
"text_field_phone_number": "شماره تلفن",
"text_field_enter_your_phone_number": "شماره تلفن خود را وارد کنید",
@@ -134,14 +134,14 @@
"text_field_enter_your_name": "نام خود را وارد کنید",
"text_field_vehicle_type": "نام وسیله نقلیه",
"text_field_enter_your_vehicle_type": "نام وسیله نقلیه خود را وارد کنید",
"text_field_province": "استان",
"text_field_province_id": "استان",
"text_field_loading_provinces_list": "درحال دریافت استان ها",
"text_field_error_fetching_provinces": "خطا در دریافت استان ها",
"text_field_enter_your_province": "استان خود را وارد کنید",
"text_field_enter_your_province_id": "استان خود را وارد کنید",
"text_field_navgan_id": "شماره ناوگان",
"text_field_enter_your_navgan_id": "شماره ناوگان خود را وارد کنید",
"text_field_national_code": "کد ملی",
"text_field_enter_your_national_code": "کد ملی خود را وارد کنید",
"text_field_national_id": "کد ملی",
"text_field_enter_your_national_id": "کد ملی خود را وارد کنید",
"text_field_shenasname_id": "شماره شناسنامه",
"text_field_enter_your_shenasname_id": "شماره شناسنامه خود را وارد کنید",
"text_field_plate_number": "شماره پلاک",

View File

@@ -30,8 +30,8 @@ const AddFormComponent = () => {
const initialValues = {
name: "",
phone_number: "",
province: "",
national_code: "",
province_id: "",
national_id: "",
shenasname_id: "",
sherkat_naft_doc: null,
estate_doc: null,
@@ -46,9 +46,9 @@ const AddFormComponent = () => {
phone_number: Yup.string().required(
t("LoanRequest.error_message_phone_number")
),
province: Yup.string().required(t("LoanRequest.error_message_province")),
national_code: Yup.string().required(
t("LoanRequest.error_message_national_code")
province_id: Yup.string().required(t("LoanRequest.error_message_province_id")),
national_id: Yup.string().required(
t("LoanRequest.error_message_national_id")
),
shenasname_id: Yup.string().required(
t("LoanRequest.error_message_shenasname_id")
@@ -64,8 +64,8 @@ const AddFormComponent = () => {
const formData = new FormData();
formData.append("name", values.name);
formData.append("phone_number", values.phone_number);
formData.append("province_id", values.province);
formData.append("national_id", values.national_code);
formData.append("province_id", values.province_id);
formData.append("national_id", values.national_id);
formData.append("shenasname_id", values.shenasname_id);
if (values.sherkat_naft_doc != null)
formData.append("sherkat_naft_doc", values.sherkat_naft_doc);
@@ -179,18 +179,18 @@ const AddFormComponent = () => {
}}
>
<FormControl
error={props.touched.province && !!props.errors.province}
error={props.touched.province_id && !!props.errors.province_id}
sx={{width: "100%", mt: 2}}
size="small"
>
<InputLabel>{t("LoanRequest.text_field_province")}</InputLabel>
<InputLabel>{t("LoanRequest.text_field_province_id")}</InputLabel>
<Select
name="province"
name="province_id"
disabled={isLoadingProvinceList || errorProvinceList}
label={t("LoanRequest.text_field_province")}
value={props.values.province}
label={t("LoanRequest.text_field_province_id")}
value={props.values.province_id}
onChange={(e) => {
props.setFieldValue("province", e.target.value);
props.setFieldValue("province_id", e.target.value);
}}
onBlur={props.handleBlur}
fullWidth
@@ -213,7 +213,7 @@ const AddFormComponent = () => {
)}
</Select>
<FormHelperText>
{props.touched.province && props.errors.province ? props.errors.province : ""}
{props.touched.province_id && props.errors.province_id ? props.errors.province_id : ""}
</FormHelperText>
</FormControl>
</Box>
@@ -237,21 +237,21 @@ const AddFormComponent = () => {
<Field
as={TextField}
sx={{width: "100%"}}
name="national_code"
name="national_id"
variant="outlined"
size="small"
label={t("LoanRequest.text_field_national_code")}
label={t("LoanRequest.text_field_national_id")}
placeholder={t(
"LoanRequest.text_field_enter_your_national_code"
"LoanRequest.text_field_enter_your_national_id"
)}
type={"text"}
error={
!!(props.touched.national_code && props.errors.national_code)
!!(props.touched.national_id && props.errors.national_id)
}
fullWidth
helperText={
props.touched.national_code
? props.errors.national_code
props.touched.national_id
? props.errors.national_id
: null
}
/>

View File

@@ -74,8 +74,8 @@ const EditFormComponent = () => {
phone_number: Yup.string().required(
t("LoanRequest.error_message_phone_number")
),
province_id: Yup.string().required(t("LoanRequest.error_message_province")),
national_id: Yup.string().required(t("LoanRequest.error_message_national_code")),
province_id: Yup.string().required(t("LoanRequest.error_message_province_id")),
national_id: Yup.string().required(t("LoanRequest.error_message_national_id")),
shenasname_id: Yup.string().required(t("LoanRequest.error_message_shenasname_id")),
sherkat_naft_doc: Yup.mixed().required(t("LoanRequest.error_message_sherkat_naft_doc")),
estate_doc: Yup.mixed().required(t("LoanRequest.error_message_estate_doc")),
@@ -205,7 +205,7 @@ const EditFormComponent = () => {
>
<Field
name="province_id"
label={t("LoanRequest.text_field_province")} // t("LoanRequest.text_field_enter_your_province")
label={t("LoanRequest.text_field_province_id")} // t("LoanRequest.text_field_enter_your_province")
size="small"
selectType="province_id"
component={SelectBox}
@@ -244,9 +244,9 @@ const EditFormComponent = () => {
name="national_id"
variant="outlined"
size="small"
label={t("LoanRequest.text_field_national_code")}
label={t("LoanRequest.text_field_national_id")}
placeholder={t(
"LoanRequest.text_field_enter_your_national_code"
"LoanRequest.text_field_enter_your_national_id"
)}
type={"text"}
error={
@@ -307,7 +307,7 @@ const EditFormComponent = () => {
setFieldValue={props.setFieldValue}
default_image={initialValues.sherkat_naft_doc}
fieldName="sherkat_naft_doc"
imageAlt={t("app_name")}
imageAlt={t("LoanRequest.file_field_sherkat_naft_doc")}
label={t("LoanRequest.file_field_sherkat_naft_doc")}
enableDelete={false}
error={
@@ -326,7 +326,7 @@ const EditFormComponent = () => {
setFieldValue={props.setFieldValue}
default_image={initialValues.estate_doc}
fieldName="estate_doc"
imageAlt={t("app_name")}
imageAlt={t("LoanRequest.file_field_estate_doc")}
label={t("LoanRequest.file_field_estate_doc")}
enableDelete={false}
error={
@@ -345,7 +345,7 @@ const EditFormComponent = () => {
setFieldValue={props.setFieldValue}
default_image={initialValues.agreement_doc}
fieldName="agreement_doc"
imageAlt={t("app_name")}
imageAlt={t("LoanRequest.file_field_agreement_doc")}
label={t("LoanRequest.file_field_agreement_doc")}
enableDelete={false}
error={
@@ -364,7 +364,7 @@ const EditFormComponent = () => {
setFieldValue={props.setFieldValue}
default_image={initialValues.shenasname_image}
fieldName="shenasname_image"
imageAlt={t("app_name")}
imageAlt={t("LoanRequest.file_field_shenasname_image")}
label={t("LoanRequest.file_field_shenasname_image")}
enableDelete={false}
error={
@@ -383,7 +383,7 @@ const EditFormComponent = () => {
setFieldValue={props.setFieldValue}
default_image={initialValues.payan_khedmat_image}
fieldName="payan_khedmat_image"
imageAlt={t("app_name")}
imageAlt={t("LoanRequest.file_field_payan_khedmat_image")}
label={t("LoanRequest.file_field_payan_khedmat_image")}
enableDelete={false}
error={