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
{{ message }}
Repository navigation
iD date validation should be a validator rule, not an alert #445
As of OpenHistoricalMap/iD#81 for #280, when you enter a value into iD’s Start Date or End Date that doesn’t conform to the ISO 8601 date format, a modal alert box appears. Dismissing the alert clears the field, forcing you to reenter the whole value instead of fixing what was likely a smaller typo. This is inconvenient when working with a source in another tab of the same browser window: I have to remember to enter just the year but not the - before switching away to translate a month name in the source to a month number.
iD’s other validator rules are more lenient. For example, the missing tags validator rule is classified as an error, which appears as a red box above the fields. The Issues panel lists any such errors, and you aren’t allowed to save the changeset until you fix the error:
These proper validator rules are implemented outside of the field, in the validations/ directory. Proper validator rules can also catch malformed values that arise when using the raw tag editor, something the input field code can’t catch. It’s also possible to present the user with tips or quick fixes to deal with the issue. For example, there could be an option to delete the malformed date or, if it appears to be an EDTF date, move it over to start_date:edtf or end_date:edtf.
Replacing this modal alert with an inline error will also be helpful once we validate that end_date comes after start_date. Whenever I need to map a successor to a feature, I duplicate it, cut the End Date, and paste it into the Start Date. But doing it in another order should be OK too.
Worth mentioning too that post openstreetmap/iD#8243 you can now use URL parameters to override the validation rules, e.g. changing severity or disabling completely.
OpenHistoricalMap/iD#138 replaced the alert with a proper validator rule. The PR landed in the new staging branch we’re working on for #395. GitHub hasn’t closed this issue automatically because staging-old is still this repository’s default branch; it’s waiting for us to merge staging into staging-old, which will never happen.
Activity
bhousel commentedon Sep 21, 2022
Worth mentioning too that post openstreetmap/iD#8243 you can now use URL parameters to override the validation rules, e.g. changing severity or disabling completely.
1ec5 commentedon Oct 4, 2022
OpenHistoricalMap/iD#138 replaced the alert with a proper validator rule. The PR landed in the new staging branch we’re working on for #395. GitHub hasn’t closed this issue automatically because staging-old is still this repository’s default branch; it’s waiting for us to merge staging into staging-old, which will never happen.
1ec5 commentedon Oct 8, 2022
Fixed in OpenHistoricalMap/iD#138.