diff --git a/frontend/src/components/Recipe/RecipeEditor/ExtrasEditor.vue b/frontend/src/components/Recipe/RecipeEditor/ExtrasEditor.vue
deleted file mode 100644
index 6acf9165b..000000000
--- a/frontend/src/components/Recipe/RecipeEditor/ExtrasEditor.vue
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
- {{ $t("recipe.api-extras") }}
-
-
-
- {{ $t("recipe.api-extras") }}
-
-
-
-
-
- mdi-delete
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t("recipe.add-key") }}
-
-
-
- {{ $t("general.save") }}
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/src/components/Recipe/RecipeEditor/index.vue b/frontend/src/components/Recipe/RecipeEditor/index.vue
index 0c14f5939..b8b894d78 100644
--- a/frontend/src/components/Recipe/RecipeEditor/index.vue
+++ b/frontend/src/components/Recipe/RecipeEditor/index.vue
@@ -64,55 +64,7 @@
- {{ $t("recipe.ingredients") }}
-
-
-
-
-
-
- mdi-arrow-up-down
-
-
- mdi-delete
-
-
-
-
-
-
-
-
-
-
- mdi-plus
-
-
+
{{ $t("recipe.categories") }}
-
- {{ $t("recipe.notes") }}
-
-
-
-
- mdi-delete
-
-
-
-
-
-
-
-
-
-
- mdi-plus
-
-
-
+
@@ -183,6 +97,7 @@
mdi-plus
+
const UPLOAD_EVENT = "upload";
-import draggable from "vuedraggable";
-import utils from "@/utils";
import BulkAdd from "@/components/Recipe/Parts/Helpers/BulkAdd";
-import ExtrasEditor from "./ExtrasEditor";
+import ExtrasEditor from "@/components/Recipe/Parts/Helpers/ExtrasEditor";
import CategoryTagSelector from "@/components/FormHelpers/CategoryTagSelector";
import ImageUploadBtn from "@/components/Recipe/Parts/Helpers/ImageUploadBtn";
import { validators } from "@/mixins/validators";
import Nutrition from "@/components/Recipe/Parts/Nutrition";
import Instructions from "@/components/Recipe/Parts/Instructions";
+import Ingredients from "@/components/Recipe/Parts/Ingredients";
import Assets from "@/components/Recipe/Parts/Assets.vue";
+import Notes from "@/components/Recipe/Parts/Notes.vue";
export default {
components: {
BulkAdd,
ExtrasEditor,
- draggable,
CategoryTagSelector,
Nutrition,
ImageUploadBtn,
Instructions,
+ Ingredients,
Assets,
+ Notes,
},
props: {
value: Object,
@@ -224,42 +140,13 @@ export default {
mixins: [validators],
data() {
return {
- drag: false,
fileObject: null,
- lastTitleIndex: 0,
};
},
methods: {
- validateTitle(title) {
- return !(title === null || title === "");
- },
uploadImage(fileObject) {
this.$emit(UPLOAD_EVENT, fileObject);
},
- toggleDisabled(stepIndex) {
- if (this.disabledSteps.includes(stepIndex)) {
- const index = this.disabledSteps.indexOf(stepIndex);
- if (index !== -1) {
- this.disabledSteps.splice(index, 1);
- }
- } else {
- this.disabledSteps.push(stepIndex);
- }
- },
- isDisabled(stepIndex) {
- return this.disabledSteps.includes(stepIndex) ? "disabled-card" : null;
- },
- generateKey(item, index) {
- return utils.generateUniqueKey(item, index);
- },
- addIngredient(ingredients = null) {
- if (ingredients.length) {
- this.value.recipeIngredient.push(...ingredients);
- } else {
- this.value.recipeIngredient.push("");
- }
- },
-
appendSteps(steps) {
this.value.recipeInstructions.push(
...steps.map(x => ({
@@ -270,15 +157,9 @@ export default {
addStep() {
this.value.recipeInstructions.push({ text: "" });
},
- addNote() {
- this.value.notes.push({ text: "" });
- },
saveExtras(extras) {
this.value.extras = extras;
},
- removeByIndex(list, index) {
- list.splice(index, 1);
- },
validateRecipe() {
return this.$refs.form.validate();
},
diff --git a/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue b/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue
deleted file mode 100644
index c3bec8215..000000000
--- a/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
{{ $t("recipe.ingredients") }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/src/components/Recipe/RecipeViewer/Notes.vue b/frontend/src/components/Recipe/RecipeViewer/Notes.vue
deleted file mode 100644
index e25701d27..000000000
--- a/frontend/src/components/Recipe/RecipeViewer/Notes.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
{{ $t("recipe.notes") }}
-
- {{ note.title }}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/src/components/Recipe/RecipeViewer/index.vue b/frontend/src/components/Recipe/RecipeViewer/index.vue
index 9b88d43b3..2430dca6b 100644
--- a/frontend/src/components/Recipe/RecipeViewer/index.vue
+++ b/frontend/src/components/Recipe/RecipeViewer/index.vue
@@ -31,17 +31,29 @@
-
+
-
-
-
+
+
+ {{ $t("recipe.categories") }}
+
+
+
+
+
+
+
+
+ {{ $t("recipe.tags") }}
+
+
+
+
+
+
+
-
+
+
@@ -88,8 +100,8 @@ import Nutrition from "@/components/Recipe/Parts/Nutrition";
import VueMarkdown from "@adapttive/vue-markdown";
import utils from "@/utils";
import RecipeChips from "./RecipeChips";
-import Notes from "./Notes";
-import Ingredients from "./Ingredients";
+import Notes from "@/components/Recipe/Parts/Notes";
+import Ingredients from "@/components/Recipe/Parts/Ingredients";
import Instructions from "@/components/Recipe/Parts/Instructions.vue";
import Assets from "../Parts/Assets.vue";
export default {
@@ -104,6 +116,7 @@ export default {
},
props: {
name: String,
+ slug: String,
description: String,
ingredients: Array,
instructions: Array,