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> = {
4141 resourceName : string
4242 /** Must be provided with a reason describing why it's disabled */
4343 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+
4448 /** Error from the API call */
4549 submitError : ApiError | null
46- loading ?: boolean
50+ loading : boolean
51+
4752 /** Only needed if you need to override the default title (Create/Edit ${resourceName}) */
4853 title ?: string
4954 subtitle ?: ReactNode
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export function AttachDiskSideModalForm({
3535 onSubmit,
3636 onDismiss,
3737 diskNamesToExclude = [ ] ,
38- loading,
38+ loading = false ,
3939 submitError = null ,
4040} : AttachDiskProps ) {
4141 const { project } = useProjectSelector ( )
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ export function EditIdpSideModalForm() {
5858 }
5959 // TODO: pass actual error when this form is hooked up
6060 submitError = { null }
61+ loading = { false }
6162 >
6263 < PropertiesTable >
6364 < PropertiesTable . Row label = "ID" >
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export function EditImageSideModalForm({
8686 }
8787 // TODO: pass actual error when this form is hooked up
8888 submitError = { null }
89+ loading = { false }
8990 >
9091 < PropertiesTable >
9192 < 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() {
8484 } )
8585 }
8686 submitError = { createImage . error }
87+ loading = { createImage . isPending }
8788 >
8889 < PropertiesTable >
8990 < PropertiesTable . Row label = "Snapshot" > { data . name } </ PropertiesTable . Row >
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ type CreateNetworkInterfaceFormProps = {
4242export function CreateNetworkInterfaceForm ( {
4343 onSubmit,
4444 onDismiss,
45- loading,
45+ loading = false ,
4646 submitError = null ,
4747} : CreateNetworkInterfaceFormProps ) {
4848 const projectSelector = useProjectSelector ( )
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ export function CreateSnapshotSideModalForm() {
7272 createSnapshot . mutate ( { query : projectSelector , body : values } )
7373 } }
7474 submitError = { createSnapshot . error }
75+ loading = { createSnapshot . isPending }
7576 >
7677 < NameField name = "name" control = { form . control } />
7778 < DescriptionField name = "description" control = { form . control } />
You can’t perform that action at this time.
0 commit comments