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