Change the semantics of Required
Summary: This is a redesign, based on a suggestion from Alexx.
The core concept here is that I should be able to define a "Required" Property that has no default value in the Model. When I create/edit an Instance, that Instance should be visibly "invalid" until I fill in a value.
This is really a small Epic; here's the outline.
- Make sure there is a way to check
isUsingDefault
on a Required value.
- Add a new
Requires Instance Value
flag Property.
- In the Model Designer, add a new checkbox to each Required Property, labeled something like "No default -- Instances must fill this in", hooked into
Requires Instance Value
.
- Add an "isFullyValid" method on Thing, which checks whether all of its values are Valid. Iff an Instance Property has
Requires Instance Value
and it isUsingDefault
, then it is considered invalid, and marks the Thing as invalid.
- Enhance ThingInfo to carry the isFullyValid flag to the client.
- When looking at a Thing, iff it is not fully valid and I can edit it, the Edit button should turn red, and probably have "!" appended, to indicate that this Thing needs editing.
- In the Instance and Advanced Editors, if a Property value is not valid, it should show up initially as an error, the same way it is if I give an invalid value.
- These same errors should highlight any Required fields that need to be filled in when I initially create the Thing.