mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
fixed MealPlanEditor closing when changing date
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
"vue-router": "^4.5.0",
|
||||
"vue-simple-calendar": "7.1.0",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"vuetify": "^3.8.2"
|
||||
"vuetify": "^3.8.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fortawesome/fontawesome-free": "^6.7.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<v-dialog max-width="1400" :activator="dialogActivator" v-model="model">
|
||||
<component :is="editorComponent" :item="props.item" :item-id="props.itemId" @create="createEvent" @save="saveEvent" @delete="deleteEvent" dialog @close="model = false" :itemDefaults="props.itemDefaults"></component>
|
||||
<v-dialog max-width="1400" :activator="dialogActivator" v-model="dialog">
|
||||
<component :is="editorComponent" :item="props.item" :item-id="props.itemId" @create="createEvent" @save="saveEvent" @delete="deleteEvent" dialog @close="dialog = false; " :itemDefaults="props.itemDefaults"></component>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
@@ -30,8 +30,8 @@ const props = defineProps({
|
||||
|
||||
const editorComponent = shallowRef(defineAsyncComponent(() => import(`@/components/model_editors/${getGenericModelFromString(props.model, t).model.name}Editor.vue`)))
|
||||
|
||||
const model = defineModel<Boolean|undefined>({default: undefined})
|
||||
const dialogActivator = (model.value !== undefined) ? undefined : props.activator
|
||||
const dialog = defineModel<Boolean|undefined>({default: undefined})
|
||||
const dialogActivator = (dialog.value !== undefined) ? undefined : props.activator
|
||||
|
||||
/**
|
||||
* for some reason editorComponent is not updated automatically when prop is changed
|
||||
@@ -44,8 +44,8 @@ watch(() => props.model, () => {
|
||||
/**
|
||||
* Allow opening the model edit dialog trough v-model property of the dialog by watching for model changes
|
||||
*/
|
||||
watch(model, (value, oldValue, onCleanup) => {
|
||||
model.value = !!value
|
||||
watch(dialog, (value, oldValue, onCleanup) => {
|
||||
dialog.value = !!value
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -54,7 +54,7 @@ watch(model, (value, oldValue, onCleanup) => {
|
||||
*/
|
||||
function createEvent(arg: any) {
|
||||
emit('create', arg)
|
||||
model.value = model.value && !props.closeAfterCreate
|
||||
dialog.value = dialog.value && !props.closeAfterCreate
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,7 +63,7 @@ function createEvent(arg: any) {
|
||||
*/
|
||||
function saveEvent(arg: any) {
|
||||
emit('save', arg)
|
||||
model.value = model.value && !props.closeAfterSave
|
||||
dialog.value = dialog.value && !props.closeAfterSave
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ function saveEvent(arg: any) {
|
||||
*/
|
||||
function deleteEvent(arg: any) {
|
||||
emit('delete', arg)
|
||||
model.value = model.value && !props.closeAfterDelete
|
||||
dialog.value = dialog.value && !props.closeAfterDelete
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import {nextTick, onMounted, PropType, ref} from "vue";
|
||||
import {nextTick, onMounted, PropType, ref, toRaw} from "vue";
|
||||
import {ApiApi, MealPlan, MealType, ShoppingListRecipe} from "@/openapi";
|
||||
import ModelEditorBase from "@/components/model_editors/ModelEditorBase.vue";
|
||||
import {useModelEditorFunctions} from "@/composables/useModelEditorFunctions";
|
||||
@@ -179,6 +179,7 @@ onMounted(() => {
|
||||
editingObjChanged.value = false
|
||||
})
|
||||
}, existingItemFunction: () => {
|
||||
editingObj.value = structuredClone(toRaw(editingObj.value))
|
||||
initializeDateRange()
|
||||
loadShoppingListEntries()
|
||||
}
|
||||
@@ -200,7 +201,6 @@ function updateDate() {
|
||||
}
|
||||
} else {
|
||||
useMessageStore().addMessage(MessageType.WARNING, 'Missing Date', 7000)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,11 +227,6 @@ function initializeDateRange() {
|
||||
}
|
||||
}
|
||||
|
||||
function formatDate(date: Date) {
|
||||
console.log('called date format')
|
||||
return DateTime.fromJSDate(date).toLocaleString()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -59,7 +59,6 @@ export function useModelEditorFunctions<T>(modelName: EditorSupportedModels, emi
|
||||
function applyItemDefaults(itemDefaults: T) {
|
||||
if (Object.keys(itemDefaults).length > 0) {
|
||||
Object.keys(itemDefaults).forEach(k => {
|
||||
console.log('applying default ', k, itemDefaults[k])
|
||||
editingObj.value[k] = itemDefaults[k]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -543,6 +543,9 @@ export const TCookLog = {
|
||||
icon: 'fa-solid fa-table-list',
|
||||
|
||||
isPaginated: true,
|
||||
disableCreate: true,
|
||||
disableUpdate: true,
|
||||
disableDelete: true,
|
||||
toStringKeys: ['recipe'],
|
||||
|
||||
tableHeaders: [
|
||||
@@ -560,6 +563,9 @@ export const TViewLog = {
|
||||
icon: 'fa-solid fa-clock-rotate-left',
|
||||
|
||||
isPaginated: true,
|
||||
disableCreate: true,
|
||||
disableUpdate: true,
|
||||
disableDelete: true,
|
||||
toStringKeys: ['recipe'],
|
||||
|
||||
tableHeaders: [
|
||||
|
||||
118
vue3/yarn.lock
118
vue3/yarn.lock
@@ -739,11 +739,6 @@ iconv-lite@0.6.3:
|
||||
dependencies:
|
||||
safer-buffer ">= 2.1.2 < 3.0.0"
|
||||
|
||||
idb@^7.0.1:
|
||||
version "7.1.1"
|
||||
resolved "https://registry.yarnpkg.com/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b"
|
||||
integrity sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==
|
||||
|
||||
is-potential-custom-element-name@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5"
|
||||
@@ -780,36 +775,6 @@ jsdom@^26.1.0:
|
||||
ws "^8.18.0"
|
||||
xml-name-validator "^5.0.0"
|
||||
|
||||
lodash.assign@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7"
|
||||
integrity sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==
|
||||
|
||||
lodash.defaults@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
|
||||
integrity sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==
|
||||
|
||||
lodash.foreach@^4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53"
|
||||
integrity sha512-aEXTF4d+m05rVOAUG3z4vZZ4xVexLKZGF0lIxuHZ1Hplpk/3B6Z1+/ICICYRLm7c41Z2xiejbkCkJoTlypoXhQ==
|
||||
|
||||
lodash.frompairs@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.frompairs/-/lodash.frompairs-4.0.1.tgz#bc4e5207fa2757c136e573614e9664506b2b1bd2"
|
||||
integrity sha512-dvqe2I+cO5MzXCMhUnfYFa9MD+/760yx2aTAN1lqEcEkf896TxgrX373igVdqSJj6tQd0jnSLE1UMuKufqqxFw==
|
||||
|
||||
lodash.get@^4.4.2:
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
|
||||
integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==
|
||||
|
||||
lodash.topairs@^4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.topairs/-/lodash.topairs-4.3.0.tgz#3b6deaa37d60fb116713c46c5f17ea190ec48d64"
|
||||
integrity sha512-qrRMbykBSEGdOgQLJJqVSdPWMD7Q+GJJ5jMRfQYb+LTLsw3tYVIabnCzRqTJb2WTo17PG5gNzXuFaZgYH/9SAQ==
|
||||
|
||||
lru-cache@^10.4.3:
|
||||
version "10.4.3"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119"
|
||||
@@ -1109,10 +1074,10 @@ vuedraggable@^4.1.0:
|
||||
dependencies:
|
||||
sortablejs "1.14.0"
|
||||
|
||||
vuetify@^3.8.2:
|
||||
version "3.8.2"
|
||||
resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-3.8.2.tgz#59799811a6e97154ee238981b2926b166ff14ae2"
|
||||
integrity sha512-UJNFP4egmKJTQ3V3MKOq+7vIUKO7/Fko5G6yUsOW2Rm0VNBvAjgO6VY6EnK3DTqEKN6ugVXDEPw37NQSTGLZvw==
|
||||
vuetify@^3.8.9:
|
||||
version "3.8.9"
|
||||
resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-3.8.9.tgz#cc31bd2bf8695ac4788316c449ff67fac68a1f35"
|
||||
integrity sha512-X9kCxeqf7w5sca2Mfn4NCVsDDimi81jxKyqsZHjW0XG/rTdtwRFKttxOcv0Mmi+67ulPjDZywA7pBFK0rxoafA==
|
||||
|
||||
w3c-xmlserializer@^5.0.0:
|
||||
version "5.0.0"
|
||||
@@ -1126,18 +1091,6 @@ webidl-conversions@^7.0.0:
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a"
|
||||
integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==
|
||||
|
||||
webpack-bundle-tracker@3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/webpack-bundle-tracker/-/webpack-bundle-tracker-3.0.1.tgz#dd4809cd22b231b296dfef5634353d875b1502f2"
|
||||
integrity sha512-q0/19A1gpP74oBC3rgveDBh09D1RGpLvREEOmen9eonTbcuhNAyLkfmfoQeOm+j4k26f+Q2mJSzEXoPu42gBFg==
|
||||
dependencies:
|
||||
lodash.assign "^4.2.0"
|
||||
lodash.defaults "^4.2.0"
|
||||
lodash.foreach "^4.5.0"
|
||||
lodash.frompairs "^4.0.1"
|
||||
lodash.get "^4.4.2"
|
||||
lodash.topairs "^4.3.0"
|
||||
|
||||
whatwg-encoding@^3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz#d0f4ef769905d426e1688f3e34381a99b60b76e5"
|
||||
@@ -1158,69 +1111,6 @@ whatwg-url@^14.0.0, whatwg-url@^14.1.1:
|
||||
tr46 "^5.1.0"
|
||||
webidl-conversions "^7.0.0"
|
||||
|
||||
workbox-background-sync@^7.0.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-7.3.0.tgz#b6340731a8d5b42b9e75a8a87c8806928e6e6303"
|
||||
integrity sha512-PCSk3eK7Mxeuyatb22pcSx9dlgWNv3+M8PqPaYDokks8Y5/FX4soaOqj3yhAZr5k6Q5JWTOMYgaJBpbw11G9Eg==
|
||||
dependencies:
|
||||
idb "^7.0.1"
|
||||
workbox-core "7.3.0"
|
||||
|
||||
workbox-core@6.6.1:
|
||||
version "6.6.1"
|
||||
resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-6.6.1.tgz#7184776d4134c5ed2f086878c882728fc9084265"
|
||||
integrity sha512-ZrGBXjjaJLqzVothoE12qTbVnOAjFrHDXpZe7coCb6q65qI/59rDLwuFMO4PcZ7jcbxY+0+NhUVztzR/CbjEFw==
|
||||
|
||||
workbox-core@7.3.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-7.3.0.tgz#f24fb92041a0b7482fe2dd856544aaa9fa105248"
|
||||
integrity sha512-Z+mYrErfh4t3zi7NVTvOuACB0A/jA3bgxUN3PwtAVHvfEsZxV9Iju580VEETug3zYJRc0Dmii/aixI/Uxj8fmw==
|
||||
|
||||
workbox-expiration@^7.0.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.yarnpkg.com/workbox-expiration/-/workbox-expiration-7.3.0.tgz#2c1ee1fdada34aa7e7474f706d5429c914bd10d2"
|
||||
integrity sha512-lpnSSLp2BM+K6bgFCWc5bS1LR5pAwDWbcKt1iL87/eTSJRdLdAwGQznZE+1czLgn/X05YChsrEegTNxjM067vQ==
|
||||
dependencies:
|
||||
idb "^7.0.1"
|
||||
workbox-core "7.3.0"
|
||||
|
||||
workbox-navigation-preload@^7.0.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.yarnpkg.com/workbox-navigation-preload/-/workbox-navigation-preload-7.3.0.tgz#9d54693b9179d5175e66af5ef9a92d1b7cf3e605"
|
||||
integrity sha512-fTJzogmFaTv4bShZ6aA7Bfj4Cewaq5rp30qcxl2iYM45YD79rKIhvzNHiFj1P+u5ZZldroqhASXwwoyusnr2cg==
|
||||
dependencies:
|
||||
workbox-core "7.3.0"
|
||||
|
||||
workbox-precaching@^7.0.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.yarnpkg.com/workbox-precaching/-/workbox-precaching-7.3.0.tgz#a84663d69efdb334f25c04dba0a72ed3391c4da8"
|
||||
integrity sha512-ckp/3t0msgXclVAYaNndAGeAoWQUv7Rwc4fdhWL69CCAb2UHo3Cef0KIUctqfQj1p8h6aGyz3w8Cy3Ihq9OmIw==
|
||||
dependencies:
|
||||
workbox-core "7.3.0"
|
||||
workbox-routing "7.3.0"
|
||||
workbox-strategies "7.3.0"
|
||||
|
||||
workbox-routing@7.3.0, workbox-routing@^7.0.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.yarnpkg.com/workbox-routing/-/workbox-routing-7.3.0.tgz#fc86296bc1155c112ee2c16b3180853586c30208"
|
||||
integrity sha512-ZUlysUVn5ZUzMOmQN3bqu+gK98vNfgX/gSTZ127izJg/pMMy4LryAthnYtjuqcjkN4HEAx1mdgxNiKJMZQM76A==
|
||||
dependencies:
|
||||
workbox-core "7.3.0"
|
||||
|
||||
workbox-strategies@7.3.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-7.3.0.tgz#bb1530f205806895aacdea3639e6cf6bfb3a6cb0"
|
||||
integrity sha512-tmZydug+qzDFATwX7QiEL5Hdf7FrkhjaF9db1CbB39sDmEZJg3l9ayDvPxy8Y18C3Y66Nrr9kkN1f/RlkDgllg==
|
||||
dependencies:
|
||||
workbox-core "7.3.0"
|
||||
|
||||
workbox-strategies@^6.2.4:
|
||||
version "6.6.1"
|
||||
resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-6.6.1.tgz#38d0f0fbdddba97bd92e0c6418d0b1a2ccd5b8bf"
|
||||
integrity sha512-WQLXkRnsk4L81fVPkkgon1rZNxnpdO5LsO+ws7tYBC6QQQFJVI6v98klrJEjFtZwzw/mB/HT5yVp7CcX0O+mrw==
|
||||
dependencies:
|
||||
workbox-core "6.6.1"
|
||||
|
||||
ws@^8.18.0:
|
||||
version "8.18.1"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.1.tgz#ea131d3784e1dfdff91adb0a4a116b127515e3cb"
|
||||
|
||||
Reference in New Issue
Block a user