const UPLOAD_EVENT = "upload";
-import draggable from "vuedraggable";
-import utils from "@/utils";
-import BulkAdd from "./BulkAdd";
-import ExtrasEditor from "./ExtrasEditor";
+import BulkAdd from "@/components/Recipe/Parts/Helpers/BulkAdd";
+import ExtrasEditor from "@/components/Recipe/Parts/Helpers/ExtrasEditor";
import CategoryTagSelector from "@/components/FormHelpers/CategoryTagSelector";
-import NutritionEditor from "./NutritionEditor";
-import ImageUploadBtn from "./ImageUploadBtn.vue";
+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,
- NutritionEditor,
+ Nutrition,
ImageUploadBtn,
+ Instructions,
+ Ingredients,
+ Assets,
+ Notes,
},
props: {
value: Object,
@@ -242,7 +140,6 @@ export default {
mixins: [validators],
data() {
return {
- drag: false,
fileObject: null,
};
},
@@ -250,30 +147,6 @@ export default {
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) {
- this.value.recipeIngredient.push(...ingredients);
- } else {
- this.value.recipeIngredient.push("");
- }
- },
-
appendSteps(steps) {
this.value.recipeInstructions.push(
...steps.map(x => ({
@@ -284,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/Steps.vue b/frontend/src/components/Recipe/RecipeViewer/Steps.vue
deleted file mode 100644
index 4b674668e..000000000
--- a/frontend/src/components/Recipe/RecipeViewer/Steps.vue
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
{{ $t("recipe.instructions") }}
-
-
- {{
- $t("recipe.step-index", { step: index + 1 })
- }}
-
-
-
-
-
-
-
-
-
-
-
\ 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 813a8d5ab..da878c8d9 100644
--- a/frontend/src/components/Recipe/RecipeViewer/index.vue
+++ b/frontend/src/components/Recipe/RecipeViewer/index.vue
@@ -31,16 +31,30 @@
-
+
-
-
-
-
+
+
+ {{ $t("recipe.categories") }}
+
+
+
+
+
+
+
+
+ {{ $t("recipe.tags") }}
+
+
+
+
+
+
+
+
+
-
+
+
@@ -82,24 +97,27 @@