File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
src/apps/admin/src/billing-account
BillingAccountResourceNewPage Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,18 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
67
67
formState : { errors, isDirty } ,
68
68
} : UseFormReturn < FormEditBillingAccount > = useForm ( {
69
69
defaultValues : {
70
+ budgetAmount : '' as any ,
71
+ client : undefined ,
72
+ companyId : '' as any ,
73
+ description : '' ,
74
+ endDate : undefined ,
75
+ name : '' ,
76
+ paymentTerms : '' as any ,
77
+ poNumber : '' ,
70
78
salesTax : 0 ,
79
+ startDate : undefined ,
71
80
status : 'Active' ,
81
+ subscriptionNumber : '' as any ,
72
82
} ,
73
83
mode : 'all' ,
74
84
resolver : yupResolver ( formEditBillingAccountSchema ) ,
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export const BillingAccountResourceNewPage: FC<Props> = (props: Props) => {
53
53
control,
54
54
handleSubmit,
55
55
register,
56
- formState : { errors } ,
56
+ formState : { errors, isDirty } ,
57
57
setValue,
58
58
} : UseFormReturn < FormNewBillingAccountResource > = useForm ( {
59
59
defaultValues : {
@@ -158,7 +158,7 @@ export const BillingAccountResourceNewPage: FC<Props> = (props: Props) => {
158
158
primary
159
159
size = 'lg'
160
160
type = 'submit'
161
- disabled = { isAdding || isLoading }
161
+ disabled = { isAdding || isLoading || ! isDirty }
162
162
>
163
163
Save Changes
164
164
</ Button >
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ export const ClientEditPage: FC<Props> = (props: Props) => {
65
65
reset,
66
66
} : UseFormReturn < FormEditClient > = useForm ( {
67
67
defaultValues : {
68
+ codeName : '' ,
69
+ endDate : undefined ,
70
+ name : '' ,
71
+ startDate : undefined ,
68
72
status : 'Active' ,
69
73
} ,
70
74
mode : 'all' ,
@@ -163,7 +167,7 @@ export const ClientEditPage: FC<Props> = (props: Props) => {
163
167
onChange = { _ . noop }
164
168
classNameWrapper = { styles . field }
165
169
inputControl = { register ( 'codeName' ) }
166
- error = { _ . get ( errors , 'name .message' ) }
170
+ error = { _ . get ( errors , 'codeName .message' ) }
167
171
dirty
168
172
disabled = { isAdding || isUpdating }
169
173
/>
You can’t perform that action at this time.
0 commit comments