Skip to content
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

Garage(s): Only keep capacity as fields #423

Merged
merged 4 commits into from
May 12, 2022
Merged

Conversation

tordans
Copy link
Collaborator

@tordans tordans commented Mar 22, 2022

Move fields from from https://github.com/openstreetmap/id-tagging-schema/blob/main/data/presets/building.json to the moreFields section to only show very relevant fields by default.

When using those presets I noticed that I tend to add the capacity to the level or height fields instead of the capacity fields. Since those (and all other) are not really common on garages, we should move the to the moreFields.


Would it be possible to write the code like this which could result in the same but a better data structure. However, I am not sure if the moreField would just merge the fields + moreFields values if used like this.

{
    "icon": "fas-warehouse",
    "fields": [
        "capacity"
    ],
    "moreFields": [
        "{building}"
    ],
}

Move fields from from https://github.com/openstreetmap/id-tagging-schema/blob/main/data/presets/building.json to the moreFields section to only show very relevant fields by default.
@tordans tordans changed the title garages: Only keep capacity as field Garages: Only keep capacity as fields Mar 22, 2022
@tordans tordans changed the title Garages: Only keep capacity as fields Garage(s): Only keep capacity as fields Mar 22, 2022
… and use template syntax to tidy up moreFields list slightly
and also copy "moreFields" from building/garages preset
@tyrasd
Copy link
Member

tyrasd commented May 12, 2022

Would it be possible to write the code like this which could result in the same but a better data structure.

This inheritance works separately for fields and moreFields: In your example, this would only copy the moreFields from the building preset into the garages preset. I've tweaked your PR to use this inheritance to get rid of some of the fields in the list.

See ideditor/schema-builder#53 for further potential enhancements in this direction.

@tyrasd tyrasd merged commit 7b1b424 into openstreetmap:main May 12, 2022
@tordans tordans deleted the patch-3 branch May 13, 2022 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants