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

Feature: Improve Public URL Readability #2482

Conversation

michael-genson
Copy link
Collaborator

What type of PR is this?

(REQUIRED)

  • feature

What this PR does / why we need it:

(REQUIRED)

The current public URLs are kinda gross:
https://demo.mealie.io/explore/recipes/49279644-6d42-4f5f-80c1-c2e07e599974/easy-30-minute-homemade-chicken-tortilla-soup

So this PR makes them look like this:
https://demo.mealie.io/explore/recipes/home/easy-30-minute-homemade-chicken-tortilla-soup

This is done by adding a slug to groups (which appears in the URL). Similar to the recipe id/slug implementation in #2265, you can pass either an id or a slug, so old public URLs still work, we just generate URLs with slugs now.

Which issue(s) this PR fixes:

(REQUIRED)

N/A

Special notes for your reviewer:

(fill-in or delete this section)

I originally intended to use the group name instead of adding a slug, but unfortunately while group names are unique, they are case sensitive in most databases (including both sqlite and postgres, by default), so "Home" and "home" are both independently valid group names. This is unfortunate because, while URLs definitely can be case-sensitive, it's easy to run into issues with that.

Plus, subjectively, I like how it looks better:
https://demo.mealie.io/explore/recipes/home/easy-30-minute-homemade-chicken-tortilla-soup
https://demo.mealie.io/explore/recipes/Home/easy-30-minute-homemade-chicken-tortilla-soup

Testing

(fill-in or delete this section)

Updated pytest and also manually tested the new public route as well as the old public route (both work).

Release Notes

(REQUIRED)

made public URLs prettier

@michael-genson
Copy link
Collaborator Author

Hopefully #2472 fixes the flaky search test

@hay-kot hay-kot merged commit 095edef into mealie-recipes:mealie-next Aug 20, 2023
7 checks passed
@hay-kot
Copy link
Collaborator

hay-kot commented Aug 20, 2023

Amazing work!

@michael-genson michael-genson deleted the feat/improve-public-url-readability branch August 20, 2023 18:48
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