From 2e112cd6c049aed45095cb471ea2be50c1a8a575 Mon Sep 17 00:00:00 2001 From: Wetzel402 Date: Thu, 19 Sep 2024 18:42:12 +0000 Subject: [PATCH 1/4] modified: frontend/pages/group/data/labels.vue modified: frontend/pages/shopping-lists/_id.vue --- frontend/pages/group/data/labels.vue | 2 +- frontend/pages/shopping-lists/_id.vue | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/pages/group/data/labels.vue b/frontend/pages/group/data/labels.vue index ece501144fe..09b9dd9583a 100644 --- a/frontend/pages/group/data/labels.vue +++ b/frontend/pages/group/data/labels.vue @@ -231,7 +231,7 @@ export default defineComponent({ editLabel.value = item; if (!editLabel.value.color) { - editLabel.value.color = "#E0E0E0"; + editLabel.value.color = "#757575"; } } diff --git a/frontend/pages/shopping-lists/_id.vue b/frontend/pages/shopping-lists/_id.vue index 09ba649fa3d..09172dac3e9 100644 --- a/frontend/pages/shopping-lists/_id.vue +++ b/frontend/pages/shopping-lists/_id.vue @@ -56,14 +56,12 @@
-
+
- - - {{ $globals.icons.tags }} - - - {{ key }} +
+ {{ key }} +
+
From c131e1d0ca9f9fe97096fe95e9cd75976a26c8b7 Mon Sep 17 00:00:00 2001 From: Wetzel402 Date: Thu, 19 Sep 2024 19:09:40 +0000 Subject: [PATCH 2/4] modified: mealie/schema/labels/multi_purpose_label.py --- mealie/schema/labels/multi_purpose_label.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mealie/schema/labels/multi_purpose_label.py b/mealie/schema/labels/multi_purpose_label.py index 04430b37349..1e98fd11a34 100644 --- a/mealie/schema/labels/multi_purpose_label.py +++ b/mealie/schema/labels/multi_purpose_label.py @@ -10,7 +10,7 @@ class MultiPurposeLabelCreate(MealieModel): name: str - color: str = "#E0E0E0" + color: str = "#757575" class MultiPurposeLabelSave(MultiPurposeLabelCreate): From f7930d793f93fabc59b1b7944b560dee8b3f4559 Mon Sep 17 00:00:00 2001 From: Wetzel402 Date: Fri, 20 Sep 2024 17:32:32 +0000 Subject: [PATCH 3/4] modified: frontend/pages/group/data/labels.vue modified: frontend/pages/shopping-lists/_id.vue modified: mealie/schema/labels/multi_purpose_label.py --- frontend/pages/group/data/labels.vue | 2 +- frontend/pages/shopping-lists/_id.vue | 241 ++++++++------------ mealie/schema/labels/multi_purpose_label.py | 2 +- 3 files changed, 91 insertions(+), 154 deletions(-) diff --git a/frontend/pages/group/data/labels.vue b/frontend/pages/group/data/labels.vue index 09b9dd9583a..f6d0888d394 100644 --- a/frontend/pages/group/data/labels.vue +++ b/frontend/pages/group/data/labels.vue @@ -231,7 +231,7 @@ export default defineComponent({ editLabel.value = item; if (!editLabel.value.color) { - editLabel.value.color = "#757575"; + editLabel.value.color = "#959595"; } } diff --git a/frontend/pages/shopping-lists/_id.vue b/frontend/pages/shopping-lists/_id.vue index 09172dac3e9..3501733b194 100644 --- a/frontend/pages/shopping-lists/_id.vue +++ b/frontend/pages/shopping-lists/_id.vue @@ -17,7 +17,8 @@ - + @@ -27,29 +28,18 @@ - +
- + - +
@@ -57,39 +47,25 @@
-
-
- {{ key }} -
- +
+ {{ key }}
- + + - +
- +
@@ -100,100 +76,74 @@ - + - +
- +
- {{ $t('shopping-list.reorder-labels') }} - {{ $t('general.add') }} + {{ $t('general.add') }}
- +
@@ -210,16 +160,9 @@
- +
@@ -235,7 +178,9 @@ {{ $globals.icons.primary }} - {{ $tc('shopping-list.linked-recipes-count', shoppingList.recipeReferences ? shoppingList.recipeReferences.length : 0) }} + {{ $tc('shopping-list.linked-recipes-count', shoppingList.recipeReferences ? + shoppingList.recipeReferences.length + : 0) }}
@@ -260,11 +205,7 @@
- + {{ $t('general.settings') }} @@ -273,11 +214,7 @@
- +
@@ -406,11 +343,11 @@ export default defineComponent({ } // if the refresh was unsuccessful, the shopping list will be null, so we increment the attempt counter - attempts ++; + attempts++; } catch (error) { - attempts ++; + attempts++; } // if we hit too many errors, stop polling @@ -690,8 +627,8 @@ export default defineComponent({ function sortItems(a: ShoppingListItemOut | ListItemGroup, b: ShoppingListItemOut | ListItemGroup) { return ( ((a.position || 0) > (b.position || 0)) || - ((a.createdAt || "") < (b.createdAt || "")) - ? 1 : -1 + ((a.createdAt || "") < (b.createdAt || "")) + ? 1 : -1 ); } @@ -702,7 +639,7 @@ export default defineComponent({ const checkedItemKey = "__checkedItem" const listItemGroupsMap = new Map(); - listItemGroupsMap.set(checkedItemKey, {position: Number.MAX_SAFE_INTEGER, createdAt: "", items: []}); + listItemGroupsMap.set(checkedItemKey, { position: Number.MAX_SAFE_INTEGER, createdAt: "", items: [] }); // group items by checked status, food, or note shoppingList.value.listItems.forEach((item) => { @@ -712,7 +649,7 @@ export default defineComponent({ const group = listItemGroupsMap.get(key); if (!group) { - listItemGroupsMap.set(key, {position: item.position || 0, createdAt: item.createdAt || "", items: [item]}); + listItemGroupsMap.set(key, { position: item.position || 0, createdAt: item.createdAt || "", items: [item] }); } else { group.items.push(item); } @@ -940,10 +877,10 @@ export default defineComponent({ loadingCounter.value -= 1; if (shoppingList.value.listItems) { - // add the item to the list immediately so the user sees the change - shoppingList.value.listItems.push(createListItemData.value); - updateListItemOrder(); - } + // add the item to the list immediately so the user sees the change + shoppingList.value.listItems.push(createListItemData.value); + updateListItemOrder(); + } createListItemData.value = listItemFactory(createListItemData.value.isFood || false); refresh(); } @@ -1039,7 +976,7 @@ export default defineComponent({ loadingCounter.value += 1; const { data } = await userApi.shopping.lists.updateOne( shoppingList.value.id, - {...shoppingList.value, userId: currentUserId.value}, + { ...shoppingList.value, userId: currentUserId.value }, ); loadingCounter.value -= 1; diff --git a/mealie/schema/labels/multi_purpose_label.py b/mealie/schema/labels/multi_purpose_label.py index 1e98fd11a34..934f29f1485 100644 --- a/mealie/schema/labels/multi_purpose_label.py +++ b/mealie/schema/labels/multi_purpose_label.py @@ -10,7 +10,7 @@ class MultiPurposeLabelCreate(MealieModel): name: str - color: str = "#757575" + color: str = "#959595" class MultiPurposeLabelSave(MultiPurposeLabelCreate): From 49937ba4ace0b2115b76dbfaa4fe96348b8cf714 Mon Sep 17 00:00:00 2001 From: Wetzel402 Date: Fri, 20 Sep 2024 17:58:00 +0000 Subject: [PATCH 4/4] modified: frontend/pages/shopping-lists/_id.vue --- frontend/pages/shopping-lists/_id.vue | 235 ++++++++++++++++---------- 1 file changed, 148 insertions(+), 87 deletions(-) diff --git a/frontend/pages/shopping-lists/_id.vue b/frontend/pages/shopping-lists/_id.vue index 3501733b194..1b44825f6e7 100644 --- a/frontend/pages/shopping-lists/_id.vue +++ b/frontend/pages/shopping-lists/_id.vue @@ -17,8 +17,7 @@ - + @@ -28,18 +27,29 @@ - +
- + - +
@@ -50,22 +60,34 @@
{{ key }}
- - + + - +
- +
@@ -76,74 +98,100 @@ - + - +
- +
- {{ $t('shopping-list.reorder-labels') }} - {{ $t('general.add') }} + {{ $t('general.add') }}
- +
@@ -160,9 +208,16 @@
- +
@@ -178,9 +233,7 @@ {{ $globals.icons.primary }} - {{ $tc('shopping-list.linked-recipes-count', shoppingList.recipeReferences ? - shoppingList.recipeReferences.length - : 0) }} + {{ $tc('shopping-list.linked-recipes-count', shoppingList.recipeReferences ? shoppingList.recipeReferences.length : 0) }}
@@ -205,7 +258,11 @@
- + {{ $t('general.settings') }} @@ -214,7 +271,11 @@
- +
@@ -343,11 +404,11 @@ export default defineComponent({ } // if the refresh was unsuccessful, the shopping list will be null, so we increment the attempt counter - attempts++; + attempts ++; } catch (error) { - attempts++; + attempts ++; } // if we hit too many errors, stop polling @@ -627,8 +688,8 @@ export default defineComponent({ function sortItems(a: ShoppingListItemOut | ListItemGroup, b: ShoppingListItemOut | ListItemGroup) { return ( ((a.position || 0) > (b.position || 0)) || - ((a.createdAt || "") < (b.createdAt || "")) - ? 1 : -1 + ((a.createdAt || "") < (b.createdAt || "")) + ? 1 : -1 ); } @@ -639,7 +700,7 @@ export default defineComponent({ const checkedItemKey = "__checkedItem" const listItemGroupsMap = new Map(); - listItemGroupsMap.set(checkedItemKey, { position: Number.MAX_SAFE_INTEGER, createdAt: "", items: [] }); + listItemGroupsMap.set(checkedItemKey, {position: Number.MAX_SAFE_INTEGER, createdAt: "", items: []}); // group items by checked status, food, or note shoppingList.value.listItems.forEach((item) => { @@ -649,7 +710,7 @@ export default defineComponent({ const group = listItemGroupsMap.get(key); if (!group) { - listItemGroupsMap.set(key, { position: item.position || 0, createdAt: item.createdAt || "", items: [item] }); + listItemGroupsMap.set(key, {position: item.position || 0, createdAt: item.createdAt || "", items: [item]}); } else { group.items.push(item); } @@ -877,10 +938,10 @@ export default defineComponent({ loadingCounter.value -= 1; if (shoppingList.value.listItems) { - // add the item to the list immediately so the user sees the change - shoppingList.value.listItems.push(createListItemData.value); - updateListItemOrder(); - } + // add the item to the list immediately so the user sees the change + shoppingList.value.listItems.push(createListItemData.value); + updateListItemOrder(); + } createListItemData.value = listItemFactory(createListItemData.value.isFood || false); refresh(); } @@ -976,7 +1037,7 @@ export default defineComponent({ loadingCounter.value += 1; const { data } = await userApi.shopping.lists.updateOne( shoppingList.value.id, - { ...shoppingList.value, userId: currentUserId.value }, + {...shoppingList.value, userId: currentUserId.value}, ); loadingCounter.value -= 1;