From 2b8f9a9cbc9aaa0baa5bc924ea46012a852bb216 Mon Sep 17 00:00:00 2001 From: Firman Ramdhani <33869609+firmanramdhani@users.noreply.github.com> Date: Fri, 10 Jul 2026 22:58:55 +0700 Subject: [PATCH] feat: add full page index component with pagination and actions - Implemented FullPagePageIndex component with mock data for database clusters. - Added pagination and bulk actions for managing database clusters. - Created navigation context hooks for detail, edit, duplicate, and create actions. - Introduced a new store for managing state in full-page and single-page modules. feat: add navigation localization files - Added English and Indonesian localization files for navigation menu items. - Included translations for various modules including CRM, Sales, Supply Chain, and more. feat: create system information shortcuts component - Developed Shortcut component to display keyboard shortcuts with search functionality. - Implemented System component to show placeholder information when system details are unavailable. - Added localization for shortcuts and system information in English and Indonesian. feat: implement global theme store - Created a Zustand store for managing theme color scheme with localStorage persistence. feat: add module page header component - Developed ModulePageHeader component for consistent page header across modules. - Included breadcrumb navigation, title, description, and action buttons. feat: define default privileges for enterprise module - Established default privileges for CRUD operations and other actions in the enterprise module. --- apps/web/package.json | 3 +- apps/web/src/apps/index.tsx | 21 +- .../presentation/locales/en/full-page.json | 3 +- .../presentation/locales/id/full-page.json | 3 +- .../pages-backup/full-page.page.detail.tsx | 131 +++++ .../pages-backup/full-page.page.form.tsx | 110 ++++ .../pages-backup/full-page.page.index.tsx | 424 ++++++++++++++++ .../pages/full-page.page.detail.tsx | 130 ++++- .../pages/full-page.page.form.tsx | 148 +++++- .../pages/full-page.page.index.tsx | 472 ++++++++++++++---- .../presentation/{states => store}/index.ts | 0 .../presentation/{states => store}/index.ts | 0 .../layouts/components/header.layout.tsx | 45 +- .../notifications/notification-dropdown.tsx | 14 +- .../modules/layouts/components/sidebar.tsx | 65 ++- .../apps/modules/layouts/data/menu.data.ts | 68 +-- .../apps/modules/layouts/locales/en/nav.json | 37 ++ .../apps/modules/layouts/locales/id/nav.json | 37 ++ .../apps/modules/layouts/module.layout.tsx | 10 + .../apps/modules/layouts/types/menu.types.ts | 2 +- .../information/components/shortcut/data.ts | 20 + .../information/components/shortcut/index.tsx | 103 ++++ .../information/components/system/index.tsx | 19 + .../apps/modules/system/information/index.tsx | 61 ++- .../information/locales/en/information.json | 34 ++ .../information/locales/id/information.json | 34 ++ .../components/ActionToolsShowcase.tsx | 15 +- .../stock-grid/live-stock-grid.ui.tsx | 59 ++- .../src/apps/showcase/shell-demo/index.tsx | 2 +- apps/web/src/apps/showcase/showcase-view.tsx | 10 +- apps/web/src/core/storage/local/index.ts | 2 + apps/web/src/core/store/theme.store.ts | 29 ++ .../base-remote.data-services.test.ts | 14 +- packages/core-i18n/src/locales/en/common.json | 43 +- packages/core-i18n/src/locales/id/common.json | 43 +- packages/ui/package.json | 1 + .../components/actions-tools/page-actions.tsx | 110 ++-- .../components/actions-tools/row-actions.tsx | 6 +- .../ui/src/components/actions-tools/types.ts | 10 +- .../core-app-shell/core-app-shell.tsx | 26 +- .../core-app-shell/core-page-container.tsx | 61 ++- .../src/components/system-pages/forbidden.tsx | 27 +- .../src/components/system-pages/not-found.tsx | 28 +- .../components/module-page-header.tsx | 310 ++++++++++++ .../constant/default-privilege.ts | 26 + .../enterprise-module/constant/index.ts | 1 + .../enterprise-module/entities/entity.ts | 48 +- .../hooks/use-index-page.context.ts | 15 +- .../foundations/enterprise-module/index.ts | 4 + .../providers/index-page.provider.tsx | 97 ++++ .../providers/module.provider.tsx | 27 +- packages/ui/src/provider/theme-provider.tsx | 13 +- packages/ui/src/theme.css | 41 +- packages/ui/src/theme/tokens/colors.ts | 28 ++ pnpm-lock.yaml | 73 +++ 55 files changed, 2809 insertions(+), 354 deletions(-) create mode 100644 apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.detail.tsx create mode 100644 apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.form.tsx create mode 100644 apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.index.tsx rename apps/web/src/apps/modules/example/full-page/presentation/{states => store}/index.ts (100%) rename apps/web/src/apps/modules/example/single-page/presentation/{states => store}/index.ts (100%) create mode 100644 apps/web/src/apps/modules/layouts/locales/en/nav.json create mode 100644 apps/web/src/apps/modules/layouts/locales/id/nav.json create mode 100644 apps/web/src/apps/modules/system/information/components/shortcut/data.ts create mode 100644 apps/web/src/apps/modules/system/information/components/shortcut/index.tsx create mode 100644 apps/web/src/apps/modules/system/information/components/system/index.tsx create mode 100644 apps/web/src/apps/modules/system/information/locales/en/information.json create mode 100644 apps/web/src/apps/modules/system/information/locales/id/information.json create mode 100644 apps/web/src/core/store/theme.store.ts create mode 100644 packages/ui/src/foundations/enterprise-module/components/module-page-header.tsx create mode 100644 packages/ui/src/foundations/enterprise-module/constant/default-privilege.ts create mode 100644 packages/ui/src/foundations/enterprise-module/constant/index.ts diff --git a/apps/web/package.json b/apps/web/package.json index bb1468b..fc8add5 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -31,7 +31,8 @@ "react-i18next": "^15.4.0", "react-router-dom": "^7.11.0", "tailwindcss": "^4.1.18", - "zod": "^3.25.36" + "zod": "^3.25.36", + "zustand": "^5.0.14" }, "devDependencies": { "@repo/eslint-config": "workspace:*", diff --git a/apps/web/src/apps/index.tsx b/apps/web/src/apps/index.tsx index 5d6914d..9c10be8 100644 --- a/apps/web/src/apps/index.tsx +++ b/apps/web/src/apps/index.tsx @@ -1,8 +1,9 @@ import { lazy, Suspense, useState } from 'react'; import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'; -import { ThemeProvider, ColorSchemeType, DensityType } from '@repo/ui/provider'; +import { ThemeProvider, DensityType } from '@repo/ui/provider'; import { NotFound, Forbidden, Maintenance, ComingSoon } from '@repo/ui/components'; import { LoadingScreen } from '../core/components/loading-screen'; +import { useThemeStore } from '../core/store/theme.store'; const AuthModule = lazy(() => import('./auth')); const AppModule = lazy(() => import('./modules')); @@ -10,7 +11,7 @@ const ShowcaseView = lazy(() => import('./showcase/showcase-view')); const ShellDemo = lazy(() => import('./showcase/shell-demo')); export default function App() { - const [colorScheme, setColorScheme] = useState('light'); + const colorScheme = useThemeStore((s) => s.colorScheme); const [density, setDensity] = useState('compact'); return ( @@ -20,20 +21,10 @@ export default function App() { } /> } /> - - } - /> + } /> } /> - } /> - } /> + } /> + } /> } /> } /> } /> diff --git a/apps/web/src/apps/modules/example/full-page/presentation/locales/en/full-page.json b/apps/web/src/apps/modules/example/full-page/presentation/locales/en/full-page.json index fe973f1..159078d 100644 --- a/apps/web/src/apps/modules/example/full-page/presentation/locales/en/full-page.json +++ b/apps/web/src/apps/modules/example/full-page/presentation/locales/en/full-page.json @@ -1,5 +1,6 @@ { - "title": "Full Page Management", + "title": "Full Page", + "description": "An example module of a <1>full page layout for detailed forms.", "fields": { "status": "Status", "name": "Name", diff --git a/apps/web/src/apps/modules/example/full-page/presentation/locales/id/full-page.json b/apps/web/src/apps/modules/example/full-page/presentation/locales/id/full-page.json index 0d7d6ac..7912506 100644 --- a/apps/web/src/apps/modules/example/full-page/presentation/locales/id/full-page.json +++ b/apps/web/src/apps/modules/example/full-page/presentation/locales/id/full-page.json @@ -1,5 +1,6 @@ { - "title": "Manajemen Halaman Penuh", + "title": "Halaman Penuh", + "description": "Contoh modul <1>tata letak halaman penuh untuk formulir detail.", "fields": { "status": "Status", "name": "Nama", diff --git a/apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.detail.tsx b/apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.detail.tsx new file mode 100644 index 0000000..c29969d --- /dev/null +++ b/apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.detail.tsx @@ -0,0 +1,131 @@ +import { Paper, SimpleGrid, Box, Text, Group, Badge, Divider, Breadcrumbs, Anchor, Flex, Title, ActionIcon, Button } from '@repo/ui/components'; +import { useEnterpriseModuleTranslationContext } from '@repo/ui/foundations'; +import { ChevronRight, CheckCircle2, Trash2, Edit2, Play } from 'lucide-react'; + +export default function FullPagePageDetail() { + const { t } = useEnterpriseModuleTranslationContext(); + + return ( + + {/* --- INLINED PAGE HEADER --- */} + + } + > + + Acme Corp + + + Infrastructure + + + Database Clusters + + + prod-db-01 + + + + + + + + + prod-db-01 + + } + style={{ textTransform: 'capitalize' }} + > + Running + + + + + PostgreSQL v15.4 · us-east-1 · Created Oct 12, 2023 + + + + + + + + + + + + + + + + {/* --- END INLINED PAGE HEADER --- */} + + + + General Information + + + View the complete details and configuration for this entity. + + + + + + + + {t('fields.code')} + + WID-001 + + + + {t('fields.name')} + + Dashboard Widget + + + + {t('fields.status')} + + + ACTIVE + + + + + {t('fields.description')} + + Main dashboard widget + + + + + ); +} diff --git a/apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.form.tsx b/apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.form.tsx new file mode 100644 index 0000000..fd05951 --- /dev/null +++ b/apps/web/src/apps/modules/example/full-page/presentation/pages-backup/full-page.page.form.tsx @@ -0,0 +1,110 @@ +import { Paper, Box, Text, Divider, TextInput, Select, Textarea, Stack, Breadcrumbs, Anchor, Flex, Title, Button, Group } from '@repo/ui/components'; +import { useEnterpriseModuleTranslationContext } from '@repo/ui/foundations'; +import { ChevronRight, Database } from 'lucide-react'; + +export default function FullPagePageForm({ formPageType }: { formPageType: 'edit' | 'create' | 'duplicate' }) { + const { t } = useEnterpriseModuleTranslationContext(); + + return ( + + {/* --- INLINED PAGE HEADER --- */} + + } + > + + Database Clusters + + + {formPageType === 'create' ? 'Create Cluster' : 'Edit Cluster'} + + + + + + + + {formPageType === 'create' ? 'Create New Cluster' : 'Edit Cluster Configuration'} + + + Configure and provision a new highly available database cluster. + + + + + + + + + + + + + {/* --- END INLINED PAGE HEADER --- */} + + + + {formPageType === 'create' ? 'Create Entity' : 'Edit Entity'} + + + Fill in the required information to configure your entity properly. Fields marked with * are required. + + + + + + + + +