From 2bdbebc45397d001c701f2c2c7e81877fbad4467 Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Sat, 25 Oct 2025 12:11:14 +0400 Subject: [PATCH] feat: modules and module-editor pages --- src/app/layout.tsx | 53 +- .../[moduleId]/ModuleEditor.module.css | 12 + .../AttributeTableActions.tsx | 68 ++ .../AttributeTypeSelect.tsx | 21 + .../AttributesTable/AttributesTable.tsx | 34 + .../useAttributesTableColumns.tsx | 37 + .../CreateAttributeButton.tsx | 18 + .../DefaultAttributeValueInput.tsx | 90 +++ .../ModuleAttribute/ModuleAttribute.tsx | 68 ++ .../ModuleAttributesEditor.tsx | 41 + .../ModuleCommonInfoEditor.tsx | 52 ++ .../components/shared/PageBody/PageBody.tsx | 59 ++ .../contexts/ModuleEditorContext.tsx | 71 ++ .../[moduleId]/hooks/useAttributeTypesList.ts | 13 + .../[moduleId]/hooks/useAttributesActions.tsx | 214 +++++ .../[moduleId]/hooks/useAttributesList.ts | 32 + .../[moduleId]/hooks/useModulesActions.tsx | 51 ++ .../modals/AttributeEditorModal.tsx | 138 ++++ src/app/module-editor/[moduleId]/page.tsx | 39 + .../components/InnerAttributesTable.tsx | 38 + src/app/modules/components/ModulesHeader.tsx | 24 + src/app/modules/components/ModulesTable.tsx | 46 ++ src/app/modules/components/PageBody.tsx | 26 + src/app/modules/contexts/ModulesContext.tsx | 22 + .../hooks/useAttributesInnerTableColumns.tsx | 82 ++ .../modules/hooks/useModulesTableActions.tsx | 57 ++ .../modules/hooks/useModulesTableColumns.tsx | 112 +++ .../modules/hooks/useModulesWithAttrsList.ts | 13 + src/app/modules/page.tsx | 22 + .../layout/Navbar/data/linksData.ts | 7 + .../components/UpdateDeleteTableActions.tsx | 8 + .../ui/DropdownMenuItem/DropdownMenuItem.tsx | 13 +- src/lib/client/@tanstack/react-query.gen.ts | 421 ++++++++++ src/lib/client/sdk.gen.ts | 359 ++++++++- src/lib/client/types.gen.ts | 754 +++++++++++++++++- src/lib/client/zod.gen.ts | 365 ++++++++- src/modals/modals.ts | 4 +- .../components/ProductView/ProductView.tsx | 10 +- src/theme.ts | 22 + src/utils/datetime.ts | 7 + 40 files changed, 3485 insertions(+), 38 deletions(-) create mode 100644 src/app/module-editor/[moduleId]/ModuleEditor.module.css create mode 100644 src/app/module-editor/[moduleId]/components/shared/AttributeTableActions/AttributeTableActions.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/AttributeTypeSelect/AttributeTypeSelect.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/AttributesTable/AttributesTable.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/AttributesTable/useAttributesTableColumns.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/CreateAttributeButton/CreateAttributeButton.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/DefaultAttributeValueInput/DefaultAttributeValueInput.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/ModuleAttribute/ModuleAttribute.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/ModuleAttributesEditor/ModuleAttributesEditor.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/ModuleCommonInfoEditor/ModuleCommonInfoEditor.tsx create mode 100644 src/app/module-editor/[moduleId]/components/shared/PageBody/PageBody.tsx create mode 100644 src/app/module-editor/[moduleId]/contexts/ModuleEditorContext.tsx create mode 100644 src/app/module-editor/[moduleId]/hooks/useAttributeTypesList.ts create mode 100644 src/app/module-editor/[moduleId]/hooks/useAttributesActions.tsx create mode 100644 src/app/module-editor/[moduleId]/hooks/useAttributesList.ts create mode 100644 src/app/module-editor/[moduleId]/hooks/useModulesActions.tsx create mode 100644 src/app/module-editor/[moduleId]/modals/AttributeEditorModal.tsx create mode 100644 src/app/module-editor/[moduleId]/page.tsx create mode 100644 src/app/modules/components/InnerAttributesTable.tsx create mode 100644 src/app/modules/components/ModulesHeader.tsx create mode 100644 src/app/modules/components/ModulesTable.tsx create mode 100644 src/app/modules/components/PageBody.tsx create mode 100644 src/app/modules/contexts/ModulesContext.tsx create mode 100644 src/app/modules/hooks/useAttributesInnerTableColumns.tsx create mode 100644 src/app/modules/hooks/useModulesTableActions.tsx create mode 100644 src/app/modules/hooks/useModulesTableColumns.tsx create mode 100644 src/app/modules/hooks/useModulesWithAttrsList.ts create mode 100644 src/app/modules/page.tsx diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 96c23fd..e69e359 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -16,6 +16,7 @@ import { import { theme } from "@/theme"; import "@/app/global.css"; import { ContextMenuProvider } from "mantine-contextmenu"; +import { DatesProvider } from "@mantine/dates"; import { ModalsProvider } from "@mantine/modals"; import { Notifications } from "@mantine/notifications"; import { ProjectsContextProvider } from "@/app/deals/contexts/ProjectsContext"; @@ -71,31 +72,33 @@ export default function RootLayout({ children }: Props) { - - - - - - - - {children} - - -