mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-21 05:53:36 -07:00
opinionated comment cleanup
This commit is contained in:
parent
7e5924d692
commit
798f5a36cc
4 changed files with 3 additions and 18 deletions
|
@ -11,18 +11,12 @@ export function useShoppingListCopy() {
|
||||||
|
|
||||||
function copyListItems(itemsByLabel: { [key: string]: ShoppingListItemOut[] }, copyType: CopyTypes) {
|
function copyListItems(itemsByLabel: { [key: string]: ShoppingListItemOut[] }, copyType: CopyTypes) {
|
||||||
const text: string[] = [];
|
const text: string[] = [];
|
||||||
|
|
||||||
// Copy text into subsections based on label
|
|
||||||
Object.entries(itemsByLabel).forEach(([label, items], idx) => {
|
Object.entries(itemsByLabel).forEach(([label, items], idx) => {
|
||||||
// for every group except the first, add a blank line
|
|
||||||
if (idx) {
|
if (idx) {
|
||||||
text.push("");
|
text.push("");
|
||||||
}
|
}
|
||||||
|
|
||||||
// add an appropriate heading for the label depending on the copy format
|
|
||||||
text.push(formatCopiedLabelHeading(copyType, label));
|
text.push(formatCopiedLabelHeading(copyType, label));
|
||||||
|
|
||||||
// now add the appropriately formatted list items with the given label
|
|
||||||
items.forEach(item => text.push(formatCopiedListItem(copyType, item)));
|
items.forEach(item => text.push(formatCopiedListItem(copyType, item)));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,6 @@ export function useShoppingListCrud(
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Individual item operations
|
|
||||||
function saveListItem(item: ShoppingListItemOut) {
|
function saveListItem(item: ShoppingListItemOut) {
|
||||||
if (!shoppingList.value) {
|
if (!shoppingList.value) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -52,7 +52,7 @@ export function useShoppingListPage(listId: string) {
|
||||||
|
|
||||||
const refresh = () => baseRefresh(updateListItemOrder);
|
const refresh = () => baseRefresh(updateListItemOrder);
|
||||||
|
|
||||||
// Initialize labels
|
// Initialize shopping list labels
|
||||||
const labels = useShoppingListLabels(shoppingList);
|
const labels = useShoppingListLabels(shoppingList);
|
||||||
|
|
||||||
// Initialize copy functionality
|
// Initialize copy functionality
|
||||||
|
@ -164,8 +164,6 @@ export function useShoppingListPage(listId: string) {
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// State - flatten the dialog state for easier access
|
|
||||||
...state.state,
|
|
||||||
shoppingList,
|
shoppingList,
|
||||||
loadingCounter,
|
loadingCounter,
|
||||||
recipeReferenceLoading,
|
recipeReferenceLoading,
|
||||||
|
@ -179,13 +177,10 @@ export function useShoppingListPage(listId: string) {
|
||||||
itemsByLabel,
|
itemsByLabel,
|
||||||
isOffline,
|
isOffline,
|
||||||
|
|
||||||
// Labels
|
// Sub-composables
|
||||||
|
...state.state,
|
||||||
...labels,
|
...labels,
|
||||||
|
|
||||||
// CRUD operations
|
|
||||||
...crud,
|
...crud,
|
||||||
|
|
||||||
// Recipe management
|
|
||||||
...recipes,
|
...recipes,
|
||||||
|
|
||||||
// Specialized functions
|
// Specialized functions
|
||||||
|
|
|
@ -398,10 +398,7 @@ export default defineNuxtComponent({
|
||||||
const groupSlug = computed(() => route.params.groupSlug as string || $auth.user.value?.groupSlug || "");
|
const groupSlug = computed(() => route.params.groupSlug as string || $auth.user.value?.groupSlug || "");
|
||||||
const id = route.params.id as string;
|
const id = route.params.id as string;
|
||||||
|
|
||||||
// Use the main shopping list page composable
|
|
||||||
const shoppingListPage = useShoppingListPage(id);
|
const shoppingListPage = useShoppingListPage(id);
|
||||||
|
|
||||||
// Get stores for labels, units, and foods
|
|
||||||
const { store: allLabels } = useLabelStore();
|
const { store: allLabels } = useLabelStore();
|
||||||
const { store: allUnits } = useUnitStore();
|
const { store: allUnits } = useUnitStore();
|
||||||
const { store: allFoods } = useFoodStore();
|
const { store: allFoods } = useFoodStore();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue