23 Commits

Author SHA1 Message Date
Michael Genson
ca26639525
feat: Data Management from Shopping List (#3603)
Co-authored-by: boc-the-git <3479092+boc-the-git@users.noreply.github.com>
2024-05-22 21:58:16 +00:00
Kuchenpirat
360b8e21d9
fix: MultiPurposeLabel text color (#3485) 2024-04-17 12:24:54 -05:00
Jurriaan Den Toonder
4d2363ea22
Add shopping list items using the enter key (#3118)
* Enables shopping list items being saved upon enter key press in notes field

Related to: https://github.com/mealie-recipes/mealie/discussions/3114
* Enter key press is caught in note field in ShoppingListItemEditor
* The create editor now stays open after saving a food item to a shopping list,
   to allow keyboard-only interaction with the shopping list

* Prevent empty shopping list items from being added

Related to: https://github.com/mealie-recipes/mealie/discussions/3114
An item is considered empty when the foodId is not set, and no note is set.
This is only handled frontend, the backend still accepts empty items.

---------

Signed-off-by: Jurriaan Den Toonder <1493561+Fastjur@users.noreply.github.com>
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
2024-02-19 10:29:45 -06:00
Michael Genson
ea7005e822
feat: Shopping List Editor Improvements (#3178)
* modify new item factory to default to zero qty and use last isFood value

* automatically set the label of an item when choosing a food

* fix when switching to a food with no label

* removed trivial type annotation

* more lint

* removed debug log
2024-02-19 06:59:03 +11:00
Michael Genson
bd79c1db2f
chore: Get Rid of Warnings (#2599)
* ignore unsafe html warnings

* remove unused import

* re-order attrs

* removed unused vars/imports

* removed unused import

* refactored v-html

* removed more unused things
2023-10-07 11:23:47 -08:00
Michael Genson
5213a61d9b
fix: logic for disableAmount in shopping list items (#2518) 2023-08-22 14:03:24 -08:00
Michael Genson
ae502c5652
added missing recipe list import (#2516) 2023-08-21 17:30:31 -08:00
Michael Genson
d6e4829e6f
feat: Display Shopping List Item Recipe Refs (#2501)
* added recipe ref display to shopping list items

* added backend support for recipe notes

* added recipe note to item recipe ref display

* fixed note merge bug with 3+ notes

* tweak display

* lint

* updated alembic refs

---------

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2023-08-21 09:18:37 -08:00
Hugo van Rijswijk
50a92c165c
feat: improve readability of ingredients list (#2502)
* feat: improve readability of notes in ingredients list

Makes the notes in the ingredients list more readable by making them slightly opaque. This creates a better visual separation between the notes and the rest of the ingredient.

* Use server display if available

* Move note to newline and make quantity more distinct

* Use safeMarkdown for shopping list

* Use component

* Wrap unit in accent color

* Update RecipeIngredientListItem to set food in bold
2023-08-21 15:32:09 +00:00
Michael Genson
75698c531a
fix: Shopping List Label Dropdown Doesn't Save Correctly (#2361)
* only update items by label on refresh

* made changes more responsive

* fast re-order items when labels are re-ordered
2023-04-25 09:46:58 -08:00
Michael Genson
d2134b27ba
fix: Shopping List Mobile Usability (#2247)
* removed handle from edit button

* added dragging delay for touch screens
2023-03-21 11:48:00 -08:00
Michael Genson
8ca0fe42de
Feature: More Shopping List Improvements (#2164)
* added color back to labels

* improved mobile view
refactored layout to use grid
allowed text wrapping on item labels
removed label overflow
added completion date on checked items

* sort checked items by last updated

* made checking an item off more responsive

* optimized moving checked items
removed unnecessary updateAll call
removed jitter when shopping list refreshes
2023-02-26 10:12:53 -09:00
Michael Genson
a6c46a7420
Feature: Shopping List Label Section Improvements (#2090)
* added backend for shopping list label config

* updated codegen

* refactored shopping list ops to service
removed unique contraint
removed label settings from main route/schema
added new route for label settings

* codegen

* made sure label settings output in position order

* implemented submenu for label order drag and drop

* removed redundant label and tweaked formatting

* added view by label to user preferences

* made items draggable within each label section

* moved reorder labels to its own button

* made dialog scrollable

* fixed broken model

* refactored labels to use a service
moved shopping list label logic to service
modified label seeder to use service

* added tests

* fix for first label missing the tag icon

* fixed wrong mapped type

* added statement to create existing relationships

* fix restore test, maybe
2023-02-21 18:58:41 -09:00
Hayden
71f8c1066a
feat: server side search (#2112) (#2117)
* feat: server side search API (#2112)

* refactor repository_recipes filter building

* add food filter to recipe repository page_all

* fix query type annotations

* working search

* add tests and make sure title matches are ordered correctly

* remove instruction matching again

* fix formatting and small issues

* fix another linting error

* make search test no rely on actual words

* fix failing postgres compiled query

* revise incorrectly ordered migration

* automatically extract latest migration version

* test migration orderes

* run type generators

* new search function

* wip: new search page

* sortable field options

* fix virtual scroll issue

* fix search casing bug

* finalize search filters/sorts

* remove old composable

* fix type errors

---------

Co-authored-by: Sören <fleshgolem@gmx.net>
2023-02-11 21:26:10 -09:00
Michael Genson
617cc1fdfb
Refactor Shopping List API (#2021)
* tidied up shopping list item models
redefined recipe refs and updated models
added calculated display attribute to unify shopping list item rendering
added validation to use a food's label if an item's label is null

* fixed schema reference

* refactored shopping list item service
route all operations through one central method to account for edgecases
return item collections for all operations to account for merging
consolidate recipe items before sending them to the shopping list

* made fractions prettier

* replaced redundant display text util

* fixed edgecase for zero quantity items on a recipe

* fix for pre-merging recipe ingredients

* fixed edgecase for merging create_items together

* fixed bug with merged updated items creating dupes

* added test for self-removing recipe ref

* update items are now merged w/ existing items

* refactored service to make it easier to read

* added a lot of tests

* made it so checked items are never merged

* fixed bug with dragging + re-ordering

* fix for postgres cascade issue

* added prevalidator to recipe ref to avoid db error
2023-01-28 15:45:02 -09:00
Michael Genson
856a009dd8
fix: for several Shopping List bugs (#1912)
* prevent list refresh while re-ordering items

* update position of new items to stay at the bottom

* prevent refresh while loading

* copy item while editing so it isn't refreshed

* added loading count to handle overlapping actions

* fixed recipe reference throttling

* prevent merging checked and unchecked items
2023-01-08 08:23:24 -09:00
Hayden
c5613694d9
fix: display food label if no label present (#1757)
The only label that was applied to the shopping list view was one that was manually assigned. Now we first check if the item has a label, if not we check if the food has a label, then if there really is no label we display nothing.
2022-10-22 13:00:10 -08:00
Hayden
fcc5d99d40
chore: frontend testing setup (#1739)
* add vitest

* initialize lib w/ tests

* move to dev dep

* run tests in CI

* update file names

* move api folder to lib

* move api and api types to same folder

* update generator outpath

* rm husky

* i guess i _did_ need those types

* reorg types

* extract validators into testable components

* (WIP) start composable testing

* fix import type

* fix linter complaint

* simplify icon type def

* fix linter errors (maybe?)

* rename client file for sorting
2022-10-22 11:51:07 -08:00
Philipp Fischbeck
32244988d2
chore: make vue domain components localizable (#1532) 2022-08-09 21:12:45 -08:00
Hayden
5a0c034391
fix: shopping list label editor (#1333)
* remove head props

* lazily compute itemsByLabel with watcher on fetch

* remove unused import
2022-06-02 09:12:05 -08:00
Hayden
8f569509bf
Feature/move label editor (#1069)
* update default color

* move labels editor
2022-03-19 11:31:17 -08:00
Hayden
92cf97e401
Feature/shopping lists second try (#927)
* generate types

* use generated types

* ui updates

* init button link for common styles

* add links

* setup label views

* add delete confirmation

* reset when not saved

* link label to foods and auto set when adding to shopping list

* generate types

* use inheritence to manage exception handling

* fix schema generation and add test for open_api generation

* add header to api docs

* move list consilidation to service

* split list and list items controller

* shopping list/list item tests - PARTIAL

* enable recipe add/remove in shopping lists

* generate types

* linting

* init global utility components

* update types and add list item api

* fix import cycle and database error

* add container and border classes

* new recipe list component

* fix tests

* breakout item editor

* refactor item editor

* update bulk actions

* update input / color contrast

* type generation

* refactor controller dependencies

* include food/unit editor

* remove console.logs

* fix and update type generation

* fix incorrect type for column

* fix postgres error

* fix delete by variable

* auto remove refs

* fix typo
2022-01-16 15:24:24 -09:00
Hayden
6db1357064
feat: (WIP) base-shoppinglist infra (#911)
* feat:  base-shoppinglist infra (WIP)

* add type checker

* implement controllers

* apply router fixes

* add checked section hide/animation

* add label support

* formatting

* fix overflow images

* add experimental banner

* fix #912 word break issue

* remove any type errors

* bump dependencies

* remove templates

* fix build errors

* bump node version

* fix template literal
2022-01-08 22:24:34 -09:00