Commit Graph

26 Commits

Author SHA1 Message Date
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 bdfbef91ac fix(utils): remove withCredentials to fix CORS issue
- Remove withCredentials from axios config to prevent CORS errors
- API authentication will be handled via Authorization header
- Tested working with Postman curl command
2025-07-21 23:49:19 +03:30
hosseintaromi 3e9bfd3f33 feat(swagger): add Swagger UI documentation page 2025-07-21 23:48:39 +03:30
hosseintaromi 2a5875fd40 fix(utils): fix APIUrlGenerator undefined base URL issue
- Replace import.meta.env.VITE_APP_BACKEND_BASE_URL with API_GATE_WAY constant
- Ensure API URLs are generated correctly without undefined segments
- Fix API endpoint URL construction
2025-07-21 23:36:13 +03:30
hosseintaromi 9b39a4ac47 fix(config): update API base URL to staging server
- Change base URL from http://185.208.175.150:8090 to https://apimznstg.aireview.ir
- Update to use HTTPS staging environment
2025-07-21 23:32:39 +03:30
hosseintaromi 13627a382c docs: update package.json
- Maintain package.json consistency
2025-07-18 14:03:18 +03:30
hosseintaromi 40b0e0153f refactor(utils): clean up HTTP service imports
- Remove unused AxiosResponse import
- Optimize TypeScript imports for better build performance
2025-07-18 14:03:09 +03:30
hosseintaromi f43e7ca0e5 feat(navigation): integrate roles into app navigation
- Add all roles routes to App.tsx
- Add roles menu item to sidebar with Shield icon
- Update user display to use AdminUser properties
- Fix TypeScript compatibility issues with new auth types
2025-07-18 14:03:07 +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 50f596c999 feat(config): add roles API routes and query keys
- Add comprehensive roles API endpoints
- Add permissions API endpoint
- Add React Query keys for roles operations
2025-07-18 14:02:50 +03:30
hosseintaromi 0d322f1767 feat(utils): add base HTTP service for API calls
- Add axios-based HTTP service with interceptors
- Add authentication header management
- Add APIUrlGenerator for dynamic URL building
- Support for all HTTP methods (GET, POST, PUT, DELETE, etc.)
- Error handling and automatic logout on 401/403
2025-07-18 13:06:32 +03:30
hosseintaromi e5b23fdeb1 refactor(services): remove unused authService
- Remove authService as authentication logic moved to custom hooks
- Maintain separation of concerns pattern
2025-07-18 13:06:17 +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 7ec69a67e7 refactor(auth): update AuthContext for new API structure
- Remove login logic from context (moved to custom hook)
- Add restoreSession functionality
- Update state management for new auth response structure
- Add permission checking by ID and title
- Manage access_token and refresh_token separately
2025-07-18 13:06:09 +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 2ea8d19c87 feat(types): add authentication type definitions
- Add Permission, Role, AdminUser interfaces
- Add LoginRequest, LoginResponse, AuthState types
- Update main types index with auth exports
2025-07-18 13:06:03 +03:30
hosseintaromi b15c0ac5ab feat(config): add API configuration and constants
- Add API base URL and routes configuration
- Add environment variables types
- Add query keys for React Query
- Add general variables like pageSize
2025-07-18 13:06:00 +03:30
hosseintaromi 2ef0ad3c1d Add swagger.json for API documentation and define admin routes 2025-07-18 12:49:20 +03:30
hosseintaromi 07acb8c1b8 Update package dependencies to include js-cookie and its type definitions 2025-07-18 12:49:14 +03:30
hossein 9e416e5d05 add docker-compose for stage 2025-07-13 20:05:16 +00:00
hosseintaromi 46d9c20d87 Update file structure and improve code organization in the main directory 2025-07-13 22:03:22 +03:30