react-jsonschema-form
react-jsonschema-form copied to clipboard
Refactored the ArrayFieldTemplate into 4 templates
trafficstars
Reasons for making this change
- Updated the
typesin@rjsf/utilsto makeArrayFieldTemplaterequired as well as adding the following 3 new templates:ArrayFieldDescriptionTemplate,ArrayFieldItemTemplateandArrayFieldTitleTemplate- Also added to new types
ArrayFieldDescriptionPropsandArrayFieldTitleProps
- Updated the
coretheme to support the updatedArrayFeildTemplates as follows:- Refactored the
ArrayFieldDescriptionandArrayFieldTitlefromArrayField.jsasArrayFieldDescriptionTemplateandArrayFieldTitleTemplate- These new Typescript classes were added into the
Templatesdirectory - These two new templates were essentially the same across all themes, but made a template just in case and so they can be used in all themes
- These new Typescript classes were added into the
- Refactored the
DefaultArrayItemcomponent fromArrayField.jsasArrayFieldItemTemplateas a new Typescript file in theTemplatesdirectory - Refactored the
DefaultNormalArrayFieldTemplatefromArrayField.jsasArrayFieldTemplateas a new Typescript file in theTemplatesdirectory- Turns out the
DefaultFixedArrayFieldTemplatewas essentially the same as the other template (and was never customized in any of the themes) - As a result, this template was deemed unnecessary
- Turns out the
- Refactored the
- Updated the
antdtheme to support the updatedArrayFieldTemplates as follows:- Renamed the
ArrayFieldTemplateItemcomponent asArrayFieldItemTemplatein its own directory - Renamed the
NormalArrayFieldTemplateasArrayFieldTemplate(ignore git)- Switched to using the
ArrayFieldDescriptionTemplate,ArrayFieldItemTemplateandArrayFieldTitleTemplatefrom the templates directory
- Switched to using the
- Deleted the main
ArrayFieldTemplate/index.jsandFixedArrayFieldTemplate.jsfiles from the directory - Updated the
Templates.tsxfile to add theArrayFieldItemTemplateinto thetemplatesobject
- Renamed the
- Updated the
bootstrap-4theme to support the updatedArrayFieldTemplatess as follows:- Refactored the
DefaultArrayItemcomponent fromArrayFieldTemplateasArrayFieldItemTemplatein its own directory - Updated
ArrayFieldTemplateby deleting all the unnecessary code, turning theDefaultNormalArrayFieldTemplateinto theArrayFieldTemplate- Used the
ArrayFieldDescriptionTemplate,ArrayFieldItemTemplateandArrayFieldTitleTemplatefromregistry.templates
- Used the
- Updated the
Templates.tsxfile to add theArrayFieldItemTemplateinto thetemplatesobject - Deleted the test and snapshot for
ArrayFieldTemplatessince it was already covered elsewhere - Updated the
registrymock to pulltemplatesfrom thegetDefaultRegistry(), overriding with the themeTemplates
- Refactored the
- Updated the
chakra-uitheme to support the updatedArrayFieldTemplatess as follows:- Refactored the
DefaultArrayItemcomponent fromArrayFieldTemplateasArrayFieldItemTemplatein its own directory - Updated
ArrayFieldTemplateby deleting all the unnecessary code, turning theDefaultNormalArrayFieldTemplateinto theArrayFieldTemplate- Used the
ArrayFieldDescriptionTemplate,ArrayFieldItemTemplateandArrayFieldTitleTemplatefromregistry.templates
- Used the
- Updated the
Templates.tsxfile to add theArrayFieldItemTemplateinto thetemplatesobject
- Refactored the
- Updated the
chakra-uitheme to support the updatedArrayFieldTemplatess as follows:- Refactored the
DefaultArrayItemcomponent fromArrayFieldTemplateasArrayFieldItemTemplatein its own directory - Updated
ArrayFieldTemplateby deleting all the unnecessary code, turning theDefaultNormalArrayFieldTemplateinto theArrayFieldTemplate- Used the
ArrayFieldDescriptionTemplate,ArrayFieldItemTemplateandArrayFieldTitleTemplatefromregistry.templates
- Used the
- Updated the
Templates.tsxfile to add theArrayFieldItemTemplateinto thetemplatesobject - Updated the snapshot for the array templates to pick up the little changes from the refactor
- Refactored the
- Updated the
material-uiandmuithemes to support the updatedArrayFieldTemplatess as follows:- Refactored the
DefaultArrayItemcomponent fromArrayFieldTemplateasArrayFieldItemTemplatein its own directory - Updated
ArrayFieldTemplateby deleting all the unnecessary code, turning theDefaultNormalArrayFieldTemplateinto theArrayFieldTemplate- Used the
ArrayFieldDescriptionTemplate,ArrayFieldItemTemplateandArrayFieldTitleTemplatefromregistry.templates
- Used the
- Updated the
Templates.tsxfile to add theArrayFieldItemTemplateinto thetemplatesobject - Deleted the
UpDownWidgettests and snapshots because they are duplicated in theFormtests
- Refactored the
- Updated the
semantic-uitheme to support the updatedArrayFieldTemplatess as follows:- Refactored the
DefaultArrayItemcomponent fromArrayFieldTemplateasArrayFieldItemTemplatein its own directory - Updated
ArrayFieldTemplateby deleting all the unnecessary code, turning theDefaultNormalArrayFieldTemplateinto theArrayFieldTemplate- Used the
ArrayFieldDescriptionTemplate,ArrayFieldItemTemplateandArrayFieldTitleTemplatefromregistry.templates
- Used the
- Updated the
Templates.tsxfile to add theArrayFieldItemTemplateinto thetemplatesobject
- Refactored the
Checklist
- [ ] I'm updating documentation
- [ ] I've checked the rendering of the Markdown text I've added
- [x] I'm adding or updating code
- [ ] I'm adding a new feature
- [ ] I've updated the playground with an example use of the feature