diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000000..41b390fac6aa --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,33 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: FastAPI", + "type": "python", + "request": "launch", + "module": "uvicorn", + "args": ["mealie.app:app"], + "justMyCode": false, + "jinja": true + }, + { + "name": "Python: Current File", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "justMyCode": false + }, + { + "name": "Debug Tests", + "type": "python", + "request": "test", + "console": "integratedTerminal", + "justMyCode": false, + "env": { "PYTEST_ADDOPTS": "--no-cov" } + } + ] +} diff --git a/frontend/api/admin-api.ts b/frontend/api/admin-api.ts index 951faf5aee63..db978ca416cb 100644 --- a/frontend/api/admin-api.ts +++ b/frontend/api/admin-api.ts @@ -1,6 +1,7 @@ import { AdminAboutAPI } from "./admin/admin-about"; import { AdminTaskAPI } from "./admin/admin-tasks"; import { AdminUsersApi } from "./admin/admin-users"; +import { AdminGroupsApi } from "./admin/admin-groups"; import { ApiRequestInstance } from "~/types/api"; export class AdminAPI { @@ -8,6 +9,7 @@ export class AdminAPI { public about: AdminAboutAPI; public serverTasks: AdminTaskAPI; public users: AdminUsersApi; + public groups: AdminGroupsApi; constructor(requests: ApiRequestInstance) { if (AdminAPI.instance instanceof AdminAPI) { @@ -17,6 +19,7 @@ export class AdminAPI { this.about = new AdminAboutAPI(requests); this.serverTasks = new AdminTaskAPI(requests); this.users = new AdminUsersApi(requests); + this.groups = new AdminGroupsApi(requests); Object.freeze(this); AdminAPI.instance = this; diff --git a/frontend/api/admin/admin-about.ts b/frontend/api/admin/admin-about.ts index 01517f7ea3f7..dac818f28c73 100644 --- a/frontend/api/admin/admin-about.ts +++ b/frontend/api/admin/admin-about.ts @@ -31,6 +31,7 @@ export interface CheckAppConfig { emailReady: boolean; baseUrlSet: boolean; isSiteSecure: boolean; + ldapReady: boolean; } export class AdminAboutAPI extends BaseAPI { diff --git a/frontend/api/admin/admin-groups.ts b/frontend/api/admin/admin-groups.ts new file mode 100644 index 000000000000..5e76544db917 --- /dev/null +++ b/frontend/api/admin/admin-groups.ts @@ -0,0 +1,54 @@ +import { BaseCRUDAPI } from "../_base"; +import { UserRead } from "./admin-users"; +const prefix = "/api"; + +export interface Token { + name: string; + id: number; + createdAt: Date; +} + +export interface Preferences { + privateGroup: boolean; + firstDayOfWeek: number; + recipePublic: boolean; + recipeShowNutrition: boolean; + recipeShowAssets: boolean; + recipeLandscapeView: boolean; + recipeDisableComments: boolean; + recipeDisableAmount: boolean; + groupId: number; + id: number; +} + +export interface GroupCreate { + name: string; +} + +export interface GroupRead extends GroupCreate { + id: number; + categories: any[]; + webhooks: any[]; + users: UserRead[]; + preferences: Preferences; +} + +export interface AdminGroupUpdate { + name: string; + id: number; + preferences: Preferences; +} + +const routes = { + adminUsers: `${prefix}/admin/groups`, + adminUsersId: (id: number) => `${prefix}/admin/groups/${id}`, +}; + +export class AdminGroupsApi extends BaseCRUDAPI { + baseRoute: string = routes.adminUsers; + itemRoute = routes.adminUsersId; + + async updateOne(id: number, payload: AdminGroupUpdate) { + return await this.requests.put(this.itemRoute(id), payload); + } +} diff --git a/frontend/api/admin/admin-users.ts b/frontend/api/admin/admin-users.ts index 314a383fbd46..3f15d5efa024 100644 --- a/frontend/api/admin/admin-users.ts +++ b/frontend/api/admin/admin-users.ts @@ -2,7 +2,7 @@ import { BaseCRUDAPI } from "../_base"; const prefix = "/api"; -interface UserCreate { +export interface UserCreate { username: string; fullName: string; email: string; @@ -21,7 +21,7 @@ export interface UserToken { createdAt: Date; } -interface UserRead extends UserToken { +export interface UserRead extends UserToken { id: number; groupId: number; favoriteRecipes: any[]; diff --git a/frontend/components/Domain/Group/GroupPreferencesEditor.vue b/frontend/components/Domain/Group/GroupPreferencesEditor.vue new file mode 100644 index 000000000000..64c3dc8000a5 --- /dev/null +++ b/frontend/components/Domain/Group/GroupPreferencesEditor.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/frontend/components/Domain/Recipe/RecipeActionMenu.vue b/frontend/components/Domain/Recipe/RecipeActionMenu.vue index fafe17566f0f..cd9e6123e88f 100644 --- a/frontend/components/Domain/Recipe/RecipeActionMenu.vue +++ b/frontend/components/Domain/Recipe/RecipeActionMenu.vue @@ -8,7 +8,7 @@ style="z-index: 2; position: sticky" >
- -