You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type model is potentially inconsistent for the following reasons:
Short text and long text fields do not offer range validation, so the type system is not reflective of application functionality today.
The key selectedValidation defines the validation rule being applied, while the customVal property defines the number of characters to validate against. This makes the customMin and customMax keys redundant and runs the risk of inconsistent application state.
TODOs:
Verify that the database is internally consistent today for all short text and long text fields:
a. customVal === customMin when selectedValidation === 'Minimum'
b. customVal === customMax when selectedValidation === 'Maximum'
c. customVal === customMin === customMax when selectedValidation === 'Exact'
d. selectedValidation === 'Range' should not exist
Simplify the codebase by removing references to customMin, customMax and Range
Write a database migration script and/or mongoose hooks to fix inconsistencies discovered
The text was updated successfully, but these errors were encountered:
@liangyuanruo should we extend this to include number field? The same considerations apply as (i) number field does not offer range validation, and (ii) customMin and customMax are redundant
liangyuanruo
changed the title
Redundant ValidationOption object properties for short text and long text fields
Redundant ValidationOption object properties for short text, long text and number fields
May 31, 2021
The
ValidationOption
object defines the required validation rules for the short text and long text fields. An example for Short Text is shown below:The type model is potentially inconsistent for the following reasons:
selectedValidation
defines the validation rule being applied, while thecustomVal
property defines the number of characters to validate against. This makes thecustomMin
andcustomMax
keys redundant and runs the risk of inconsistent application state.TODOs:
a.
customVal === customMin
whenselectedValidation === 'Minimum'
b.
customVal === customMax
whenselectedValidation === 'Maximum'
c.
customVal === customMin === customMax
whenselectedValidation === 'Exact'
d.
selectedValidation === 'Range'
should not existcustomMin
,customMax
andRange
The text was updated successfully, but these errors were encountered: