mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
Merge branch 'fix/form-error-message' into 'development'
[FIX/FE] Form Error Message See merge request mbugroup/lti-web-client!167
This commit is contained in:
@@ -17,6 +17,7 @@ import DropFileInput from '@/components/input/DropFileInput';
|
||||
import ExpenseKandangsTable from '@/components/pages/expense/form/ExpenseKandangsTable';
|
||||
import ExpenseRealizationKandangDetailExpense from '@/components/pages/expense/form/ExpenseRealizationKandangDetailExpense';
|
||||
import RequirePermission from '@/components/helper/RequirePermission';
|
||||
import AlertErrorList from '@/components/helper/form/FormErrors';
|
||||
|
||||
import {
|
||||
CreateExpenseRealizationPayload,
|
||||
@@ -35,6 +36,7 @@ import { LocationApi, SupplierApi } from '@/services/api/master-data';
|
||||
import { Supplier } from '@/types/api/master-data/supplier';
|
||||
import { ACCEPTED_FILE_TYPE } from '@/config/constant';
|
||||
import { cn } from '@/lib/helper';
|
||||
import { useFormikErrorList } from '@/services/hooks/useFormikErrorList';
|
||||
|
||||
interface ExpenseRealizationFormProps {
|
||||
type?: 'add' | 'edit' | 'detail';
|
||||
@@ -132,6 +134,7 @@ const ExpenseRealizationForm = ({
|
||||
});
|
||||
|
||||
const { setValues: formikSetValues } = formik;
|
||||
const { formErrorList, close, handleFormSubmit } = useFormikErrorList(formik);
|
||||
|
||||
const {
|
||||
setInputValue: setLocationInputValue,
|
||||
@@ -263,7 +266,7 @@ const ExpenseRealizationForm = ({
|
||||
</header>
|
||||
|
||||
<form
|
||||
onSubmit={formik.handleSubmit}
|
||||
onSubmit={handleFormSubmit}
|
||||
onReset={formik.handleReset}
|
||||
className='w-full mt-8 flex flex-col gap-6'
|
||||
>
|
||||
@@ -372,6 +375,8 @@ const ExpenseRealizationForm = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
<AlertErrorList formErrorList={formErrorList} onClose={close} />
|
||||
|
||||
{expenseFormErrorMessage && (
|
||||
<div role='alert' className='alert alert-error w-full'>
|
||||
<Icon
|
||||
@@ -421,7 +426,7 @@ const ExpenseRealizationForm = ({
|
||||
type='submit'
|
||||
color='primary'
|
||||
isLoading={formik.isSubmitting}
|
||||
disabled={!formik.isValid || formik.isSubmitting}
|
||||
disabled={formik.isSubmitting}
|
||||
className='px-4'
|
||||
>
|
||||
Submit
|
||||
|
||||
@@ -41,6 +41,8 @@ import { cn } from '@/lib/helper';
|
||||
import { TransferToLayingApi } from '@/services/api/production/transfer-to-laying';
|
||||
import { ProjectFlock } from '@/types/api/production/project-flock';
|
||||
import { TRANSFER_TO_LAYING_APPROVAL_LINE } from '@/config/approval-line';
|
||||
import { useFormikErrorList } from '@/services/hooks/useFormikErrorList';
|
||||
import AlertErrorList from '@/components/helper/form/FormErrors';
|
||||
|
||||
interface TransferToLayingFormProps {
|
||||
type?: 'add' | 'edit' | 'detail';
|
||||
@@ -160,6 +162,7 @@ const TransferToLayingForm = ({
|
||||
});
|
||||
|
||||
const { setValues: formikSetValues, values: formikValues } = formik;
|
||||
const { formErrorList, close, handleFormSubmit } = useFormikErrorList(formik);
|
||||
const {
|
||||
flockSourceKandangs: flockSourceKandangsValue,
|
||||
flockDestinationKandangs: flockDestinationKandangsValue,
|
||||
@@ -539,7 +542,7 @@ const TransferToLayingForm = ({
|
||||
</div>
|
||||
|
||||
<form
|
||||
onSubmit={formik.handleSubmit}
|
||||
onSubmit={handleFormSubmit}
|
||||
onReset={formik.handleReset}
|
||||
className='w-full flex flex-col gap-6'
|
||||
>
|
||||
@@ -777,6 +780,8 @@ const TransferToLayingForm = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
<AlertErrorList formErrorList={formErrorList} onClose={close} />
|
||||
|
||||
{formErrorMessage && (
|
||||
<div role='alert' className='alert alert-error w-full'>
|
||||
<Icon
|
||||
@@ -852,7 +857,7 @@ const TransferToLayingForm = ({
|
||||
type='submit'
|
||||
color='primary'
|
||||
isLoading={formik.isSubmitting}
|
||||
disabled={!formik.isValid || formik.isSubmitting}
|
||||
disabled={formik.isSubmitting}
|
||||
className='px-4'
|
||||
>
|
||||
Submit
|
||||
|
||||
Reference in New Issue
Block a user