Commit Graph

83 Commits

Author SHA1 Message Date
hosseintaromi 4f4ef51ccc feat: enhance input handling and product management features
- Added numeric input handling in Input component with Persian to English conversion
- Updated MultiSelectAutocomplete styles for dark mode compatibility
- Enhanced VariantManager to support product options and improved variant data handling
- Updated ProductDetailPage and ProductFormPage to display and manage product options
- Improved ProductsListPage to handle numeric filters with Persian number conversion
2025-07-30 08:29:19 +03:30
hosseintaromi a6e59b7c85 perf: optimize bundle size with code splitting and lazy loading
Bundle Size Optimization:
- Add lazy loading for all page components
- Implement Suspense wrapper with loading fallbacks
- Configure manual chunks for vendor libraries
- Separate chart library (recharts) into vendor-charts chunk

Results:
- Split single 950KB bundle into multiple optimized chunks
- Main vendor chunks: React (162KB), Forms (65KB), Charts (402KB)
- Each page loads independently with lazy loading
- Improved initial load time and caching efficiency
- Install terser for better minification

Chunks created:
- vendor-react: React dependencies
- vendor-forms: Form validation libraries
- vendor-query: React Query
- vendor-toast: Toast notifications
- vendor-charts: Chart library (lazy loaded)

This resolves the bundle size warning and improves performance
2025-07-29 09:58:41 +03:30
hosseintaromi 4a0507c09c feat: add AdminUserDetailPage for detailed admin user view
- Implemented AdminUserDetailPage to display user information
- Added loading and error handling states
- Included user roles and permissions display
- Integrated date formatting and status badge components
2025-07-29 09:51:46 +03:30
hosseintaromi b287eaa320 chore: update remaining configuration files
- Update routes configuration
- Update roles module hooks, models, and requests
- Ensure all modified files are properly committed
2025-07-29 09:50:23 +03:30
hosseintaromi 0082da5928 fix: resolve remaining TypeScript errors
- Fix toast context usage in CategoryFormPage
- Add null checks for optional properties (product.price, product.status)
- Fix undefined checks for product_id parameters
- Add type assertion for PRODUCT_TYPE_LABELS indexing
- Fix number/string type conversions in ProductFilters
- Add proper type handling for form validation

All TypeScript compilation errors are now resolved
2025-07-29 09:50:08 +03:30
hosseintaromi e0156658a2 fix: update component interfaces and props
Input Component:
- Add icon prop to support icon display

Typography Component:
- Add actions prop to FormHeader for flexible action buttons

Modal Usage:
- Add required title prop to Modal components in Users pages

UserForm Component:
- Add missing props: initialData, onCancel, loading, isEdit
- Support both defaultValues and initialData patterns

These changes resolve TS2741 and TS2322 type errors
2025-07-29 09:49:58 +03:30
hosseintaromi 57287c866c feat: update type definitions and models
Product Model:
- Add sku, price, status, category properties
- Add status to ProductFilters interface

Category Model:
- Add parent_id property for hierarchical categories

ProductOption Model:
- Add name property for better identification

These changes resolve TS2339 property errors throughout the application
2025-07-29 09:49:48 +03:30
hosseintaromi 83a400687e fix: remove unused imports to resolve TS6133 errors
- Remove unused React imports from components
- Remove unused icon imports (User, Mail, Phone, Search, etc.)
- Remove unused component imports (Button, LoadingSpinner, etc.)
- Remove unused type imports (LoginRequest)
- Clean up import statements across all pages and components
2025-07-29 09:49:27 +03:30
hossein taromi 88958ee63a feat: add remaining UI improvements and new features
- Add cypress test configuration and e2e tests
- Update various components styling and functionality
- Add product detail page and other new features
- General codebase improvements and fixes
2025-07-28 13:22:44 +03:30
hossein taromi c2f938bda8 fix: improve category form functionality
- Fix loading button state in category form (use Button loading prop instead of manual spinner)
- Fix redirect after successful category create/update (move navigation to mutation callbacks)
- Remove duplicate toast messages
- Ensure proper navigation only after successful API calls
2025-07-28 13:22:30 +03:30
hossein taromi e9473f7a49 fix: resolve roles management issues
- Fix missing icon imports in RoleDetailPage (Edit, Calendar, FileText)
- Fix role title display in roles list (change from role.name to role.title)
- Fix role data fetching with proper API response structure
- Add RoleResponse interface for better API handling
- Improve error handling in getRole function
2025-07-28 13:22:15 +03:30
hosseintaromi b3c3a8afd0 fix(product-options): update API routes and enhance product option models 2025-07-28 09:11:08 +03:30
hossein taromi 87213732a2 feat(products): implement comprehensive product management system
- Add complete product models matching API structure exactly
- Implement products list page with advanced filtering and search
- Add comprehensive product form with all API fields:
  * Basic info (name, description, design_style, type, enabled)
  * Multi-category selection with search
  * Product options integration
  * Custom attributes management
  * Image upload with preview
  * Variants management with full specification
- Include PRODUCT_TYPES constants and labels
- Support for simple, variable, grouped and external products
2025-07-27 14:45:57 +03:30
hossein taromi 5dbe901ac7 feat(categories): implement product categories management system
- Add categories models, requests and hooks with full CRUD support
- Implement categories list page with search, filtering and pagination
- Add category form page for creating and editing categories
- Include responsive design for mobile and desktop views
- Add real-time preview and validation for better user experience
2025-07-27 14:45:43 +03:30
hossein taromi b17c8bb408 feat(product-options): implement product options management system
- Add product options models, requests and hooks
- Implement product options list page with search and CRUD operations
- Add product option form page with TagInput for values management
- Include real-time preview and help sections for better UX
- Support for color, size, material and other product variations
2025-07-27 14:45:31 +03:30
hossein taromi dce0f918ef feat(admin-users): enhance admin user management with permissions and roles
- Add permissions and roles multi-select to admin user form
- Update admin user models to include permissions and roles arrays
- Make permissions list page read-only by removing CRUD actions
- Integrate MultiSelectAutocomplete for better UX
2025-07-27 14:45:01 +03:30
hosseintaromi 2e9fa5460e admin-users: add skeleton loading component and improve error handling 2025-07-22 09:02:00 +03:30
hosseintaromi 30969723fa permissions: implement complete permissions management
- Add permissions CRUD operations (list, create, edit, delete)
- Implement proper API request/response handling
- Create hooks and request functions following established pattern
- Add TypeScript interfaces and form validation
- Include proper error handling and user feedback
2025-07-22 08:48:44 +03:30
hosseintaromi 3f4aefb112 admin-users: implement complete admin users management
- Add admin users CRUD operations (list, create, edit, delete)
- Implement proper API response structure handling (admin_user vs user)
- Add form validation with conditional password requirement (optional in edit mode)
- Create reusable hooks and request functions following established pattern
- Add TypeScript interfaces and proper error handling
- Include debug logging for API responses
2025-07-22 08:48:36 +03:30
hosseintaromi 174452d65d roles: fix API response handling
- Add defensive programming for null API responses
- Handle roles array being null in API response
- Fix role permissions array handling
- Add proper fallbacks to prevent 'map is not a function' errors
2025-07-22 08:48:28 +03:30
hosseintaromi 4d385f2031 auth: update authentication system
- Update AuthContext with new login response structure
- Add isLoading state to prevent premature redirects
- Implement proper session restoration from localStorage
- Update permission checking logic (id=1 = super admin)
- Fix login form to use new API structure
- Store tokens, user info, and permissions in localStorage
2025-07-22 08:48:12 +03:30
hosseintaromi fa755515bb fix(roles): correct Button variants
- Change outline to secondary/primary/danger variants
- Fix linter errors for Button component variants
- Update icons and button styling
2025-07-22 00:04:43 +03:30
hosseintaromi 37747941ce fix(roles): add fallback and debug for roles API response
- Add console.log to debug roles API response structure
- Handle different API response formats (results, items, data fields)
- Add fallback to empty array when API fails or returns non-array
- Fix roles?.map error by ensuring roles is always an array
- Handle backend API not working scenario
2025-07-22 00:04:25 +03:30
hosseintaromi d06135824d feat(auth): implement Super Admin permission system
- Update AdminUser interface to match new API response structure
- Remove permissions/roles from AdminUser (they come separately)
- Update hasPermission logic: id=1 (AdminAll) = Super Admin access
- Fix localStorage handling to remove admin_all_permissions key
- Super Admin (permission id=1) now has access to everything
- Other users checked against their specific permissions
2025-07-22 00:01:53 +03:30
hosseintaromi ebd2c3c8f7 feat(roles): add role permissions management page
- Two-column layout for assigned vs available permissions
- Real-time permission assignment and removal
- Confirmation modals for destructive actions
- Complete permissions list with descriptions
- Visual distinction between assigned and available permissions
2025-07-18 14:03:04 +03:30
hosseintaromi cdf0eb29f3 feat(roles): add role detail page
- Complete role information display
- Statistics and metadata sections
- List of assigned permissions
- Quick access to edit and permissions management
- Responsive layout with proper Persian typography
2025-07-18 14:03:01 +03:30
hosseintaromi 4b4fe84cee feat(roles): add role form page for create/edit
- Unified form for both create and edit operations
- Form validation with Yup schema
- Auto-populate fields in edit mode
- Proper navigation and loading states
- Persian validation messages
2025-07-18 14:02:58 +03:30
hosseintaromi 0ee448d9be feat(roles): add roles list page
- Complete table view with role information
- CRUD operations (view, edit, delete, permissions)
- Delete confirmation modal
- Responsive design with proper Persian RTL
- Loading states and error handling
2025-07-18 14:02:55 +03:30
hosseintaromi efb92ac136 feat(roles): implement roles core architecture
- Add comprehensive role and permission models
- Add all CRUD API request functions
- Add custom hooks with React Query integration
- Support role permissions management
- Follow established development pattern
2025-07-18 14:02:53 +03:30
hosseintaromi 0833a6180a feat(drafts): implement drafts feature structure
- Add draft API request functions
- Add custom hooks for draft data fetching
- Update React Query to use @tanstack/react-query
- Follow established development pattern
2025-07-18 13:06:15 +03:30
hosseintaromi 64a63e01fb refactor(login): update Login page to use custom hook
- Replace direct AuthContext usage with useLogin hook
- Change form field from email to username
- Add proper error handling and navigation
- Follow separation of concerns pattern
2025-07-18 13:06:12 +03:30
hosseintaromi d45f588fa7 feat(auth): implement authentication structure
- Add auth helper functions (getAuth, postLogout)
- Add postLogin API request function
- Add useLogin custom hook with React Query
- Update validation schema from email to username
2025-07-18 13:06:06 +03:30
hosseintaromi 46d9c20d87 Update file structure and improve code organization in the main directory 2025-07-13 22:03:22 +03:30