-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d83bed
commit 44ca21e
Showing
2 changed files
with
20 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44ca21e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From
ValueLine
toAutoLine
Splitting
ValueLine
Signum Framework has a set of components that inherit from
LineBase
and are meant to control a property, typically by receiving aTypeContext<T>
.Before this change, this components where following this hierarchy.
ValueLine
(string, numbers, Enum, DateTime, Color, TimeSpan, Guid, ...)MultiValueLine
(MList of values)EntityBase
(abstract for Entity or Lite)EntityLine
EntityCombo
EntityDetail
EntityListBase
(abstract for MList or MList<Lite>)EntityStrip
EntityTable
EntityRepeater
....
Grouping all the different values into one component (
ValueLine
) made it a very big components with many props, but only some of the props will take any effect for any particularValueLineType
.ValueBase
(abstract)TextBoxLine
/TextAreaLine
/PasswordLine
/ColorLine
(for string)NumberLine
(for numbers)EnumLine
(for enums or selecting a string from a list)DateTimeLine
/DateTimeSplittedLine
(for DateTime / DateOnly)GuidLine
(for Guid)TimeLine
(for TimeSpan / TimeOnly)CheckboxLine
(for non-nullable boolean).MultiValueLine
(MList of values)EntityBase
(abstract for Entity or Lite)EntityLine
EntityCombo
EntityDetail
EntityListBase
(abstract for MList or MList<Lite>)EntityStrip
EntityTable
EntityRepeater
....
This change simplifies the implementation and understanding of
ValueLine
, but requires the developer to known and choose the appropiate component for every property.AutoLine
To aliviate this, there is a new
AutoLine
component that tries to infer the right component depending on the metadata delivered by the server via reflection.The implementation of
AutoLine
has an extension point to register new components (likeFileLine
orFileImageLine
) but the default imlpementation is a catallog of all the monsters inheriting fromLineBase
and for what properties they make sense:framework/Signum/React/Lines/AutoLine.tsx
Line 40 in 07273d7
This means that you can use
AutoLine
for every property: Entities, Lite, values, MList, ... you can also customize some things likelabel
,onChange
etc..:framework/Signum/React/Lines/LineBase.tsx
Line 14 in 07273d7
But if you want to use component specific properties, you will need to use the actual component like
EntityLine
orTextBoxLine
.AutoViewDispatcher
andAutoComponent
(internal stuff)The
ViewDispatcher
is the class that resolves the right component that will be used inside aFrameModal
/FramePage
.By default it uses the component register in the
EntitySettings
, or if not found, a component that automatically generates a basic UI for each property of the entity. This automatic component has been renamed fromDynamicComponent
toAutoComponent
and has been grately simplified. Now is basically a foreach ofAutoLine
.https://github.com/signumsoftware/framework/blob/07273d779a3a62a39e042ffcb378dc45d90558af/Signum/React/AutoComponent.tsx
How to Upgrade
There is a
Upgrade_20231013_AutoLine
that will replace all yourValueLine
forAutoLine
except wheninlineCheckBox
is used (thenCheckBoxLine
) oroptionITems
(thenEnumLine
).https://github.com/signumsoftware/framework/blob/07273d779a3a62a39e042ffcb378dc45d90558af/Signum.Upgrade/Upgrades/Upgrade_20231013_AutoLine.cs
Everithing else will require some manual fixes, hopefully is not too much work.
44ca21e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As always, Great 💯