fix: fix errors with gallery and improvements#2
Merged
IvanPartsunev merged 26 commits intomainfrom Dec 7, 2025
Merged
Conversation
…nd backend - Added "Accountant" to user roles with specific access restrictions and UI updates in UserManagement and Navigation pages. - Updated role-based document filtering logic to allow Accountants access only to accounting documents. - Enabled Accountants to upload, view, and delete accounting documents while restricting actions on other document types. - Updated backend endpoints and file operations to enforce Accountant
- Added `useNavigate` hook and introduced smooth navigation transitions to prevent flickering on mobile. - Adjusted breakpoint for mobile devices and improved display across varying screen sizes. - Enhanced `Table`, `Navigation`, and `Card` components with responsive layouts and refined styles. - Introduced `TableSkeleton` and `TablePagination` for better loading indicators and pagination control. - Updated admin and product-related layouts to follow consistent visual hierarchy. - Improved gallery card and news card interactions with animated scaling effects.
… design - Introduced `Footer` with gradient overlays and placeholder text for branding. - Added `Header` with dynamic background effect based on scroll position. - Implemented `GalleryModal` for image previewing with keyboard and touch navigation support.
- Improved `Navigation` button styles for better mobile interactions. - Updated `GalleryModal` with adjusted layouts, hidden buttons on mobile, and enhanced close button styling. - Introduced lazy loading for gallery images using Intersection Observer to optimize performance. - Refined gallery grid with responsive masonry layout and image hover effects. - Temporarily switched `API_BASE_URL` to the local development environment for testing.
- Removed `onPointerDownOutside` for improved gesture handling. - Enhanced button styles with shadows, focus states, and better alignment. - Adjusted layout paddings and image counter background for improved clarity. - Updated navigation buttons for consistent hover and active effects.
…aching - Replaced manual `useEffect` data fetching with React Query hooks across multiple components (`ProductsTable`, `FilesTable`, `CooperativeMembers`, `Proxies`, `Board`, `Control`, `Home`). - Centralized error handling and loading states for improved code maintainability. - Added `CacheControlMiddleware` in the backend for configurable cache policies, optimizing API responses. - Integrated `QueryClientProvider` for cache management in the frontend. - Updated `GalleryModal` and UI components with styling improvements for better accessibility and responsiveness. - Enhanced `package.json` with `@tanstack/react-query` dependency and synced lock files.
- Added new tabs for Members and Emails management in AdminPanel. - Implemented persistent tab selection using localStorage. - Introduced drag-and-drop functionality to GalleryManagement for image uploads. - Replaced bulk delete in DocumentsManagement with individual file delete for better control. - Updated UI components with design improvements: responsive layouts, enhanced file input fields, and styled action buttons. - Removed unnecessary CloudFront invalidation step from Makefile for optimized deployment.
- Added `s3:DeleteObject` to the permissions list for backend Lambda.
…lity - Introduced new reusable hooks (`useNews`, `useGallery`, `useProducts`, `useMembers`, `useFiles`, `useUsers`) for managing API interactions with React Query. - Enhanced caching and query key factories for optimized API calls. - Updated admin panel with new pages: `EmailsManagement` and `MembersManagement`. - Implemented drag-and-drop file upload for members syncing and gallery management. - Improved query caching using a centralized `queryClient` configuration in `lib/queryClient.ts`.
…in backend - Removed unnecessary cache invalidation message from Makefile to streamline deployment output. - Reordered `CacheControlMiddleware` initialization for proper middleware execution. - Updated `Home` page to refine `NewsCard` property mapping based on `is_public` attribute changes. - Removed unused `News` interface for cleaner frontend code.
…ion in Header - Replaced redundant `<div>` wrapper with fragments for cleaner DOM structure. - Updated `Header` component to include `Navigation` for consistent placement. - Removed embedded `Navigation` from `App` routes, aligning navigation handling with `Header`.
- Allowed Unicode characters in filenames while enforcing S3-safe restrictions. - Adjusted filename cleaning logic to handle special characters and improve URL structure. - Updated file download headers to support Unicode filenames. - Improved file upload form UX with toast notifications for errors and success messages. - Replaced outdated error/success messages with a modern toast system. - Reduced React Query file list stale time from 1 hour to 1 minute for fresher data.
…ents - Updated `Navigation` component to streamline class names and remove redundant styles. - Adjusted `Header` and `Base` components to relocate and consistently render the `Navigation` bar. - Introduced sticky desktop navigation in `Base` for improved user experience.
- Unified table styles for better responsiveness (`overflow-x-auto`, column group widths, `whitespace-nowrap` adjustments). - Added user role checks (`useAuth`) across member-related components (`CooperativeMembers`, `Proxies`, `Board`, `Control`) for enhanced conditional rendering. - Refined file size display to distinguish between KB and MB. - Introduced `/me` endpoint in the backend to fetch authenticated user details. - Adjusted `sync_members_list` endpoint to `/sync_members` and updated operations with `proxy` normalization. - Enhanced AuthContext to manage user state and added `user` to context provider values.
… expiration - Fixed `#name` attribute reference in `products/operations.py` for proper DynamoDB update expression syntax. - Increased `ACCESS_TOKEN_EXPIRE_MINUTES` from 1 to 5 in `auth/operations.py` to provide more practical access token lifespan.
- Adjusted table column widths across frontend components for consistency and improved readability. - Updated `useNews` hook to simplify query keys and handle user authentication state. - Added member counts to several titles (`Board`, `Control`, `CooperativeMembers`, `Proxies`) for better context. - Improved `ProductsManagement` form validation and payload handling to ensure clean and accurate data submission. - Replaced deprecated `is_public` attribute in `NewsCard` with new `news_type` for better clarity.
- Simplified `_check_file_allowed_to_user` function with clearer role-based access and document type categorization. - Updated `download_file` to incorporate user role in file validation. - Extended `/members` endpoint to refine data visibility based on roles (admins, accountants, regular users). - Added `active` status check in user authentication to restrict access for inactive accounts.
…ility - Introduced `isBoardOrControl` and `canSeeContactInfo` checks to enhance data visibility in `CooperativeMembers` and `Proxies` components. - Updated `Board` and `Control` pages to conditionally display email and phone based on authentication state. - Improved overall table handling logic for member-related components.
… `Proxies` - Updated conditional rendering logic to properly check `member_code_valid` status. - Ensured accurate icon display (checkmark or cross) based on validation results.
- Enhanced error messages for file uploads, including invalid formats and size limits (max 15MB). - Introduced image type and size validation in both frontend and backend. - Updated `errorUtils` to extract and detail API errors for improved user feedback. - Improved gallery management with file validation logic and dynamic toast notifications. - Adjusted backend to provide clearer error responses for image-related issues. - Updated UI to reflect updated file size limit in gallery upload instructions.
…components - Updated `UserManagement` to suppress redundant error toasts for authentication refresh errors. - Switched `useNews` hook to use `AuthContext` for better authentication handling and reduced query stale time to 5 minutes for improved responsiveness. - Refactored `AlertDialog` components with `React.forwardRef` for better type safety and reusability. - Enhanced `AuthContext` to invalidate queries on token refresh/logout and handle user state changes seamlessly. - Improved `apiClient` to mark and handle authentication refresh errors efficiently.
- Standardized column widths and added `whitespace-nowrap` for better table readability in `NewsManagement`, `ProductsManagement`, and `DocumentsManagement`. - Introduced uploader name enrichment in file metadata for improved display in `DocumentsManagement`. - Simplified product form validation and payload generation for cleaner code and accurate submissions.
…backend code - Cleaned up unnecessary blank lines across multiple modules to improve code readability. - Simplified argument layout in function definitions and exception handling for more concise formatting. - Standardized `import` statements and improved alignment of dictionary definitions for better consistency. - Applied minor updates to string formatting for enhanced clarity in error messages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added fixes to formating, gallery and auth management