Commit graph

187 commits

Author SHA1 Message Date
Hayden
ace1d2f9ee
fix: force logout when deleting self - closes #1979 (#2000) 2023-01-07 10:30:45 -09:00
Hayden
fc92c39b7c
feat: additional events dispatch (#1999)
* formatting

* add new user type

* add registration event

* publish events on new mealplan

* update UI for supported types + type updates
2023-01-07 10:18:08 -09:00
Hayden
5dab70fe7e
fix: potential-pwa-fix-3 (#1992)
* force redirect when authenticated

* set start_url to empty string per - https://stackoverflow.com/questions/64608408/workbox-is-precaching-urls-without-revision-info-standalone-true-this-is-gene
2023-01-06 10:51:38 -09:00
Michael Genson
19ae89a195
fix: Fixed API Token "Created On" date (#1909)
* exposed created_at on token schema

* fixed token createdAt reference

* made created_at optional for compatibility
2022-12-29 12:49:19 -09:00
Philipp Fischbeck
bd2bad29a8
chore: make admin maintenance pages localizable (#1914) 2022-12-29 12:48:49 -09:00
Philipp
33dffccaa5
feat: duplicate recipes (#1750)
* feature/frontend: Add duplicate button to recipe

* feature/backend: Add recipe duplication endpoint

* feature/frontend: add duplication API call

* Regenerate API docs

* Fix linter errors

* Fix backend linter error

* Move recipe duplication logic to recipe service

* Add test for recipe duplication

* Improve recipe ingredients copy test

* generate types

* import type

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-11-30 20:57:26 -09:00
Michael Genson
b7ab16a7df
fix: shopping list frontend throttling on bulk actions (#1853)
* pause refresh when updating list

* throttle recipe +/- to one concurrent request
2022-11-30 20:29:27 -09:00
Jambaldorj Ochirpurev
1c87a87627
feat: warn use when deleting self (#1848)
* add the alert component on User Management

* refactored the warning text into the language file
2022-11-30 20:26:50 -09:00
Hayden
32c4ce4536
fix: planner date picker local and starting day (#1864)
* fix type definitions

* use day of week setting + fix multiple type errors

* add locale for yyyy-mm-dd format
2022-11-27 11:01:56 -09:00
Michael Genson
e7de0c90a1
feature: live shopping list updates (#1730)
* added polling for changes every 5 seconds

* fixed demi import

* stop polling if the refresh fails too many times

* only poll for changes when the user is active
2022-11-10 15:17:49 -09:00
Hayden
97d9e2a109
chore: lint-and-fix-vue-demi-imports (#1762)
* lint for 'vue-demi' imports

* fix invalid imports
2022-10-23 13:02:56 -08:00
Hayden
ce4315f971
chore: drop legacy editor (#1755)
* drop legacy editor

* remove unused components
2022-10-22 12:49:59 -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
Hayden
a56bedb022
fix: mis-ordered shoppinglist after checking item (#1749) 2022-10-21 20:35:45 -08:00
Hayden
d53e78317d
fix: advanced search now saved in URL (#1745)
* use query param for toggle state

* close #1678
2022-10-21 17:34:13 -08:00
Michael Genson
d3da551dae
feat: add profile update suggestion to members page (#1669) 2022-09-25 15:19:26 -08:00
Ben Boeckel
2e6b877ba9
docs: fix typos (#1665)
* docs: fix typos

* typos: fix typos found by `codespell` across the codebase

* docs: fix `macOS` spelling

* docs: fix `authentification` terminology

"Authentification" is not a thing.

* docs: fix `localhost` typo in example link

* typos: fix in-code typos

These are potentially higher risk, but no other mentions of these typos
show up in the codebase.
2022-09-25 15:17:27 -08:00
Hayden
39adea4ee3
feat (WIP): bring png OCR scanning support (#1670)
* Add pytesseract

* Add simple ocr endpoint

replace extension argument

* feat/ocr-editor gui

* fix frontend linting issues

* Add service unit tests

* Add split text modes & single ingredient/instruction editing

* make split mode really reactive

* Remove default step and ingredient

* make the linter haappy

* Accept only image uploads

* Add automatic recipe title suggestion

* Correct regex

* fix incorrect array.map method usage

* make the linter happy again

* Swap route to use asset name

* Rearange buttons

* fix test data

* feat: Allow making image the recipe image

* Add translation

* Make the linter happy

* Restrict function setPropertyValueByPath generic

* Restrict template literal type

* Add a more friendly icon to creation page

* update poetry lock file

* Correct sloppy ocr classes

* Make MyPy happy

* Rewrite safer tests

* Add tesseract to backend test CI container dependencies

* Make canvas element a component global

* Remove unwanted spaces in selected text

* Add way to know if recipe was created with ocr

* Access to ocr-editor for ocr recipes

* Update Alembic revision

* Make the frontend build

* Fix scrolling offset bug

* Allow creation of recipes with custom settings

* Fix rebasing mistakes

* Add format_tsv_output test

* Exclude the tests data directory only

* Enforce camelCase for frontend functions

* Remove import of unused component

* Fix type and class initialization

* Add multi-language support

* Highlight words in mount

* Fix image ratio bug

* Better ocr creation page

* Revert awkward feature to scroll in Selection mode

* Rebasing alembic migrations sux

* Remove obsolete getShared function

* Add function docstring

* Move down ocr creation option

* Make toolbar icons more generic

* Show help at the bottom of the page

* move ocr types to own file

* Use template ref for the canvas

* Use i18n.tc to get strings directly

* Correct naming mistake

* Move Ocr editor to own directory

* Create Ocr Editor parts

* Safeguard recipe properties access

* Add loading frontend animation due to longer request time

* minor cleanup chores

Co-authored-by: Miroito <alban.vachette@gmail.com>
2022-09-25 15:00:45 -08:00
Philipp Fischbeck
c3459d540b
fix: properly set "advanced features" during user registration (#1638)
Previously, "advanced features" was per group, not per user. With this change, this is now properly submitted on user registration. The "seed data" setting is also per group.
2022-09-11 09:56:23 -08:00
Mirko Jeličić
2df791b80b
feat: add option to stay in edit mode after loading from URL. (#1524)
* Add option to stay in edit mode after loading from URL.

* Stay in Edit mode now default behaviour after scraping recipe from URL.

* Fix missing param error.

* Fix incorrect read of boolean variable.

* Fix stupid error due to not understanding Vue.

* minor style and bug fixes

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-09-10 10:21:57 -08:00
Philipp Fischbeck
1c938cb835
fix: set meta description and image for shared recipes (#1635) 2022-09-10 09:29:21 -08:00
Michael Genson
2007bcfe28
feat: added "cookbook" filter to recipe pagination to serve frontend (#1609)
* added cookbook filter to recipe pagination

* fixed wrong filter var

* restored cookbook sorting

* reverted unnecessary var change
2022-09-10 08:59:30 -08:00
Hayden
18b2c92a76
feat: public recipe access (#1610)
* initial public explorer API endpoint

* public API endpoint

* cleanup recipe page

* wip: init explorer page

* use public URLs for shared recipes

* refactor private share tokens to use shared page
2022-08-28 20:08:33 -08:00
Hayden
caa9e03050
refactor: recipe-page (#1587)
Refactor recipe page to use break up the component and make it more usable across different pages. I've left the old route in as well in case there is some functional breaks, I plan to remove it before the official release once we've tested the new editor some more in production. For now there will just have to be some duplicate components and pages around.
2022-08-27 10:44:58 -08:00
Hayden
007b861ad6
docs: add docs on restoring to PSQL server (#1584)
* docs: add docs on restoring to PSQL server

* prevent iframe in netlify site
2022-08-20 11:53:48 -08:00
Hayden
74548e9152
fix(frontend): proper null check for notes (#1583)
Adds a proper check for the mealplan.recipe property in multiple places to resolve the bug described in #1571. In development the page would fail to render.
2022-08-20 11:21:57 -08:00
Michael Genson
aaeb162dd5
feat: unify recipe card sections (#1560)
* removed unused import

* moved categories/tags to new recipe card section

* nuked old frontend sort code
minor refactoring

* bug fixes

* added backend recipes filter for tools

* removed debug log

* removed unusued props

* fixed sort for recipes by tool

* added tests for getting recipes by tool
2022-08-20 10:59:49 -08:00
Hayden
3985713cbd
fix: user-feedback-on-schema-mismatch (#1558)
* validate schema version on restore

* show user error on backup failure
2022-08-14 11:06:35 -08:00
Hayden
7adcc86d03
feat: bulk recipe settings update (#1557)
* extract switches from menu component

* implement bulk updater for settings

* fix browser cache api calls issue

* add frontend for bulk settings modifications
2022-08-14 10:37:44 -08:00
Michael Genson
238f555f5e
fix: general bug fixes (#1547)
* grouped "instructions" header with first section

* fixed sort by last updated date

* somewhat-hacky bugfix for large screens

* modified page size to be divisible by 4

* fixed missing export for new data forms
2022-08-13 21:44:11 -08:00
Hayden
54c4f19a5c
security: enforce min length for user password (#1555)
* fix typing on auth context

* extract user password strength meter

* fix broken useToggle method

* extend form to accept arguments for validators

* enforce password length on update

* fix user password change form
2022-08-13 21:38:26 -08:00
Hayden
b3c41a4bd0
security: implement user lockout (#1552)
* add data-types required for login security

* implement user lockout checking at login

* cleanup legacy patterns

* expose passwords in test_user

* test user lockout after bad attempts

* test user service

* bump alembic version

* save increment to database

* add locked_at to datetime transformer on import

* do proper test cleanup

* implement scheduled task

* spelling

* document env variables

* implement context manager for session

* use context manager

* implement reset script

* cleanup generator

* run generator

* implement API endpoint for resetting locked users

* add button to reset all locked users

* add info when account is locked

* use ignore instead of expect-error
2022-08-13 13:18:12 -08:00
Daniel Palstra
ca64584fd1
feat: add the RecipeCardMenu to the recipe in a mealplan (#1551)
* Add the RecipeCardMenu to the recipe in a mealplan

* fix parameter naming

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-08-12 09:02:08 -08:00
Bryce Willey
553325ed09
fix: use flex-basis, not width to fix min size bug (#1548)
On mobile screens when following a registration invite link, the page
would be too wide to interact with, extending well over the sides of the
phone.

This is because the minimum size of content is set to `auto` (by
default), and accord to the spec (https://www.w3.org/TR/css-flexbox-1/#specified-size-suggestion)
the minimum size of the element is the mimimum size of it's content. The
password strength element in the panel had a width of 500px, making the
entire component overflow the screen.

Changing the width to `flex-basis` instead, allows for the password
strength element to shrink if it overflows the screen.
2022-08-12 08:59:34 -08:00
Hayden
ef24705cfa
fix: ignore-place-in-search (#1544)
* pin i18n since it breaks things

* set ignoreLocation to true

* revert composition api demotion

* bump slugify
2022-08-09 20:34:08 -08:00
Philipp Fischbeck
34cd6eb687
fix: validate OpenAPI spec (#1528)
* init api check test

* Fix openAPI issues

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-08-06 16:54:29 -08:00
Hayden
13850cda1f
security: multiple reported CVE fixes (#1515)
* update out of date license

* update typing / refactor

* fix arbitrarty path injection

* use markdown sanatizer to prevent XSS CWE-79

* fix CWE-918 SSRF by validating url and mime type

* add security docs

* update recipe-scrapers

* resolve DOS from arbitrary url

* update changelog

* bump version

* add ref to #1506

* add #1511 to changelog

* use requests decoder

* actually fix encoding issue
2022-07-31 13:10:20 -08:00
Michael Genson
483f789b8e
feat: create new foods and units from their Data Management pages (#1511)
* added create dialogs to food and unit pages

* minor css tweaks

* properly reset create form

* added placeholder name attribute for type checking

* removed unnecessary value assignment

* type fixes

* corrected comment

* add autofocus and use ref<VForm> for form refs

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-07-31 12:31:20 -08:00
Philipp Fischbeck
34f52c06a6
fix: properly use pagination for group event notifiers (#1512) 2022-07-31 10:08:48 -08:00
Michael Genson
07fef8af9f
feat: restore frontend sorting for all recipes (#1497)
* fixed typo

* merged "all recipes" pagination into recipe card
created custom sort card for all recipes
refactored backend calls for all recipes to sort/paginate

* frontend lint fixes

* restored recipes reference

* replaced "this" with reference

* fix linting errors

* re-order context menu

* add todo

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-07-26 18:08:56 -08:00
Miroito
c64da1fdb7
Feature: Toggle display of ingredient references in recipe instructions (#1268)
* Better cooking mode

* Fix wrong event sent

* feat/cookmode recipe page integration

* implement scaling in cook mode + minor padding

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-07-09 20:28:34 -08:00
Miroito
151e20489a
ui: Improve parser ui text display (#1437)
move text display when open to be below the ingredient portion
2022-06-26 11:20:38 -08:00
Michael Genson
cb15db2d27
feat: re-write get all routes to use pagination (#1424)
rewrite get_all routes to use a pagination pattern to allow for better implementations of search, filter, and sorting on the frontend or by any client without fetching all the data. Additionally we added a CI check for running the Nuxt built to confirm that no TS errors were present. Finally, I had to remove the header support for the Shopping lists as the browser caching based off last_updated header was not allowing it to read recent updates due to how we're handling the updated_at property in the database with nested fields. This will have to be looked at in the future to reimplement. I'm unsure how many other routes have a similar issue. 

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-06-25 11:39:38 -08:00
Hayden
f122c382e9
add recipe.image cache key to bush caches (#1427)
* add recipe.image cache key to bush caches

* hotfix: TS type error
2022-06-19 11:47:16 -08:00
Hayden
c865bc7769
fix: only show scaler when ingredients amounts enabled (#1426) 2022-06-19 10:27:32 -08:00
Michael Genson
bb1fa52d10
fix: all-recipes page now sorts alphabetically (#1405)
* added sort params to backend call

* hardcoded alphabetical sort param

* removed trivial type annotation

* linters are friends, not food
2022-06-19 10:03:24 -08:00
Hayden
5a053cdcd6
feat: mealplan-webhooks (#1403)
* fix type errors on event bus

* webhooks fields required for new implementation

* db migration

* wip: webhook query + tests and stub function

* ignore type checker error

* type and method cleanup

* datetime and time utc validator

* update testing code for utc scheduled time

* fix file cmp function call

* update version_number

* add support for translating "time" objects when restoring backup

* bump recipe-scrapers

* use specific import syntax

* generate frontend types

* utilize names exports

* use utc times

* add task to scheduler

* implement new scheduler functionality

* stub for type annotation

* implement meal-plan data getter

* add experimental banner
2022-06-17 13:25:47 -08:00
Hayden
b1256f4ad2
fix: fast fail of bulk importer (#1394)
* use continue instead of break

* catch additional error case

* spelling is hard
2022-06-15 18:19:52 -08:00
Michael Genson
9e261f5235
fix: infinite scroll bug on all recipes page (#1393) 2022-06-15 12:56:56 -08:00
Hayden
3030e3e7f4
feat: implement user favorites page (#1376)
* fix geFavorites return

* add support for toggling to dense cards on desktop

* add favorites page link

* implement basic favorites page
2022-06-13 09:33:46 -08:00