[MGNLCT-29] Validation for model properties Created: 16/Apr/18  Updated: 25/Mar/22

Status: Open
Project: Content Types
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLCT-71 The 'required' property can be used o... Closed
dependency
depends upon MGNLUI-4246 Detach Validators from Vaadin Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Story Points: 8

 Description   

User story:

As a Business Analyst / Developer, I can define validation for fields in my content type. For example: required, accepted sizes, predefined values, regex, ranges, and types.

Defined in the actual content type definition - validation is not a presentation detail.

Acceptance criteria:

  • A developer can define validation rules on a field in the content type definition.
  • Multiple validation criteria allowed per field.
  • When validation is not passed, the editor does not allow saving the content.
  • Helpful validation messages are displayed in editing UI.
  • Proper HTML5 input types are used in the editing UI where applicable to provide useful input masks - ie email, url, tel, number, range, date, month, week, time, datetime, color
  • https://wiki.magnolia-cms.com/display/TH2/Content+Types+Stories#ContentTypesStories-Criteria


 Comments   
Comment by Hieu Nguyen Duc [ 14/Sep/18 ]

There are two kinds of validation: validation on UI & validation before saving data into database. What kind of validation would REST do if it used this model? If REST validated in server, why would we have two codes to handle validation with the same model? i.e app & REST. In that case, what kind of validation of the model could be understood?

Comment by Mikaël Geljić [ 20/Sep/18 ]

Exactly hieu.nguyen, UI-specific (soft) validation remains defined in the app descriptor for now (until we address synergies with UI). Data-source level validation is exactly what *this* story is about (we just clarified that, no additional ticket).

Generated at Mon Feb 12 00:36:28 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.