Skip to content

Commit 3a581a4

Browse files
author
Ruben van Leeuwen
committed
1663: Removes last references to Dynamic forms
1 parent 3f74d5d commit 3a581a4

19 files changed

+32
-65
lines changed

frontend/packages/pydantic-forms/src/PydanticForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
44
* Main form wrap component
55
*
@@ -26,7 +26,7 @@ export const PydanticForm = ({
2626
metaData,
2727
...contextProps
2828
}: PydanticFormProps) => (
29-
<div e2e-id={`dynamicforms-${id}`}>
29+
<div e2e-id={`pydanticforms-${id}`}>
3030
<PydanticFormContextProvider
3131
{...contextProps}
3232
formKey={id}

frontend/packages/pydantic-forms/src/components/config.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
44
* We will search for the first field that returns a positive match
55
* The last field has no matcher, so it will match as the default
@@ -8,15 +8,6 @@ import TextField from '@/components/fields/TextField';
88
import { PydanticFormFieldConfig } from '@/types';
99

1010
const fieldsConfig: PydanticFormFieldConfig[] = [
11-
/*
12-
{
13-
id: 'textarea',
14-
Component: DFTextArea,
15-
matcher(field) {
16-
return field.format === DfFieldFormats.LONG;
17-
},
18-
},
19-
*/
2011
// no matcher, last in array,
2112
// so its the final fallback
2213
{

frontend/packages/pydantic-forms/src/components/form/Footer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
44
* Form footer component
55
*/
@@ -43,7 +43,7 @@ const Footer = () => {
4343
{resetButtonAlternative ?? (
4444
<button
4545
type="button"
46-
e2e-id="dynamicforms-reset-btn"
46+
e2e-id="pydanticforms-reset-btn"
4747
onClick={(e) => {
4848
resetForm(e);
4949
}}
@@ -75,14 +75,14 @@ const Footer = () => {
7575
<button
7676
type="button"
7777
onClick={onCancel}
78-
e2e-id="dynamicforms-cancel-btn"
78+
e2e-id="pydanticforms-cancel-btn"
7979
>
8080
Annuleren
8181
</button>
8282
))}
8383

8484
<button
85-
e2e-id="dynamicforms-send-btn"
85+
e2e-id="pydanticforms-send-btn"
8686
type="submit"
8787
disabled={
8888
!rhf.formState.isValid ||

frontend/packages/pydantic-forms/src/components/form/Form.module.scss

Lines changed: 0 additions & 24 deletions
This file was deleted.

frontend/packages/pydantic-forms/src/components/form/RenderForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
44
* Main form component
55
*

frontend/packages/pydantic-forms/src/components/render/Fields.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
44
* This component will render all the fields based on the
5-
* config in the dynamicFormContext
5+
* config in the pydanticFormContext
66
*/
77
import React from 'react';
88

frontend/packages/pydantic-forms/src/components/render/RenderFormErrors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
44
* Renders errors that are generated client-side
55
*/

frontend/packages/pydantic-forms/src/components/render/RenderReactHookFormErrors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
44
* Renders errors received from the backend after submitting the form
55
*/

frontend/packages/pydantic-forms/src/components/zodValidations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
44
* Here we can define some validation presets we can reuse in components.
55
* String for example, can have a min & max length and pattern validation rules.

frontend/packages/pydantic-forms/src/core/PydanticFormContextProvider.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Dynamic Forms
2+
* Pydantic Forms
33
*
4-
* The main context of a dynamic form
4+
* The main context of a Pydantic form
55
*
66
* This will fetch the jsonScheme, parse it, and handle form state and validation
77
*/
@@ -94,7 +94,7 @@ function PydanticFormContextProvider({
9494
} = config;
9595

9696
// option to enable the debug mode on the fly in the browser
97-
// by setting localStorage.setItem("dynamicFormsDebugMode", "true")
97+
// by setting localStorage.setItem("pydanticFormsDebugMode", "true")
9898
// reload is required
9999
const debugMode = false;
100100

@@ -382,7 +382,7 @@ function PydanticFormContextProvider({
382382
// eslint-disable-next-line no-console
383383
console.log('New context cycle', {
384384
resolver,
385-
DynamicFormsContextState: PydanticFormContextState,
385+
PydanticFormContextState,
386386
});
387387

388388
const fieldWatcher = rhf.watch();

0 commit comments

Comments
 (0)