-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Preset field inheritance #5712
Preset field inheritance #5712
Conversation
Hmm, can we resolve these in |
Oh that's a good idea, thanks! Let me know if anything else about this needs work. |
…initialization Removed the data build check for duplicate values between fields and moreFields Renamed the shop field from Type to Shop Type Renamed the beauty field from Shop Type to Beauty Specialty Added the brand field to the shop preset under moreFields
@bhousel This should be ready to merge. The data changes are fairly large though so it'd be nice to get your thoughts. |
Hmm I kind of don't like this part, but mainly because the tags themselves are arbitrary and messy and we can't easily translate them. In the example shown above, showing "Shop Type" of I see the main purpose of iD's preset system as: hiding the ugliness of OSM tagging from most users. I really like the idea of preset field inheritance though! It would make a lot of the preset definitions much simpler. You said in #5710:
I wanted to think about this a bit before responding, and I really like this idea of targeting a specific preset a bit better than the I don't see OSM tagging as having a clear inheritance where, e.g. all the amenities get some fields and all the leisure ones get different fields. It's all mixed up. Would you be ok with - instead of |
@bhousel Thanks for the feedback! I definitely see your point about the messy tags, I'll try to come up with a fix. I think eventually we'll need to figure out a way to give translatable labels to the common values of
For some reason I thought this would be difficult or confusing but now that you write it out it looks really cool and more obvious. Allowing the same preset to inherit from multiple others would be pretty powerful. I'll look into this more. |
# Conflicts: # data/presets/presets.json
…an just the parent preset
@bhousel Like you suggested, I changed it so specific presets must be targeted instead of I kept it so the parent preset's fields are still used if the field properties are omitted. I think this behavior is helpful for quickly adding new presets and it can easily be overridden. I'm not sure what the best method is for ignoring the "Type" fields of target presets. I might strip the target's fields that map to the tags defining the source preset, but I'm not sure that's desirable in all cases. |
I ended up doing this. I'd consider changing it back once we can figure out translatable labels for common |
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.
Looks great! OK to merge 👍
Closes #5710.
The biggest user-facing implication of this change is that, by default, specified presets will retain the generic fields that define them. So the
shop
field will be present on essentially allshop
features. I actually don't mind this behavior. It let's users quickly fix mistagged or accidentally-tagged features (see #5611), and more clearly indicates how the tagging/preset system works. If we do go this route I think it'd be wise to rename fields namedType
with more specific labels.Todo