File tree Expand file tree Collapse file tree 7 files changed +12
-3
lines changed Expand file tree Collapse file tree 7 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,14 @@ type SideModalFormProps<TFieldValues extends FieldValues> = {
41
41
resourceName : string
42
42
/** Must be provided with a reason describing why it's disabled */
43
43
submitDisabled ?: string
44
+
45
+ // require loading and error so we can't forget to hook them up. there are a
46
+ // few forms that don't need them, so we'll use dummy values
47
+
44
48
/** Error from the API call */
45
49
submitError : ApiError | null
46
- loading ?: boolean
50
+ loading : boolean
51
+
47
52
/** Only needed if you need to override the default title (Create/Edit ${resourceName}) */
48
53
title ?: string
49
54
subtitle ?: ReactNode
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export function AttachDiskSideModalForm({
35
35
onSubmit,
36
36
onDismiss,
37
37
diskNamesToExclude = [ ] ,
38
- loading,
38
+ loading = false ,
39
39
submitError = null ,
40
40
} : AttachDiskProps ) {
41
41
const { project } = useProjectSelector ( )
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ export function EditIdpSideModalForm() {
58
58
}
59
59
// TODO: pass actual error when this form is hooked up
60
60
submitError = { null }
61
+ loading = { false }
61
62
>
62
63
< PropertiesTable >
63
64
< PropertiesTable . Row label = "ID" >
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export function EditImageSideModalForm({
86
86
}
87
87
// TODO: pass actual error when this form is hooked up
88
88
submitError = { null }
89
+ loading = { false }
89
90
>
90
91
< PropertiesTable >
91
92
< PropertiesTable . Row label = "Shared with" > { type } </ PropertiesTable . Row >
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export function CreateImageFromSnapshotSideModalForm() {
84
84
} )
85
85
}
86
86
submitError = { createImage . error }
87
+ loading = { createImage . isPending }
87
88
>
88
89
< PropertiesTable >
89
90
< PropertiesTable . Row label = "Snapshot" > { data . name } </ PropertiesTable . Row >
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ type CreateNetworkInterfaceFormProps = {
42
42
export function CreateNetworkInterfaceForm ( {
43
43
onSubmit,
44
44
onDismiss,
45
- loading,
45
+ loading = false ,
46
46
submitError = null ,
47
47
} : CreateNetworkInterfaceFormProps ) {
48
48
const projectSelector = useProjectSelector ( )
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ export function CreateSnapshotSideModalForm() {
72
72
createSnapshot . mutate ( { query : projectSelector , body : values } )
73
73
} }
74
74
submitError = { createSnapshot . error }
75
+ loading = { createSnapshot . isPending }
75
76
>
76
77
< NameField name = "name" control = { form . control } />
77
78
< DescriptionField name = "description" control = { form . control } />
You can’t perform that action at this time.
0 commit comments