-
-
Notifications
You must be signed in to change notification settings - Fork 849
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: Option to automatically create share links for recipes in recipe actions #4676
base: mealie-next
Are you sure you want to change the base?
feat: Option to automatically create share links for recipes in recipe actions #4676
Conversation
This PR is stale because it has been open 45 days with no activity. |
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! Sorry for taking so long on this, holidays beat me up. One change to remove an API call and we're all set.
Would you also be able to add this to the docs? Just add it to the list of merge fields and a short (one sentence) description. And then also maybe change the Bring example to use the new field (instead of url
).
https://docs.mealie.io/documentation/getting-started/features/#recipe-actions
/* eslint-disable no-template-curly-in-string */ | ||
const shareLinkRegex = /\$\{share-link-expires-seconds-[0-9]+\}/g; | ||
const group = (await api.groups.getOne(recipe.groupId || "")).data; |
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.
You should be able to grab the slug from the URL instead of fetching it via the API:
import { useRoute } from "@nuxtjs/composition-api";
// put this right under "useUserApi"
const route = useRoute();
// replace the API call with this
const groupSlug = route.value.params.groupSlug || recipe.groupId || "";
Thanks, good to hear! I am unfortunately unavailable till the start of February, but I will have a look at it then Greetings |
This PR is stale because it has been open 45 days with no activity. |
What type of PR is this?
What this PR does / why we need it:
Currently, when using a recipe action on a recipe that is not publicly available (due to recipe, group or household being private), the receiving service will not be able to read the recipe data.
As discussed in #4619, this PR implements an additional template option for recipe actions. The option
${share-link-expires-seconds-<x>}
is automatically replaced by a newly created share link that expires afterx
seconds. This makes share links usable even on private recipes, groups and households.Which issue(s) this PR fixes:
Fixes #4619
Special notes for your reviewer:
I am not completely certain, if the method to obtain the group slug is correct. Please check this part thoroughly.
Also, i have not yet created documentation for the new option - is the website documentation part of this repository?
Testing
I created a private recipe, a public recipe and multipe recipe actions
I also tested with different privacy settings in group and household. The receiver of the given action was always able to read the recipes, without being logged in using the share link.