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

feat: Updating "Label" Seed file to align with future seed logic changes #3037

Closed
wants to merge 15 commits into from

Conversation

catduckgnaf
Copy link

@catduckgnaf catduckgnaf commented Jan 23, 2024

What type of PR is this?

  • cleanup
  • feature

What this PR does / why we need it:

  • The goal of this PR is to work towards having improved seed files and improved seed logic.
  • I took very detailed file from @hay-kot and organized all the labels and formatted JSON correctly
  • much better seed files, that are aligned with together, with labels and foods.
  • some aliases are added
  • plurals are added

Which issue(s) this PR fixes:

Special notes for your reviewer:

  • I would like feedback on the label categories, to make sure they are appropriate.
  • I also have attached the updated "Master" Seed file. I would appreciate feedback on that as well as how to potentially implement the seed logic
  • I added colors to the seed file. I have no opinion and they were picked at random.

Testing

Validated JSON

catduckgnaf and others added 2 commits January 22, 2024 19:45
updating food labels to new format,
need to look at seed logic to complete mealie-recipes#1230. New JSON seed file in english https://paste.catduck.net/view/iCWk7fo
@catduckgnaf catduckgnaf changed the title Updating "Label" Seed file to align with future seed logic changes feat: Updating "Label" Seed file to align with future seed logic changes Jan 23, 2024
@Kuchenpirat
Copy link
Collaborator

  1. So taking a look at the labels, i would say the categories are pretty good, can't think of any missing. Personally i would put the spices of "Herbs and Spices" into "Seasonings & Spice Blends" maybe just rename that "Spices and Seasonings".

  2. Currently the seeds are completely seperate from each other, so you would need to rewrite the seed logic to to first seed the labels and then seed the actual foods. The Frontend should also reflect that one is about to seed labels and foods at once i would say. But i think you should be able to reuse a lot of the existing code basis.

  3. Regarding the colors i had mine organized to roughly represent something of the group. So "Meats" would be red, "Nuts & Seeds" a shade of brown and "Dairy & Egs" in white ....
    There are 30 categories which means there will be similarities between the colors, but i think it makes more sense than to pic a random color.

@catduckgnaf
Copy link
Author

  1. So taking a look at the labels, i would say the categories are pretty good, can't think of any missing. Personally i would put the spices of "Herbs and Spices" into "Seasonings & Spice Blends" maybe just rename that "Spices and Seasonings".

    1. Currently the seeds are completely seperate from each other, so you would need to rewrite the seed logic to to first seed the labels and then seed the actual foods. The Frontend should also reflect that one is about to seed labels and foods at once i would say. But i think you should be able to reuse a lot of the existing code basis.

    2. Regarding the colors i had mine organized to roughly represent something of the group. So "Meats" would be red, "Nuts & Seeds" a shade of brown and "Dairy & Egs" in white ....
      There are 30 categories which means there will be similarities between the colors, but i think it makes more sense than to pic a random color.

Thanks, for now I think simply updating the current seed files are the way to go. I plan to go through and add some color logic.
Also if you take a look, I added TONS of foods, with some aliases as well as labels. and plurals. So if someone imports the new labels, then the new foods, that should import the foods with the labels, the plurals, and aliases.

My thoughts are to merge that, let things get translated (for everyone) before changing seed logic?

@hay-kot
Copy link
Collaborator

hay-kot commented Jan 26, 2024

My initial feedback is that I'm not sure that this is the right format when we consider translations

    {
        "label": "Supplements & Extracts",
        "aliases": [],
        "description": "",
        "name": "lemon extract",
        "pluralName": "lemon extracts"
    }

Each entry is going to have to be translated so the labels will have the be translated multiple times in the translation UI.

Would reworking the structure into a nested field work better?

 {
  "label": "Some label"
  "foods": [
    ...foods
  ]
 }

Then we can manage all the seeds and stuff in one place. This also might make it easier to do seeding by language.


My thoughts are to merge that, let things get translated (for everyone) before changing seed logic?

I don't think this is really possible. we don't want to ship anything half implemented, and we always want everything in the mealie-next branch to be release ready so we can push a release whenever we need to. I think the way to go is to get the new format and seeder figured out, and then migrate the existing translations into the new format, that way we can at least get a head start on the translations and those who already put in a ton of work don't lose their progress.

@catduckgnaf
Copy link
Author

@hay-kot I did it the way I did, because that matched how things looked both currently, and how an export looked.
I feel your solution could become more complicated with nest structured. Would it be even more complicated to instead of it being nested, simply having 22 or so Seed Files for each food category? So essentially multiple files, however every food in that file belongs to the same label?

@hay-kot hay-kot marked this pull request as draft February 2, 2024 23:53
@Kuchenpirat
Copy link
Collaborator

Hey, do you plan on continuing to work on this?
If yes and you have any questions feel free to reach out.

@catduckgnaf
Copy link
Author

I want too, some things came up. I'm concerned about my ability to do the bigger changes required, not having as much experience. Let me try to dive into again within the next few weeks

@Kuchenpirat Kuchenpirat removed the stale label Mar 12, 2024
@Kuchenpirat
Copy link
Collaborator

I'll go ahead an close this PR for now.

Feel free to reopen if you come back to this.

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.

[v1.0.0b] [Task] - Link food labels to foods when importing seed data
3 participants