11655: show warning if invalid ref:REI input tag is found#11656
11655: show warning if invalid ref:REI input tag is found#11656ankushKun wants to merge 1 commit intoopenstreetmap:developfrom
Conversation
|
@ankushKun please review the codebase on how alerts like this are handled. IMO you will find that we do not add them on a tag by tag basis manually deep in the code but instead search for abstractions like id-tagging-schema and similar. |
|
@tordans should I be adding the ref:REI tag to https://github.com/openstreetmap/id-tagging-schema first? since I cannot find it anywhere in the current codebases |
|
@tordans Can tagging schema support such validations? Do we have any such formats specified there? |
|
The REI reference doesn't include dashes, so the only valid format should be an 8 character string. More precise validations could be added (e.g. the first three characters are always letters), but even a simple length check would already be useful. |
k-yle
left a comment
There was a problem hiding this comment.
rather than hardcoding random tags, it would be better to use id-tagging-schema's existing pattern field, if at all.
This requires the key ref:REI to be defined in the tagging schema first. I think this is a good thing, because:
- it makes us go through the usual process of determing whether
ref:REIdeserves a field in the UI - iD's validation issues should be fixable. A warning about a tag that's hidden in the UI is likely to be confusing for new users.
It's also worth considering if this warning is actually a good idea. What are mappers supposed to do if the value is invalid? Perhaps this would be better suited for osmose?
or maybe create (limited) number of notes where format mismatches expected one? (only in places without nearby notes) this way it is more likely to be looked by expert mappers actively looking for problems to fix |
delete the incorrect ref or fill the correct one
I think that a warning during mapping is very better than uploading a invalid data, wating a QA to detect it and/or open a not-for-qa-reporting (bad pratice ?) and wait that someone (maybe not the initial mapper) find why the 1st mapper fill an invalid data and where the correct one is |
|
see #11656 (review) |
Implements openstreetmap/id-tagging-schema#2055
Added REI tag validation logic to modules/validations/invalid_format.js
Added en localization for the same to data/core.yaml
When an invalid value is entered to a ref:REI tag, a warning is displayed to the user
Valid formats: A string of length 8 characters
00000000or in the format00-00-0000