-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More meaningful regex error messages #2640
Conversation
Hi @hutattedonmyarm, |
@hutattedonmyarm : Apologies for the long delay on revisiting this work. Could you rebase this on latest |
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.
👍 Thanks @hutattedonmyarm ! I also had a chance to give this a test (based on @kanasznagyzoltan 's example) and it's working well. So, I'll merge this into 8.0 and 7.x immediately.
That said, I'm going to add the needs documentation
as I think we should mention in the documentation that these regex messages are now translatable. If you have the chance to add a note to the Submission Docs (next to the docs for regex), that may be the best place. If you don't have access you can also add basic notes here & I'll get them copied over.
@tdonohue I don't have an account for the wiki. I'd suggest to add a note to the "regex" section. I've left the beginning as is and added instructions regex: When specified, this field will be validated against the Regular Expression, and only successfully validating values will be saved. An example is commented out in the default "Author" field. If the validation fails, the following error message will be shown by default: "This input is restricted by the current pattern: {{ pattern }}.". This can be customized, by adding an entry to the internalization files with the key |
Thanks @hutattedonmyarm ! I've copied those docs into the 7.x and 8.x documentation for the Submission User Interface. I'll remove the |
References
Description
Adds field-specific error messages for regex validation in the form of
error.validation.pattern.schema_element_qualifier
.If no error message for a specific field has been added to the i18n files, the old error message will be used.
Instructions for Reviewers
dc.title
in the submission configurationerror.validation.pattern.dc_title
with custom error messageChecklist
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.