From bcf9b50157fa76a11e5ec45fd2e472f3a6dce79b Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Sun, 16 Jun 2024 14:51:29 +0200 Subject: [PATCH 1/5] feat(blog): Add permissions table in AdminCP for blog plugin --- backend/drizzle.config.ts | 5 +- frontend/components/color/color-input.tsx | 2 +- .../permissions-table/permissions-table.tsx | 275 ++++++++++++++++++ .../components/permissions-table/query-api.ts | 22 ++ .../use-permissions-table-api.ts | 18 ++ frontend/components/tabs/tabs-trigger.tsx | 76 +++-- frontend/components/tabs/tabs.tsx | 11 +- frontend/components/ui/dialog.tsx | 60 ++-- .../categories/create-edit/create-edit.tsx | 87 +++--- .../use-create-edit-category-blog-admin.ts | 29 +- .../categories/create-edit/tabs/main.tsx | 63 ++++ .../create-edit/tabs/permissions.tsx | 50 ++++ frontend/plugins/blog/langs/en.json | 4 + frontend/plugins/blog/langs/pl.json | 4 + 14 files changed, 603 insertions(+), 103 deletions(-) create mode 100644 frontend/components/permissions-table/permissions-table.tsx create mode 100644 frontend/components/permissions-table/query-api.ts create mode 100644 frontend/components/permissions-table/use-permissions-table-api.ts create mode 100644 frontend/plugins/blog/admin/views/categories/create-edit/tabs/main.tsx create mode 100644 frontend/plugins/blog/admin/views/categories/create-edit/tabs/permissions.tsx diff --git a/backend/drizzle.config.ts b/backend/drizzle.config.ts index 97fe8f31c..ef5ed11de 100644 --- a/backend/drizzle.config.ts +++ b/backend/drizzle.config.ts @@ -4,6 +4,9 @@ import { DATABASE_ENVS } from "@/database/client"; export default defineConfig({ dialect: "postgresql", - dbCredentials: DATABASE_ENVS, + dbCredentials: { + ...DATABASE_ENVS, + ssl: false + }, schema: "./src/plugins/**/admin/database/schema/*.ts" }); diff --git a/frontend/components/color/color-input.tsx b/frontend/components/color/color-input.tsx index aadd883cb..cee95e956 100644 --- a/frontend/components/color/color-input.tsx +++ b/frontend/components/color/color-input.tsx @@ -39,7 +39,7 @@ export const ColorInput = ({ const colorBrightness = color ? isColorBrightness(color) : false; return ( - +