diff --git a/formule-demo/src/main.tsx b/formule-demo/src/main.tsx index 15993d9..8cb2dda 100644 --- a/formule-demo/src/main.tsx +++ b/formule-demo/src/main.tsx @@ -3,11 +3,16 @@ import ReactDOM from "react-dom/client"; import App from "./App.tsx"; import { ConfigProvider } from "antd"; import { theme } from "./theme.ts"; +import { Alert } from "antd"; + +const { ErrorBoundary } = Alert; ReactDOM.createRoot(document.getElementById("root")!).render( - + + + , ); diff --git a/formule-demo/yarn.lock b/formule-demo/yarn.lock index 9780df2..936e035 100644 --- a/formule-demo/yarn.lock +++ b/formule-demo/yarn.lock @@ -3497,7 +3497,7 @@ react-dom@^18.2.0: scheduler "^0.23.2" "react-formule@file:..": - version "1.1.1" + version "1.2.0" dependencies: "@ant-design/pro-layout" "^7.16.4" "@codemirror/lang-json" "^6.0.1" diff --git a/src/forms/Form.jsx b/src/forms/Form.jsx index 1f891fe..4f86740 100644 --- a/src/forms/Form.jsx +++ b/src/forms/Form.jsx @@ -15,6 +15,9 @@ import { useContext } from "react"; import { Provider, useDispatch } from "react-redux"; import store from "../store/configureStore"; import { updateFormData } from "../store/schemaWizard"; +import { Alert, Typography } from "antd"; + +const { ErrorBoundary } = Alert; const RJSFForm = ({ formRef, @@ -56,48 +59,88 @@ const RJSFForm = ({ return ( -
{}} - onBlur={() => {}} - customValidate={validate} - validator={validator} - extraErrors={extraErrors} - onChange={handleChange} - readonly={readonly || isPublished} - transformErrors={transformErrors} - formContext={{ - formRef, - ...formContext, - hideAnchors, - }} - idSeparator={customizationContext.separator} + + + Why am I getting this error? + + + Your schema might not be following the{" "} + + JSONSchema specification + + . This usually happens when you have manually modified the JSON + schema and introduced some errors. Please make sure the schema + follows the specification and try again. +
+ Notes: +
    +
  • + Formule adds some custom properties to the schema not present + in the JSONSchema specification, but these should not cause + issues. +
  • +
  • + When you get this error, you usually want to be looking at + clear violations of the JSON Schema principles. For example, + list or object fields not containing a type or containing + children as direct descendants instead of within a{" "} + properties + or items object. +
  • +
+
+ + } > - - +
{}} + onBlur={() => {}} + customValidate={validate} + validator={validator} + extraErrors={extraErrors} + onChange={handleChange} + readonly={readonly || isPublished} + transformErrors={transformErrors} + formContext={{ + formRef, + ...formContext, + hideAnchors, + }} + idSeparator={customizationContext.separator} + > + + +
); };