Skip to content

Commit

Permalink
deposits: harmonize field validations
Browse files Browse the repository at this point in the history
* `volume`, `number` and `pages` deposit fields should not reject values
that are accepted by the equivalent fields in the document.
* Allows more flexibility for submitters and prevents API rejections.
* Closes #878.

Co-Authored-by: Pascal Repond <[email protected]>
  • Loading branch information
PascalRepond committed Aug 8, 2022
1 parent 7a95f80 commit dad92e8
Showing 1 changed file with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,49 +572,31 @@
"title": "Volume",
"type": "string",
"minLength": 1,
"pattern": "^[0-9]+$",
"form": {
"hideExpression": "field.parent.parent.model && !['coar:c_beb9', 'coar:c_6501', 'coar:c_998f', 'coar:c_dcae04bc'].includes(field.parent.parent.model.documentType)",
"templateOptions": {
"placeholder": "Example: 1"
},
"validation": {
"messages": {
"patternMessage": "Please enter a valid number."
}
"placeholder": "Example: 1, 4-5, …"
}
}
},
"number": {
"title": "Number",
"type": "string",
"minLength": 1,
"pattern": "^[0-9]+$",
"form": {
"hideExpression": "field.parent.parent.model && !['coar:c_beb9', 'coar:c_6501', 'coar:c_998f', 'coar:c_dcae04bc'].includes(field.parent.parent.model.documentType)",
"templateOptions": {
"placeholder": "Example: 10"
},
"validation": {
"messages": {
"patternMessage": "Please enter a valid number."
}
"placeholder": "Example: 10, 22-24, …"
}
}
},
"pages": {
"title": "Pages",
"type": "string",
"minLength": 1,
"pattern": "^[0-9]+(-[0-9]+)?$",
"form": {
"templateOptions": {
"placeholder": "Examples: 135, 5-27, …"
},
"validation": {
"messages": {
"patternMessage": "Please enter a valid pages range, example: 135, 5-27."
}
}
}
},
Expand Down

0 comments on commit dad92e8

Please sign in to comment.