diff --git a/vue3/src/components/dialogs/MealPlanDialog.vue b/vue3/src/components/dialogs/MealPlanDialog.vue
index 49badc59b..0b1d40998 100644
--- a/vue3/src/components/dialogs/MealPlanDialog.vue
+++ b/vue3/src/components/dialogs/MealPlanDialog.vue
@@ -18,7 +18,7 @@
prepend-icon=""
prepend-inner-icon="$calendar"
>
-
+
diff --git a/vue3/src/components/display/HorizontalMealPlanWindow.vue b/vue3/src/components/display/HorizontalMealPlanWindow.vue
index 864fffcec..355b2878a 100644
--- a/vue3/src/components/display/HorizontalMealPlanWindow.vue
+++ b/vue3/src/components/display/HorizontalMealPlanWindow.vue
@@ -84,12 +84,11 @@ const meal_plan_grid = computed(() => {
for (const x of Array(4).keys()) {
let grid_day_date = DateTime.now().plus({days: x})
- console.log('going trough days ', x, grid_day_date)
grid.push({
date: grid_day_date,
create_default_date: grid_day_date.toISODate(), // improve meal plan edit modal to do formatting itself and accept dates
date_label: grid_day_date.toLocaleString(DateTime.DATE_MED),
- plan_entries: useMealPlanStore().plan_list.filter((m: MealPlan) => ((DateTime.fromJSDate(m.fromDate).startOf('day') <= grid_day_date.startOf('day')) && (DateTime.fromJSDate((m.toDate != undefined) ? m.toDate : m.fromDate).startOf('day') >= grid_day_date.startOf('day')))),
+ plan_entries: useMealPlanStore().planList.filter((m: MealPlan) => ((DateTime.fromJSDate(m.fromDate).startOf('day') <= grid_day_date.startOf('day')) && (DateTime.fromJSDate((m.toDate != undefined) ? m.toDate : m.fromDate).startOf('day') >= grid_day_date.startOf('day')))),
} as MealPlanGridItem)
}
diff --git a/vue3/src/components/display/VSnackbarQueued.vue b/vue3/src/components/display/VSnackbarQueued.vue
index 22f1f1241..751c45b63 100644
--- a/vue3/src/components/display/VSnackbarQueued.vue
+++ b/vue3/src/components/display/VSnackbarQueued.vue
@@ -49,17 +49,26 @@ const props = defineProps({
}
})
-
+// ID of message timeout currently running
const timeoutId = ref(-1)
+// currently visible message
const visibleMessage = ref({} as Message)
+// visible state binding of snackbar
const showSnackbar = ref(false)
+/**
+ * subscribe to mutation of the snackbarQueue to detect new messages being added
+ */
useMessageStore().$subscribe((mutation, state) => {
if ('snackbarQueue' in state && mutation.events.type == 'add') {
processQueue()
}
})
+/**
+ * process snackbar queue
+ * show oldest message for desired time and remove it afterwards
+ */
function processQueue() {
if (timeoutId.value == -1 && useMessageStore().snackbarQueue.length > 0) {
visibleMessage.value = useMessageStore().snackbarQueue[0]
@@ -72,6 +81,10 @@ function processQueue() {
}
}
+/**
+ * after item timeout has been reached remove it from the list
+ * and restart processing the queue to check for new items
+ */
function removeItem() {
showSnackbar.value = false
clearTimeout(timeoutId.value)
diff --git a/vue3/src/components/inputs/ModelSelect.vue b/vue3/src/components/inputs/ModelSelect.vue
index 7484be229..810e14324 100644
--- a/vue3/src/components/inputs/ModelSelect.vue
+++ b/vue3/src/components/inputs/ModelSelect.vue
@@ -9,6 +9,8 @@
:resolve-on-load="false"
v-model="model"
:options="search"
+ :on-create="createObject"
+ :createOption="allowCreate"
:delay="300"
:object="true"
:valueProp="itemValue"
@@ -29,13 +31,12 @@