diff --git a/frontend/components/Domain/Recipe/RecipeDialogBulkAdd.vue b/frontend/components/Domain/Recipe/RecipeDialogBulkAdd.vue index 4a38a039d300..bc893174ed5f 100644 --- a/frontend/components/Domain/Recipe/RecipeDialogBulkAdd.vue +++ b/frontend/components/Domain/Recipe/RecipeDialogBulkAdd.vue @@ -8,50 +8,71 @@ - {{ $t("new-recipe.bulk-add") }} + + + {{ $globals.icons.createAlt }} + + {{ $t("new-recipe.bulk-add") }} + + -

- {{ $t("new-recipe.paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list") }} -

- + + + Trim Whitespace
+ - {{ $t("general.save") }} +
- diff --git a/frontend/components/Domain/Recipe/RecipeIngredientEditor.vue b/frontend/components/Domain/Recipe/RecipeIngredientEditor.vue index c6fd9924d62e..1a22e698fccc 100644 --- a/frontend/components/Domain/Recipe/RecipeIngredientEditor.vue +++ b/frontend/components/Domain/Recipe/RecipeIngredientEditor.vue @@ -84,7 +84,7 @@ diff --git a/frontend/components/Domain/Recipe/RecipeInstructions.vue b/frontend/components/Domain/Recipe/RecipeInstructions.vue index 11f43b5127d9..679a10c6d706 100644 --- a/frontend/components/Domain/Recipe/RecipeInstructions.vue +++ b/frontend/components/Domain/Recipe/RecipeInstructions.vue @@ -96,6 +96,7 @@ export default { default: true, }, }, + data() { return { disabledSteps: [], diff --git a/frontend/components/Domain/Recipe/RecipeSettingsMenu.vue b/frontend/components/Domain/Recipe/RecipeSettingsMenu.vue index 1bb68d26c671..82fe4ccb58dd 100644 --- a/frontend/components/Domain/Recipe/RecipeSettingsMenu.vue +++ b/frontend/components/Domain/Recipe/RecipeSettingsMenu.vue @@ -16,14 +16,14 @@ - + diff --git a/frontend/components/global/RecipeJsonEditor.vue b/frontend/components/global/RecipeJsonEditor.vue new file mode 100644 index 000000000000..f4a59ba6eb53 --- /dev/null +++ b/frontend/components/global/RecipeJsonEditor.vue @@ -0,0 +1,22 @@ + + + + diff --git a/frontend/composables/use-recipe-context.ts b/frontend/composables/use-recipe-context.ts index adfd1eb10f76..3136cd76b0f4 100644 --- a/frontend/composables/use-recipe-context.ts +++ b/frontend/composables/use-recipe-context.ts @@ -14,9 +14,17 @@ export const useRecipeContext = function () { }, slug); loading.value = false; + return recipe; } + async function fetchRecipe(slug: string) { + loading.value = true; + const { data } = await api.recipes.getOne(slug); + loading.value = false; + return data; + } + async function deleteRecipe(slug: string) { loading.value = true; const { data } = await api.recipes.deleteOne(slug); @@ -31,5 +39,5 @@ export const useRecipeContext = function () { return data; } - return { loading, getBySlug, deleteRecipe, updateRecipe }; + return { loading, getBySlug, deleteRecipe, updateRecipe, fetchRecipe }; }; diff --git a/frontend/composables/use-uuid.ts b/frontend/composables/use-uuid.ts new file mode 100644 index 000000000000..db9ed61f988b --- /dev/null +++ b/frontend/composables/use-uuid.ts @@ -0,0 +1,12 @@ +const max = 1000000; + +export function uniqueId() { + return Date.now() + Math.random() * max; +} + +export function uuid4() { + // @ts-ignore + return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) => + (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16) + ); +} diff --git a/frontend/pages/recipe/_slug/index.vue b/frontend/pages/recipe/_slug/index.vue index b6fc913e9c0c..860ee8e05da1 100644 --- a/frontend/pages/recipe/_slug/index.vue +++ b/frontend/pages/recipe/_slug/index.vue @@ -1,16 +1,16 @@