Feature/group based notifications (#918)

* fix group page

* setup group notification for backend

* update type generators

* script to auto-generate schema exports

* setup frontend CRUD interface

* remove old notifications UI

* drop old events api

* add test functionality

* update naming for fields

* add event dispatcher functionality

* bump to python 3.10

* bump python version

* purge old event code

* use-async apprise

* set mealie logo as image

* unify styles for buttons rows

* add links to banners
This commit is contained in:
Hayden
2022-01-09 21:04:24 -09:00
committed by GitHub
parent 50a341ed3f
commit 190773c5d7
74 changed files with 1992 additions and 1229 deletions

View File

@@ -1,2 +1,10 @@
# GENERATED CODE - DO NOT MODIFY BY HAND
from .group import *
from .group_events import *
from .group_exports import *
from .group_migration import *
from .group_permissions import *
from .group_preferences import *
from .group_shopping_list import *
from .invite_token import *
from .webhook import *

View File

@@ -0,0 +1,89 @@
from fastapi_camelcase import CamelModel
from pydantic import UUID4
# =============================================================================
# Group Events Notifier Options
class GroupEventNotifierOptions(CamelModel):
"""
These events are in-sync with the EventTypes found in the EventBusService.
If you modify this, make sure to update the EventBusService as well.
"""
recipe_created: bool = False
recipe_updated: bool = False
recipe_deleted: bool = False
user_signup: bool = False
data_migrations: bool = False
data_export: bool = False
data_import: bool = False
mealplan_entry_created: bool = False
shopping_list_created: bool = False
shopping_list_updated: bool = False
shopping_list_deleted: bool = False
cookbook_created: bool = False
cookbook_updated: bool = False
cookbook_deleted: bool = False
tag_created: bool = False
tag_updated: bool = False
tag_deleted: bool = False
category_created: bool = False
category_updated: bool = False
category_deleted: bool = False
class GroupEventNotifierOptionsSave(GroupEventNotifierOptions):
notifier_id: UUID4
class GroupEventNotifierOptionsOut(GroupEventNotifierOptions):
id: UUID4
class Config:
orm_mode = True
# =======================================================================
# Notifiers
class GroupEventNotifierCreate(CamelModel):
name: str
apprise_url: str
class GroupEventNotifierSave(GroupEventNotifierCreate):
enabled: bool = True
group_id: UUID4
options: GroupEventNotifierOptions = GroupEventNotifierOptions()
class GroupEventNotifierUpdate(GroupEventNotifierSave):
id: UUID4
apprise_url: str = None
class GroupEventNotifierOut(CamelModel):
id: UUID4
name: str
enabled: bool
group_id: UUID4
options: GroupEventNotifierOptionsOut
class Config:
orm_mode = True
class GroupEventNotifierPrivate(GroupEventNotifierOut):
apprise_url: str
class Config:
orm_mode = True