* added support for group slugs
* modified frontend to use links with group slug
* fixed test refs
* unused import
---------
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
* Add hook for random sorting
* Add random sorting to front page
* Add multiple tests for random sorting.
* Be extra sure that all recipes are returned.
* Too stable random. seed doesn't reach backend.
* add timestamp to useRecipeSearch
* Update randomization tests for timestamp seeding
* ruff cleanup
* pass timestamp separately in getAll
* remove debugging log items
* remove timestamp from address bar
* remove defaults from backend timestamps
* timestamp should be optional
* fix edge case: query without timestamp
* similar edge case: no timestamp in pagination
* ruff :/
* better edge case handling
* stabilize random search test w/more recipes
* better pagination seeding
* update pagination seed test
* remove redundant random/seed check
* Test for api routes to random sorting.
* please the typing gods
* hack to make query parameters throw correct exc
* ruff
* fix validator message typo
* black reformatting
---------
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
* Creating postgres migration script and starting to set up to detect database
* non-working placeholders for postgres pg_tgrm
* First draft of some indexes
* non-working commit of postgres indexing
* Further non-working edits to db-centric fuzzy search
* update alembic for extensions
* More non-working setup
* Move db type check to init_db
* fix typo in db name check
* Add sqlite token search and postgres full text search
* reorder search to hit exact matches faster
* Add settings and docs for POSTGRES_LANGUAGE (full text search)
* Use user-specified POSTGRES_LANGUAGE in search
* fix fuzzy search typo
* Remove full text search and instead order by trigram match
* cleaner adding of indices, remove fulltext
* Cleanup old import of getting app settings
* Fix typo in index
* Fix some alembic fuzzy typos
* Remove diagnostic printing from alembic migration
* Fix mixed up commutator for trigram operator and relax criteria
* forgot to remove query debug
* sort only on name
* token and fuzzy search tests
* Refactor recipe search test to avoid rare random string cross-matches.
* Add ability to quote parts of search for exact match
* Remove internal punctuation, unless it's quoted for literal search
* Add tests for special character removal and literal search
* Remove the outer double quotes from searches, but leave internal single quotes alone.
* Update tests to avoid intra-test name collisions
* Fixing leftovers highlighted by lint
* cleanup linting and mypy errors
* Fix test cross-matching on dirty db (leftovers from bulk import)
* forgot to cleanup something when debugging mypy errors
* re-order pg_trgm loading in postgres
* address comments
* New translations en-US.json (French)
* New translations en-US.json (Slovak)
* New translations en-US.json (Swedish)
* New translations en-US.json (Norwegian)
* New translations en-US.json (Norwegian)
* New translations en-US.json (German)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Catalan)
* New translations en-US.json (Catalan)
* New translations en-US.json (Spanish)
* New translations en-US.json (Catalan)
* New translations en-US.json (Spanish)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Romanian)
* New translations en-US.json (Romanian)
* New translations en-US.json (Romanian)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Polish)
* New translations en-US.json (Polish)
* New translations en-US.json (Polish)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (German)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (German)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (German)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* New translations en-US.json (Hebrew)
* Remove some implicit lazy-loads from user serialization
* implement full backup restore across different database versions
* rework all custom getter dicts to not leak lazy loads
* remove some occurances of lazy-loading
* remove a lot of lazy loading from recipes
* add more eager loading
remove loading options from repository
remove raiseload for checking
* fix failing test
* do not apply loader options for paging counts
* try using selectinload a bit more instead of joinedload
* linter fixes
* 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
* 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>
* upgrade sqlalchemy to 2.0
* rewrite all db models to sqla 2.0 mapping api
* fix some importing and typing weirdness
* fix types of a lot of nullable columns
* remove get_ref methods
* fix issues found by tests
* rewrite all queries in repository_recipe to 2.0 style
* rewrite all repository queries to 2.0 api
* rewrite all remaining queries to 2.0 api
* remove now-unneeded __allow_unmapped__ flag
* remove and fix some unneeded cases of "# type: ignore"
* fix formatting
* bump black version
* run black
* can this please be the last one. okay. just. okay.
* fix repository errors
* remove return
* drop open API validator
---------
Co-authored-by: Sören Busch <fleshgolem@gmx.net>
* New translations en-US.json (Spanish)
* New translations en-US.json (Spanish)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* Move recipe validations from RecipeSummary to Recipe
* fix RepositoryRecipes loading recipes with ingredients even when load_food is False
* Add eager loading of ingredient units
* fix trying to instantiate PaginationBase with concrete type not being valid for mypy
* fix linting issue
* 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
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (Slovak)
* New translations en-US.json (French)
* New translations en-US.json (French)
* New translations en-US.json (Finnish)
* New translations en-US.json (French)
* New translations en-US.json (French)
* New translations en-US.json (Portuguese)
* New translations en-US.json (French)
* New translations en-US.json (French)
* New translations en-US.json (Finnish)
* New translations en-US.json (Finnish)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Finnish)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (Finnish)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Italian)
* New translations en-US.json (Italian)
* New translations en-US.json (Finnish)
* New translations en-US.json (Finnish)
* New translations en-US.json (Italian)
* New translations en-US.json (Italian)
* New translations en-US.json (Finnish)
* New translations en-US.json (Italian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Hungarian)
* New translations en-US.json (Hungarian)
* New translations en-US.json (Hungarian)
* New translations en-US.json (Hungarian)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (Polish)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (German)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (Bulgarian)
* New translations en-US.json (Polish)
* New translations en-US.json (Polish)
* New translations en-US.json (Polish)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (French)
* New translations en-US.json (Turkish)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (German)
* New translations en-US.json (German)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (German)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Ukrainian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Lithuanian)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Czech)
* New translations en-US.json (Norwegian)
* New translations en-US.json (Norwegian)
* New translations en-US.json (Norwegian)
* New translations en-US.json (Dutch)
* added recipe_timeline_events table to db
* added schema and routes for recipe timeline events
* added missing mixin and fixed update schema
* added tests
* adjusted migration revision tree
* updated alembic revision test
* added initial timeline event for new recipes
* added additional tests
* added event bus support
* renamed event_dt to timestamp
* add timeline_events to ignore list
* run code-gen
* use new test routes implementation
* use doc string syntax
* moved event type enum from db to schema
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (German)
* New translations en-US.json (Polish)
This PR does too many things :(
1. Major refactoring of the dev/scripts and dev/code-generation folders.
Primarily this was removing duplicate code and cleaning up some poorly written code snippets as well as making them more idempotent so then can be re-run over and over again but still maintain the same results. This is working on my machine, but I've been having problems in CI and comparing diffs so running generators in CI will have to wait.
2. Re-Implement using the generated api routes for testing
This was a _huge_ refactor that touched damn near every test file but now we have auto-generated typed routes with inline hints and it's used for nearly every test excluding a few that use classes for better parameterization. This should greatly reduce errors when writing new tests.
3. Minor Perf improvements for the All Recipes endpoint
A. Removed redundant loops
B. Uses orjson to do the encoding directly and returns a byte response instead of relying on the default
jsonable_encoder.
4. Fix some TS type errors that cropped up for seemingly no reason half way through the PR.
See this issue https://github.com/phillipdupuis/pydantic-to-typescript/issues/28
Basically, the generated TS type is not-correct since Pydantic will automatically fill in null fields. The resulting TS type is generated with a ? to indicate it can be null even though we _know_ that i can't be.
* New translations en-US.json (Norwegian)
* New translations en-US.json (Norwegian)
* New translations en-US.json (Norwegian)
* New translations en-US.json (Norwegian)
* New translations en-US.json (Norwegian)
* New translations en-US.json (Dutch)
* New translations en-US.json (French)
* New translations en-US.json (Turkish)
* New translations en-US.json (Turkish)
* New translations en-US.json (Turkish)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)
* New translations en-US.json (Dutch)