Closed mttrbrts closed 3 years ago
A couple of things I spotted playing with the Storybook (very cool). These can be follow ups?
-->
and then use a RelationshipProvider
to dynamically return the compatible types based on the ModelFile
being edited: https://github.com/accordproject/web-components/blob/0667d024f07bc6b4293589047c4ad6851eb73bcf/packages/ui-concerto/src/components/fields.js#L104A couple of things I spotted playing with the Storybook (very cool). These can be follow ups?
- Can't create enums
- Can't specify the namespace for a model file
- Can't create a class and then reference it in a subsequently created class. E.g create an Address, and then create a Person that has-an Address. Type references (object types, super types) could be modelled using
-->
and then use aRelationshipProvider
to dynamically return the compatible types based on theModelFile
being edited: https://github.com/accordproject/web-components/blob/0667d024f07bc6b4293589047c4ad6851eb73bcf/packages/ui-concerto/src/components/fields.js#L104- Support for adding decorators?
- No ability to clear the super type once it has been specified by selecting a type in the drop down
Awesome indeed. To me 1.2.3.5. sound really important for MVP.
I would add:
I've addressed 2 & 5. The others can be addressed separately.
@jeromesimeon
I've addressed 2 & 5. The others can be addressed separately.
@jeromesimeon
- Is this different to the "Object" field type?
ah, yes that's what it is! I had missed it in the demo.
- Where do you see conflicts, please? I've already rebased.
Seeing this in the UI:
@mttrbrts @dselman I'm going to merge this so I can do further work on it!
This PR extends
ui-concerto
to provide a "Model Builder" which allows users to create new Concerto models using a graphical form-based experience over the textual-format. This change also adds several related bug fixes and improvements.Fixes #8
Changes
New visitor,
ModelBuilderVisitor
The new visitor provides a more compact representation for the
concerto.metadata
models. This also serves as an exemplar for how developers could extend the default visitor for their own rendering code for custom models.Improvements to UX for large and nested array elements and classes.
Previously, class elements were not clear (see
Address
), and the action buttons for array elements caused confusion when the element was large (i.e. it wasn't clear which element the button corresponded to). Before:After
New
@FormEditor
decorators@FormEditor("title", "My Field Name")
- This decorator allows the modeller to explicitly specify the field title that should be used in the form, rather than the auto-generated title from the property name.@FormEditor("selectOptions", "types")
- This decorator allows a developer to specify a set of dropdown selection options to be used instead of an input field forString
properties. The value"types"
is a key to the options parameter that is provided to theConcertoForm
component. e.g.@FormEditor("defaultSubclass","concerto.metamodel.ConceptDeclaration")
- This decorator allows the modeller to explicitly choose the default sub-class for an abstract type. This overrides the default behaviour which selects the first concrete sub-class for an abstract type when generating an instance.Support for Validators on String fields
If a model property includes a
regex
validator. The generated model now displays a simply validation warning by highlighting the field. This could be extended to provide richer validation and messages, however this requires deeper consideration of the form validation in general.Change default checkbox appearance
Previously checkboxes were rendered as toggles, now the default is for a checkbox representation. Developers can explicitly set the checkbox style with the new
checkboxStyle
option.Bug Fixes
lodash.topath
.factory
methodsnewConcept
andnewResource
to omitid
parameter. https://github.com/accordproject/web-components/pull/353/files#diff-7767cb5470a92481598fd4e18339e4fcfd9dee2f5b3d243a6aebbe713360c7faR136getDefaultValue
did not respect theincludeOptionalFields
andincludeSampleData
options.Flags
.cto
files, a serializer is required to transform the JSON to the Concerto syntax.u
unicode modifier to properly represent allowed values.Author Checklist
--signoff
option of git commit.master
fromfork:branchname