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

Improve diet multi combo in editor #611

Closed
wants to merge 2 commits into from
Closed

Conversation

Robot8A
Copy link
Contributor

@Robot8A Robot8A commented Jul 22, 2023

Add support for values other than yes in multi combo.
Solves issue #496

@Robot8A
Copy link
Contributor Author

Robot8A commented Jul 22, 2023

This previous edit will allow values to be not only vegetarian, vegan... but also vegetarian=yes, vegetarian=only, ...
It splits the values with the = sign, if the key is split in two, there is a match and gets the second part as the value, otherwise still add =yes.

@Zverik
Copy link
Owner

Zverik commented Jul 23, 2023

Sorry, I struggle to find where this edit makes sense. Could you point me at a field that has an equals sign in its key?

@Robot8A
Copy link
Contributor Author

Robot8A commented Jul 23, 2023

On the iD tagging schema it does not. My idea was to change the keys on the preset.db so they somehow could store both the key and value (in this case with an equal sign).

So if in the iD tagging schema we would change

{
    "key": "diet:",
    "type": "multiCombo",
    "label": "Diet Types",
    "terms": [
        "gluten free",
        "fruitarian",
        "halal",
        "kosher",
        "lactose free",
        "meat",
        "pescatarian",
        "raw",
        "vegan",
        "vegetarian"
    ],
    "strings": {
        "options": {
            "vegetarian": "Vegetarian",
            "vegan": "Vegan",
            "halal": "Halal",
            "gluten_free": "Gluten-Free",
            "kosher": "Kosher",
            "lactose_free": "Lactose-Free",
            "pescetarian": "Pescetarian"
        }
    }
}

to

{
    "key": "diet:",
    "type": "multiCombo",
    "label": "Diet Types",
    "terms": [
        "gluten free",
        "fruitarian",
        "halal",
        "kosher",
        "lactose free",
        "meat",
        "pescatarian",
        "raw",
        "vegan",
        "vegetarian"
    ],
    "strings": {
        "options": {
            "vegetarian=only": "Vegetarian only",
            "vegetarian=yes": "Vegetarian friendly",
            "vegetarian=no": "Vegetarian no",
            ...
        }
    }
}

then it would work with my edit. But maybe it is not the way it should go, I am completely new to the code on this two repositories, so I may not be understanding the whole picture. Then maybe a new combo type should be discussed on the iD tagging repo.

@Zverik
Copy link
Owner

Zverik commented Sep 28, 2023

So this PR and suggestions sadly do not work, but I'll try to come up with another solution :) Thanks for having worked on this Héctor!

@Zverik Zverik closed this Sep 28, 2023
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.

None yet

2 participants