mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Use LoadingOverlay component
This commit is contained in:
parent
5f9e18e0c0
commit
096e210e77
@ -3,6 +3,7 @@ import {
|
||||
Alert,
|
||||
Checkbox,
|
||||
Divider,
|
||||
LoadingOverlay,
|
||||
Modal,
|
||||
NumberInput,
|
||||
ScrollArea,
|
||||
@ -396,38 +397,38 @@ export function ApiForm({
|
||||
>
|
||||
<Stack>
|
||||
<Divider />
|
||||
{definitionQuery.isFetching && (
|
||||
<Center>
|
||||
<Loader />
|
||||
</Center>
|
||||
)}
|
||||
{error && (
|
||||
<Alert
|
||||
radius="sm"
|
||||
color="red"
|
||||
title={`Error`}
|
||||
icon={<IconAlertCircle size="1rem" />}
|
||||
>
|
||||
{error}
|
||||
</Alert>
|
||||
)}
|
||||
{canRender && (
|
||||
<ScrollArea>
|
||||
<Stack spacing="md">
|
||||
{fields.map((field) => (
|
||||
<ApiFormField
|
||||
key={field.name}
|
||||
field={field}
|
||||
form={form}
|
||||
definitions={fieldDefinitions}
|
||||
onValueChange={(fieldName, value) => {
|
||||
form.setValues({ [fieldName]: value });
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</Stack>
|
||||
</ScrollArea>
|
||||
)}
|
||||
<Stack>
|
||||
<LoadingOverlay
|
||||
visible={definitionQuery.isFetching || initialDataQuery.isFetching}
|
||||
/>
|
||||
{error && (
|
||||
<Alert
|
||||
radius="sm"
|
||||
color="red"
|
||||
title={`Error`}
|
||||
icon={<IconAlertCircle size="1rem" />}
|
||||
>
|
||||
{error}
|
||||
</Alert>
|
||||
)}
|
||||
{canRender && (
|
||||
<ScrollArea>
|
||||
<Stack spacing="md">
|
||||
{fields.map((field) => (
|
||||
<ApiFormField
|
||||
key={field.name}
|
||||
field={field}
|
||||
form={form}
|
||||
definitions={fieldDefinitions}
|
||||
onValueChange={(fieldName, value) => {
|
||||
form.setValues({ [fieldName]: value });
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</Stack>
|
||||
</ScrollArea>
|
||||
)}
|
||||
</Stack>
|
||||
<Divider />
|
||||
<Group position="right">
|
||||
<Button onClick={onClose} variant="outline" radius="sm" color="red">
|
||||
|
Loading…
x
Reference in New Issue
Block a user