From c2a219fb4ad468944afe42058e67036ddd546e2e Mon Sep 17 00:00:00 2001 From: Hayden Date: Sun, 3 Jan 2021 20:10:25 -0900 Subject: [PATCH 01/66] clear notes --- dev/dev-notes.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/dev/dev-notes.md b/dev/dev-notes.md index 86d47ce2104a..95cd32e1cb52 100644 --- a/dev/dev-notes.md +++ b/dev/dev-notes.md @@ -41,15 +41,3 @@ Backend # Draft Changelog ## v0.0.2 -General -- Fixed opacity issues with marked steps - [mtoohey31](https://github.com/mtoohey31) -- Updated Favicon -- Renamed Frontend Window -- Added Debug folder to dump scraper data prior to processing. -- Improved documentation -- Added version tag / relevant links, and new version notifier - -Recipes -- Added user feedback on bad URL. -- Better backend data validation for updating recipes, avoid small syntax errors corrupting database entry. [Issue #8](https://github.com/hay-kot/mealie/issues/8) -- Fixed spacing issue while editing new recipes in JSON From f6ec9a5c1cf4bf10bdcf3d3a56c9a6ce96449d95 Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 4 Jan 2021 16:41:13 -0900 Subject: [PATCH 02/66] confirmation dialog --- frontend/src/components/UI/Confirmation.vue | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 frontend/src/components/UI/Confirmation.vue diff --git a/frontend/src/components/UI/Confirmation.vue b/frontend/src/components/UI/Confirmation.vue new file mode 100644 index 000000000000..d58e31f8f238 --- /dev/null +++ b/frontend/src/components/UI/Confirmation.vue @@ -0,0 +1,44 @@ + + + + + \ No newline at end of file From cd4694d85ea8ecd611a6f11319661deee609959c Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 4 Jan 2021 16:44:45 -0900 Subject: [PATCH 03/66] resolve dev issues --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 486f3fec7365..5bf8b9c09f79 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ __pycache__/ *.py[cod] *$py.class -frontend/.env.development +# frontend/.env.development docs/site/ mealie/data/backups/* @@ -11,6 +11,7 @@ mealie/data/debug/* mealie/data/img/* #Exception to keep folders +!mealie/dist/.gitkeep !mealie/data/backups/.gitkeep !mealie/data/backups/dev_sample_data* !mealie/data/debug/.gitkeep From 1aa9cbeebb417c7e95b23d6939ff72da659d3642 Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 4 Jan 2021 16:49:03 -0900 Subject: [PATCH 04/66] Confirmation.vue start --- .gitignore | 9 ++++----- frontend/.env.development | 1 + frontend/src/components/UI/Confirmation.vue | 19 ++++++------------- mealie/dist/.gitkeep | 0 4 files changed, 11 insertions(+), 18 deletions(-) create mode 100644 frontend/.env.development create mode 100644 mealie/dist/.gitkeep diff --git a/.gitignore b/.gitignore index 5bf8b9c09f79..b2aee14eace5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ docs/site/ mealie/data/backups/* mealie/data/debug/* mealie/data/img/* +!mealie/dist/* #Exception to keep folders !mealie/dist/.gitkeep @@ -19,12 +20,12 @@ mealie/data/img/* .DS_Store node_modules -/dist + # local env files .env.local .env.*.local -.env.development + # Log files npm-debug.log* @@ -49,7 +50,7 @@ pnpm-debug.log* env/ build/ develop-eggs/ -dist/ + downloads/ eggs/ .eggs/ @@ -144,5 +145,3 @@ ENV/ # Node Modules node_modules/ - -/*.env.development* \ No newline at end of file diff --git a/frontend/.env.development b/frontend/.env.development new file mode 100644 index 000000000000..bd3a290a5d3d --- /dev/null +++ b/frontend/.env.development @@ -0,0 +1 @@ +VUE_APP_API_BASE_URL=http://10.10.10.12:9921 \ No newline at end of file diff --git a/frontend/src/components/UI/Confirmation.vue b/frontend/src/components/UI/Confirmation.vue index d58e31f8f238..0437e3561a61 100644 --- a/frontend/src/components/UI/Confirmation.vue +++ b/frontend/src/components/UI/Confirmation.vue @@ -3,22 +3,12 @@ From URL - - - - - - - Looks like there was an error parsing the URL. Check the log and - debug/last_recipe.json to see what went wrong. - - - - + - Submit + Exit + Confirm @@ -36,6 +26,9 @@ export default { confirm() { this.$emit("confirm"); }, + exit() { + // do something? + } }, }; diff --git a/mealie/dist/.gitkeep b/mealie/dist/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 From 8dc7f0663dc28c3b81fdf5ba77bac7051c94930e Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 4 Jan 2021 17:17:06 -0900 Subject: [PATCH 05/66] create new recipe without image --- frontend/src/components/NewRecipe.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/NewRecipe.vue b/frontend/src/components/NewRecipe.vue index 76fed90cac6d..da46271eed84 100644 --- a/frontend/src/components/NewRecipe.vue +++ b/frontend/src/components/NewRecipe.vue @@ -83,12 +83,19 @@ export default { onFileChange() { this.image = URL.createObjectURL(this.fileObject); }, + async createRecipe() { this.isLoading = true; - this.recipeDetails.image = this.fileObject.name; + + if (this.fileObject) { + this.recipeDetails.image = this.fileObject.name; + } let slug = await api.recipes.create(this.recipeDetails); - await api.recipes.updateImage(slug, this.fileObject); + if (this.fileObject) { + await api.recipes.updateImage(slug, this.fileObject); + } + this.isLoading = false; this.$router.push(`/recipe/${slug}`); From 92f00f41c645b4437726acbe609705ad8744b737 Mon Sep 17 00:00:00 2001 From: zackbcom Date: Mon, 4 Jan 2021 23:10:14 -0600 Subject: [PATCH 06/66] Adding in Confirmation logic. --- frontend/src/components/UI/ButtonRow.vue | 17 ++++- frontend/src/components/UI/Confirmation.vue | 72 +++++++++++++++------ 2 files changed, 69 insertions(+), 20 deletions(-) diff --git a/frontend/src/components/UI/ButtonRow.vue b/frontend/src/components/UI/ButtonRow.vue index aec3c8cb8490..1a5a6d539c21 100644 --- a/frontend/src/components/UI/ButtonRow.vue +++ b/frontend/src/components/UI/ButtonRow.vue @@ -5,7 +5,9 @@
mdi-delete + + mdi-content-save @@ -27,6 +29,9 @@ export default { default: true, }, }, + components: { + Confirmation: () => import("../UI/Confirmation"), + }, methods: { editor() { this.$emit("editor"); @@ -34,8 +39,16 @@ export default { save() { this.$emit("save"); }, - deleteRecipe() { - this.$emit("delete"); + async deleteRecipe() { + if ( + await this.$refs.confirm.open( + "Delete Recpie", + "Are you sure you want to delete this recipie?", + { color: "error", icon: "mdi-alert-circle" } + ) + ) { + this.$emit("delete"); + } }, json() { this.$emit("json"); diff --git a/frontend/src/components/UI/Confirmation.vue b/frontend/src/components/UI/Confirmation.vue index 0437e3561a61..46fe6ae70d85 100644 --- a/frontend/src/components/UI/Confirmation.vue +++ b/frontend/src/components/UI/Confirmation.vue @@ -1,14 +1,27 @@ From de17085e04d5106d7d304b47ef88cc3d40e01195 Mon Sep 17 00:00:00 2001 From: Hayden Date: Tue, 5 Jan 2021 17:54:47 -0900 Subject: [PATCH 28/66] npm package update --- frontend/package-lock.json | 32 ++++++++++++++++---------------- frontend/package.json | 10 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index b18d4febd91b..1e3d3094c05b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -2481,9 +2481,9 @@ "dev": true }, "axios": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz", - "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { "follow-redirects": "^1.10.0" } @@ -3740,9 +3740,9 @@ } }, "core-js": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.1.tgz", - "integrity": "sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg==" + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.2.tgz", + "integrity": "sha512-FfApuSRgrR6G5s58casCBd9M2k+4ikuu4wbW6pJyYU7bd9zvFc9qf7vr5xmrZOhT9nn+8uwlH1oRR9jTnFoA3A==" }, "core-js-compat": { "version": "3.7.0", @@ -9082,7 +9082,7 @@ }, "rechoir": { "version": "0.6.2", - "resolved": "https://registry.npm.taobao.org/rechoir/download/rechoir-0.6.2.tgz", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { @@ -9448,9 +9448,9 @@ "dev": true }, "sass": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.30.0.tgz", - "integrity": "sha512-26EUhOXRLaUY7+mWuRFqGeGGNmhB1vblpTENO1Z7mAzzIZeVxZr9EZoaY1kyGLFWdSOZxRMAufiN2mkbO6dAlw==", + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.32.0.tgz", + "integrity": "sha512-fhyqEbMIycQA4blrz/C0pYhv2o4x2y6FYYAH0CshBw3DXh5D5wyERgxw0ptdau1orc/GhNrhF7DFN2etyOCEng==", "dev": true, "requires": { "chokidar": ">=2.0.0 <4.0.0" @@ -11029,9 +11029,9 @@ "integrity": "sha1-9evU+mvShpQD4pqJau1JBEVskSM=" }, "vue-cli-plugin-vuetify": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.0.8.tgz", - "integrity": "sha512-BHn9wwj/+B9v25mhZq2dV8NafM2LbogymjluPP+CjDnIdcwR3hW38r3nyKsZNPB1jXfWXsvVszipS3b8FqOBCg==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.0.9.tgz", + "integrity": "sha512-J4fzpz27OmCCAA3CI56ulYsUrZ859dQAh58Z9XZilY03kd/M+svLlPkK45cBIrGGfjSqQ40oyWezA3NiPBEG8g==", "dev": true, "requires": { "null-loader": "^3.0.0", @@ -11249,9 +11249,9 @@ "dev": true }, "vuetify": { - "version": "2.3.21", - "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.3.21.tgz", - "integrity": "sha512-c9FOjkpVPDoIim88wbfqSIuCsH3jtgQQBC1iMW+ZFxf/Bj+d73HySL2LhEnZwAQT7XTAUGfad4aLPfcNZzK5YQ==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.4.1.tgz", + "integrity": "sha512-gFLq3LYh8xJlMmt8Vw+DSYb0NTE0Q7fRMqZMkO/EOba4l2Agssw8Qupy+zhicgJxbbb4FEkD24nuh+EuGeuB+A==" }, "vuetify-loader": { "version": "1.6.0", diff --git a/frontend/package.json b/frontend/package.json index 9e33391e2f1d..17dfefb37958 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,15 +8,15 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "axios": "^0.21.0", - "core-js": "^3.8.1", + "axios": "^0.21.1", + "core-js": "^3.8.2", "qs": "^6.9.4", "v-jsoneditor": "^1.4.2", "vue": "^2.6.11", "vue-cookies": "^1.7.4", "vue-html-to-paper": "^1.3.1", "vue-router": "^3.4.9", - "vuetify": "^2.3.21", + "vuetify": "^2.4.1", "vuex": "^3.6.0" }, "devDependencies": { @@ -26,9 +26,9 @@ "babel-eslint": "^10.1.0", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", - "sass": "^1.30.0", + "sass": "^1.32.0", "sass-loader": "^8.0.0", - "vue-cli-plugin-vuetify": "^2.0.8", + "vue-cli-plugin-vuetify": "^2.0.9", "vue-template-compiler": "^2.6.11", "vuetify-loader": "^1.3.0" }, From b099da573c172ab859aaec4e893a3bac20b72728 Mon Sep 17 00:00:00 2001 From: zackbcom Date: Tue, 5 Jan 2021 23:26:59 -0600 Subject: [PATCH 29/66] Added | System Dark mode. Streamlined themes --- frontend/src/App.vue | 23 ++- frontend/src/components/Admin/Theme.vue | 182 +++++++++++++++--------- frontend/src/store/store.js | 78 +++++++--- 3 files changed, 190 insertions(+), 93 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index a5c69bd11082..11b321b41192 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -2,7 +2,7 @@ - + mdi-silverware-variant @@ -44,32 +44,43 @@ export default { Menu, AddRecipe, SearchHeader, - SnackBar, + SnackBar }, watch: { $route() { this.search = false; - }, + } }, mounted() { this.$store.dispatch("initCookies"); this.$store.dispatch("requestRecentRecipes"); + this.darkModeAddEventListener(); }, data: () => ({ - search: false, + search: false }), methods: { + /** + * This will monitor the OS level darkmode and call to update dark mode. + */ + darkModeAddEventListener() { + const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)"); + + darkMediaQuery.addEventListener("change", () => { + this.$store.commit("setDarkMode", "system"); + }); + }, toggleSearch() { if (this.search === true) { this.search = false; } else { this.search = true; } - }, - }, + } + } }; diff --git a/frontend/src/components/Admin/Theme.vue b/frontend/src/components/Admin/Theme.vue index 392f58a9a31f..28f441bbcc8a 100644 --- a/frontend/src/components/Admin/Theme.vue +++ b/frontend/src/components/Admin/Theme.vue @@ -1,69 +1,114 @@ - - \ No newline at end of file diff --git a/frontend/src/components/Admin/Backup.vue b/frontend/src/components/Settings/Backup/index.vue similarity index 99% rename from frontend/src/components/Admin/Backup.vue rename to frontend/src/components/Settings/Backup/index.vue index e986a43858c7..1117bfc33adf 100644 --- a/frontend/src/components/Admin/Backup.vue +++ b/frontend/src/components/Settings/Backup/index.vue @@ -62,7 +62,8 @@ diff --git a/frontend/src/components/Admin/Admin.vue b/frontend/src/pages/SettingsPage.vue similarity index 87% rename from frontend/src/components/Admin/Admin.vue rename to frontend/src/pages/SettingsPage.vue index ed6948c14f19..0f33d8c06025 100644 --- a/frontend/src/components/Admin/Admin.vue +++ b/frontend/src/pages/SettingsPage.vue @@ -27,10 +27,10 @@ + + \ 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 de60a558c1fd..5710e6a489f2 100644 --- a/frontend/src/components/Recipe/RecipeEditor/index.vue +++ b/frontend/src/components/Recipe/RecipeEditor/index.vue @@ -129,6 +129,7 @@ mdi-plus + @@ -178,9 +179,11 @@ import api from "../../../api"; import utils from "../../../utils"; import BulkAdd from "./BulkAdd"; +import ExtrasEditor from "./ExtrasEditor"; export default { components: { BulkAdd, + ExtrasEditor, }, props: { value: Object, @@ -188,13 +191,6 @@ export default { data() { return { fileObject: null, - content: this.value, - disabledSteps: [], - description: String, - ingredients: Array, - instructions: Array, - categories: Array, - tags: Array, }; }, methods: { @@ -270,6 +266,9 @@ export default { removeTags(index) { this.value.tags.splice(index, 1); }, + saveExtras(extras) { + this.value.extras = extras; + }, }, }; diff --git a/mealie/services/recipe_services.py b/mealie/services/recipe_services.py index aeffbe5fd485..83bfb490b557 100644 --- a/mealie/services/recipe_services.py +++ b/mealie/services/recipe_services.py @@ -42,7 +42,7 @@ class Recipe(BaseModel): rating: Optional[int] rating: Optional[int] orgURL: Optional[str] - extras: Optional[List[str]] + extras: Optional[dict] class Config: schema_extra = { @@ -67,6 +67,9 @@ class Recipe(BaseModel): "notes": [{"title": "Watch Out!", "text": "Prep the day before!"}], "orgURL": "https://www.bonappetit.com/recipe/chicken-and-rice-with-leeks-and-salsa-verde", "rating": 3, + "extras": { + "message": "Don't forget to defrost the chicken!" + } } } @@ -101,8 +104,11 @@ class Recipe(BaseModel): def save_to_db(self) -> str: recipe_dict = self.dict() - extension = Path(recipe_dict["image"]).suffix - recipe_dict["image"] = recipe_dict.get("slug") + extension + try: + extension = Path(recipe_dict["image"]).suffix + recipe_dict["image"] = recipe_dict.get("slug") + extension + except: + recipe_dict["image"] = "no image" try: total_time = recipe_dict.get("totalTime") From 7b6fdc76196c2b0ae518ac1e3a5e6ecc358add49 Mon Sep 17 00:00:00 2001 From: Hayden Date: Fri, 8 Jan 2021 19:57:28 -0900 Subject: [PATCH 56/66] ui color/theme improvement --- dev/dev-notes.md | 19 +++++++++++++------ .../components/MealPlan/MealPlanEditor.vue | 5 ++--- .../src/components/MealPlan/MealPlanNew.vue | 5 ++--- .../Recipe/RecipeEditor/ExtrasEditor.vue | 5 +++-- .../src/components/Recipe/RecipeViewer.vue | 4 ++-- .../src/components/Settings/Backup/index.vue | 7 +++---- .../components/Settings/Migration/index.vue | 5 ++--- .../Settings/Theme/NewThemeDialog.vue | 2 +- .../src/components/Settings/Theme/index.vue | 11 +++++++---- .../src/components/Settings/Webhook/index.vue | 2 +- frontend/src/pages/MealPlanPage.vue | 3 ++- frontend/src/pages/SettingsPage.vue | 6 +++--- 12 files changed, 41 insertions(+), 33 deletions(-) diff --git a/dev/dev-notes.md b/dev/dev-notes.md index 4e85b43eb004..a1b0d7108e40 100644 --- a/dev/dev-notes.md +++ b/dev/dev-notes.md @@ -17,13 +17,13 @@ Don't forget to [join the Discord](https://discord.gg/R6QDyJgbD2)! # Todo's Frontend -- [ ] .Vue file reorganized into something that makes sense +- [x] .Vue file reorganized into something that makes sense - [ ] Recipe Print Page - [x] Catch 400 / bad response on create from URL - [ ] Recipe Editor Data Validation Client Side - [x] Favicon - [x] Rename Window -- [ ] Add version indicator and notification for new version available +- [x] Add version indicator and notification for new version available - [ ] Enhanced Search Functionality - [ ] Organize Home Page my Category, ideally user selectable. @@ -42,13 +42,20 @@ Backend ## v0.0.2 Bug Fixes -- Added API Key Extras to Recipe Data - Fixed opacity issues with marked steps - [mtoohey31](https://github.com/mtoohey31) - Fixed hot-reloading development environment - [grssmnn](https://github.com/grssmnn) -- Added Confirmation component to deleting recipes - [zackbcom](https://github.com/zackbcom) -- Added Persistent storage to vuex - [zackbcom](https://github.com/zackbcom) -- Updated Theme backend - [zackbcom](https://github.com/zackbcom) +- Fixed recipe not saving without image +- Fixed parsing error on image property null General Improvements +- Added Confirmation component to deleting recipes - [zackbcom](https://github.com/zackbcom) +- Updated Theme backend - [zackbcom](https://github.com/zackbcom) +- Added Persistent storage to vuex - [zackbcom](https://github.com/zackbcom) +- General Color/Theme Improvements + - More consistent UI + - More minimalist coloring +- Added API Key Extras to Recipe Data + - Users can now add custom json key/value pairs to all recipes via the editor for access in 3rd part applications. For example users can add a "message" field in the extras that can be accessed on API calls to play a message over google home. - Improved image rendering (nearly x2 speed) - Improved documentation + API Documentation +- Improved recipe parsing diff --git a/frontend/src/components/MealPlan/MealPlanEditor.vue b/frontend/src/components/MealPlan/MealPlanEditor.vue index 61cb58f7e7da..e1164fce2385 100644 --- a/frontend/src/components/MealPlan/MealPlanEditor.vue +++ b/frontend/src/components/MealPlan/MealPlanEditor.vue @@ -1,8 +1,7 @@