Introduced a delete button to the Edit Theme page, allowing users to delete themes with a confirmation prompt. Upon deletion, users are redirected to the event themes dashboard. Updated relevant imports and added a handler for the delete action.
Updated conditions to check 'uploads/' without a leading slash across preview, background, foreground, and asset image URLs. This ensures consistent handling of URLs during the relocation process and avoids potential mismatches in the path string comparison.
Updated the file relocation function to use `settings.DATA_FILES_DIR` for theme folders and improved filename handling by prefixing with the file type. Adjusted logic to handle URLs consistently and ensure paths are properly resolved. This enhances maintainability and organizes theme files more effectively.
Adjusted the grid column behavior for medium screens in event themes and commented out unused badge rendering. Updated the image uploader to handle `existingImage` using the server URL and added debugging output. Modified the event theme context to use a fixed refetch interval of 60 seconds.
Added `refetchOnWindowFocus` and `refetchIntervalInBackground` options to the event theme query. This ensures data stays updated when switching tabs or in the background.
Replaced direct `preview_image_url` usage with `getServerFileUrl` for consistent file URL handling. Updated the "Edit Theme" button to navigate to the `/edit` path for improved routing clarity.
The Cancel button was commented out as it is no longer needed. This simplifies the UI and reduces potential confusion for users. Future iterations can reintroduce it if necessary functionality is added.
Updated the layout to use a responsive grid for displaying assets and separated CardHeader for better organization. Simplified the asset input and image uploader components while improving responsiveness and styling consistency. Removed redundant code and added enhancements for a cleaner and more user-friendly UI.
Replace direct `fileUrl` usage with `getServerFileUrl` utility for consistent server URL formatting. Remove unnecessary fallback logic to streamline image selection.
Replaced direct SDK file upload calls with generated React Query mutations for better progress tracking and error handling. Streamlined logic for obtaining presigned URLs and uploading files, ensuring consistency and maintainability. Removed redundant code and improved state management during the upload process.
Added support for loading images from pragmazest.com and localhost. This allows flexibility for handling remote images during development and production. Adjustments align with application requirements for external asset management.
Relocated common constants to a new "lib/constants" directory for better organization. Added BACKEND_API_URL constant to manage API base URL dynamically. Introduced a utility function `getServerFileUrl` to generate file URLs using the backend API.
Updated file URL generation to return relative paths instead of absolute paths, ensuring better portability and consistency. Adjusted relevant methods to compute paths relative to the base directory.
Replaced manual XMLHttpRequest implementation with the SDK's `uploadFile` method for handling file uploads to presigned URLs. This simplifies the code, leverages built-in features like progress tracking, and improves error handling. Added token extraction and upload progress updates to maintain functionality.
Replaced calls to get_file_url with get_uploaded_file_url where appropriate. Added the get_uploaded_file_url method to the StorageProvider class and its implementations for more specific URL generation. Updated corresponding tests and API routes to reflect this change.
Updated color, font, and asset forms to use Card and CardContent for improved structure and consistency. Enhanced input styles and hover effects for better user experience. Adjusted the image uploader background for a more cohesive design.
Introduced the `usePresignedUpload` hook for file uploads and multiple components for event theme management, including form handling, asset uploads, and UI enhancements. These additions support creating, editing, and managing event themes effectively.
Fixed the href value in the "Create Your First Theme" button to point to the correct `/dashboard/event-themes/new` route. This ensures proper navigation and resolves potential routing issues.
Included @radix-ui/react-progress (v1.1.2) in package.json and package-lock.json. This addition introduces progress components, enhancing the UI toolkit. Updated related peer and optional dependencies accordingly.
Simplify and standardize type and function names for uploadFile and generatePresignedUrl operations. This change improves readability and aligns naming conventions across the codebase. No functional behavior was altered.
The `operation_id` field was added to the `generate_presigned_url` and `upload_file` endpoints. This enhances the OpenAPI documentation by providing unique identifiers for better API clarity and client generation.
Introduces schemas, types, and API endpoints for managing file uploads using presigned URLs. Includes request and response models, React Query hooks, and client SDK functionality for generating and consuming presigned URLs.
Implemented various tests to validate the theme creation process, including tests for successful creation, validation failures, image relocation, large data handling, and error scenarios such as database issues. Introduced mock dependencies to simulate behaviors like file relocation and database operations. Ensured all edge cases are covered to improve robustness and reliability.
Enhanced theme creation and update logic to include proper file organization by relocating and managing URLs for images and assets. Introduced roles validation to restrict access to superusers for these operations. Updated tests to align with the refactored logic and dependencies.
Introduce `_relocate_theme_file` to handle moving files to theme-specific directories in the storage system. This ensures better organization of uploaded files by associating them with a theme ID and file type, improving maintainability and structure.
Implemented endpoints for generating presigned URLs and handling file uploads. Added corresponding test cases to ensure proper functionality and error handling. Updated the main router to include the new uploads API.
Introduced two Pydantic models: `PresignedUrlRequest` and `PresignedUrlResponse`. These define the request and response structures for presigned URL generation, including fields for filenames, content types, and expiration details. This provides a clear contract for handling presigned URL functionality.
Introduce helper functions to generate unique filenames, create date-based storage paths, and validate image content types. These utilities centralize and streamline file-related operations for consistency and reusability.
Introduced new fixtures and tests for storage functionality, including saving files, generating URLs, and token creation/verification. Refactored `get_storage_provider` into a separate dependency module. Enhanced test coverage for improved reliability.
Renamed `base_dir` to `upload_folder` for better clarity and alignment with its purpose. Adjusted references and settings variable to reflect the updated naming convention. This enhances code readability and consistency.
Introduced `create_upload_token` and `verify_upload_token` functions to handle secure file uploads. These utilities generate signed tokens with expiration and content validation, ensuring upload security. Verification includes signature integrity and expiration checks.
Renamed API_V1_STR to API_VERSION_STR for consistency. Introduced 'UPLOAD_FOLDER' and ensured its creation, added logging for the data directory path, and implemented allowed image content type validation. Adjusted related references in `main.py`.
Introduce a new environment variable, `DATA_FILES_DIR`, for configuring static file storage. Updated `docker-compose` files to mount the host directory and propagate the variable. Implemented FastAPI `StaticFiles` to serve files from this directory under the `/files` route.
Introduced a new "Event Themes" page to allow users to manage visual themes for events. Updated the dashboard to include a button for navigating to the new page. The themes page supports listing, viewing, and creating themes, enhancing customization options for users.
Introduce `background_image_url`, `foreground_image_url`, `asset_image_urls`, and `is_active` properties to the `EventTheme` schemas and types. These additions enhance flexibility and allow better customization of event themes. Default value for `is_active` ensures consistent behavior.
Added `background_image_url`, `foreground_image_url`, and `asset_image_urls` fields to enhance theme customization. Updated `asset_image_urls` to use `MutableDict` with a default empty dictionary and ensured consistency in the model and migration script.
Encapsulated `EventsProvider` and `EventThemesProvider` into a new `DataProviders` component to simplify and modularize provider structure. Updated the root provider hierarchy to use `DataProviders`, improving maintainability and readability.
Introduced a new React context, EventThemesContext, to handle event theme state and CRUD operations. It includes support for creating, updating, deleting, and fetching themes with React Query integration. This provides a centralized solution for managing event theme-related data in the application.
This commit introduces functionality to delete event themes via the API. It includes type definitions, SDK methods, and a React Query mutation for `deleteEventTheme`. Users can perform both soft and hard deletes with this implementation.
Updated the `clean` target to use `docker compose down -v`, ensuring that volumes are also removed during cleanup. This prevents leftover volumes from persisting and occupying unnecessary space.
Introduce a new endpoint to delete event themes, supporting both soft and hard deletes. Hard deletes are restricted to superusers, while soft deletes deactivate the theme. Also, improve error handling and user permission checks for this operation.
The `is_active` field was introduced to the `EventTheme` model to indicate whether a theme is active. The corresponding test fixture in `conftest.py` was updated to include this new field, ensuring consistency in tests. This change enhances flexibility for managing event themes.
The Events link in the navbar has been commented out, effectively hiding it from the UI. This change may be temporary or subject to further decision, but it cleans up the navigation display for now.
Introduce a reusable Popover component with Trigger, Content, and Anchor subcomponents, leveraging Radix UI primitives for accessibility and animations. Includes utility classes for styling and positioning, ensuring consistency and ease of use in the UI.
Refactor event details page with a modernized design using cards, badges, and icons, improving user experience and accessibility. Introduce robust utilities in `/lib/utils.ts` for formatting dates and
Replaced the text-based logout button with a user menu using a popover. The menu includes the user's name and a logout option with an icon for better UX. This improves the design and accessibility of the authenticated navbar.
Reorganized container layouts across dashboard and event pages to remove redundant `div` wrappers and ensure consistent structure. This improves maintainability and simplifies the codebase while retaining visual behavior.