Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/composer/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "5.2.0",
"version": "5.2.3",
"private": true,
"main": "index.js",
"proxy": "http://127.0.0.1:8000/",
Expand Down
32 changes: 16 additions & 16 deletions applications/composer/frontend/src/components/Forms/FormBase.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, {useRef, useState, useEffect} from "react";
import React, { useRef, useState, useEffect } from "react";
import validator from "@rjsf/validator-ajv8";
import {IChangeEvent, withTheme} from "@rjsf/core";
import {Backdrop, Box, CircularProgress} from "@mui/material";
import {Theme} from "@rjsf/mui";
import {EDIT_DEBOUNCE} from "../../settings";
import { IChangeEvent, withTheme } from "@rjsf/core";
import { Backdrop, Box, CircularProgress } from "@mui/material";
import { Theme } from "@rjsf/mui";
import { EDIT_DEBOUNCE } from "../../settings";
import Button from "@mui/material/Button";

const Form = withTheme(Theme);
Expand Down Expand Up @@ -46,7 +46,7 @@ export const FormBase = (props: any) => {

const submitButtonRef = useRef<any>(null);
const removeProp = (obj: any, prop: string) => {
const {[prop]: removedProp, ...newObj} = obj;
const { [prop]: removedProp, ...newObj } = obj;
return newObj;
};

Expand All @@ -73,11 +73,11 @@ export const FormBase = (props: any) => {
}, [data, schema, uiFields, uiSchema]);

const startTimer = () =>
(timer.current = setTimeout(() => {
if (enableAutoSave) {
onSave();
}
}, EDIT_DEBOUNCE));
(timer.current = setTimeout(() => {
if (enableAutoSave) {
onSave();
}
}, EDIT_DEBOUNCE));

const stopTimer = () => {
clearTimeout(timer.current);
Expand All @@ -104,7 +104,7 @@ export const FormBase = (props: any) => {
};

const handleSubmit = async (event: IChangeEvent) => {
const formData = {...event.formData, ...extraData};
const formData = { ...event.formData, ...extraData };
const saveOptions = onSaveCancel ? { onCancel: onSaveCancel } : {};
setIsSaving(true);
service
Expand All @@ -130,7 +130,7 @@ export const FormBase = (props: any) => {
};

const handleUpdate = async (event: IChangeEvent, id: any) => {
const formData = {...event.formData, ...extraData};
const formData = { ...event.formData, ...extraData };
if (submitOnBlurFields.some((field: string) => id && id.includes(field))) {
resetTimer();
}
Expand Down Expand Up @@ -160,12 +160,12 @@ export const FormBase = (props: any) => {
}
};

const showSpinner = isLoading || isSaving || !data;
const showSpinner = isLoading || isSaving;
return (
<>
{showSpinner && (
{(!data || showSpinner) && (
<Backdrop open={showSpinner}>
<CircularProgress color="inherit"/>
<CircularProgress color="inherit" />
</Backdrop>
)}
<Box>
Expand Down
Loading