Conversation
…dules, hooks, components, and editor config
- Add webhook endpoint to handle ImageKit file creation events - Create webhook service to process and import files into Strapi - Add frontend functionality to trigger imports from media library - Support importing both main files and their format versions (thumbnails, small, medium, large) - Add comprehensive error handling and user notifications - Use direct database queries for better compatibility with Strapi 5 - Include metadata and format associations during import
- Add new media library read permission - Update permissions system to support media library access - Add translations for the new permission - Register permission in the bootstrap process - Update menu item to require the new permission - Organize settings permissions under a subcategory
Renamed the `isPrivate` setting to `useSignedUrls` across the codebase to better reflect its purpose of enabling signed URLs. This change affects settings forms, schemas, types, and service implementations, making the functionality more intuitive.
- Added `isPrivateFile` toggle in upload options to mark files as private in ImageKit - Enhanced URL generation to respect expiry settings for signed URLs - Fixed upload service to properly handle private file settings - Improved error handling in the upload provider - Updated translations for the new private file option - Ensured consistent behavior between upload and URL generation
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces version 1.0.0 of the Strapi ImageKit Provider by enhancing the admin panel integration, adding configuration and documentation files, and providing new hooks and error handling modules. Key updates include new admin UI components (like ImageKitLogo, Initializer, and Field), refined HTTP error handling through a custom HttpError class and useHTTP hook, and comprehensive documentation and configuration improvements.
Reviewed Changes
Copilot reviewed 69 out of 69 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| admin/src/index.ts | Sets up menu links, settings sections, and plugin registration. |
| admin/src/hooks/useHttp.ts | Introduces a custom HTTP hook for API calls with error handling. |
| admin/src/errors/HttpError.ts | Implements a custom error class for HTTP errors. |
| admin/src/components/* | Provides new reusable admin UI components with styling and icons. |
| README.md | Updates documentation to reflect plugin usage and setup details. |
| Various config files (.editorconfig, .prettierrc, etc.) | Introduces various configuration setups for code consistency. |
- Moved URL transformation logic from bootstrap to register.ts - Implemented using Strapi's built-in sanitizer system - Added proper type safety with Model and Data types - Improved client caching with clearImageKitClient function - Removed response decorator in favor of sanitizer approach - Enhanced transformation handling for image formats
- Removed unused clearImageKitClient function - Added uploadOptions to toUploadParams for more flexible file uploads
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces foundational improvements including new configuration, documentation updates, and new admin interface components for the ImageKit plugin.
- Added standardized configuration files such as .editorconfig and .prettierrc
- Updated documentation with a comprehensive README, CONTRIBUTING guidelines, and LICENSE
- Implemented new admin interface components and hooks to enhance plugin functionality
Reviewed Changes
Copilot reviewed 69 out of 69 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| admin/src/index.ts | Plugin registration with menu link, settings section and translation registration |
| admin/src/hooks/useHttp.ts | New HTTP hook implementation for API interactions using error handling |
| admin/src/errors/HttpError.ts | Custom HttpError class for enhanced HTTP error details |
| admin/src/components/** | New and styled React components including Initializer, ImageKitLogo, Field, etc. |
| Various configuration and documentation files | Added config files and updated project documentation for improved consistency and clarity |
|
|
||
| ## Configuration | ||
|
|
||
| ### Configure in Admin UI |
There was a problem hiding this comment.
I think baaki toh theek hai, but we can attach the screenshots here as well.
This pull request introduces several foundational updates to the project, including configuration files for development standards, documentation updates, and new components for the admin interface. These changes aim to enhance project maintainability, improve developer experience, and provide a better user interface for the plugin.
Development Environment and Configuration Updates
.editorconfig: Added a configuration file to standardize code formatting across editors, including settings for indentation, line endings, and character encoding..eslintignoreand.prettierignore: Ignoreddistandcoveragedirectories for linting and formatting. [1] [2].nvmrc: Specified Node.js versionv20.13.0for consistent development environments..prettierrc: Configured Prettier with rules for line endings, tab width, and trailing commas..vscode/settings.json: Added workspace settings for consistent formatting and TypeScript preferences..yarnrc.yml: Configured Yarn to use thenode-moduleslinker for dependency management.Documentation Enhancements
CONTRIBUTING.md: Added contribution guidelines, including setup instructions, code style requirements, and pull request best practices.LICENSE: Added an MIT license to define the terms of use for the project.README.md: Overhauled the documentation with installation instructions, configuration details, and usage examples for the ImageKit Strapi plugin.Admin Interface Components
admin/src/components/Code.tsx: Introduced a styledcodecomponent for displaying inline code snippets.admin/src/components/Field.tsx: Added a reusableFieldcomponent with error handling and translated labels.admin/src/components/HeaderLink.tsxandHintLink.tsx: Created styled components for header and hint links with consistent spacing and font sizes. [1] [2]admin/src/components/ImageKitLogo.tsx: Added an SVG component for the ImageKit logo, supporting custom properties.admin/src/components/Initializer.tsx: Implemented an initializer component to register the plugin with the admin panel.Error Handling and Utilities
admin/src/errors/HttpError.ts: Defined a customHttpErrorclass for handling HTTP errors with optional response details.admin/src/hooks/index.ts: Exported hooks, such asuseHttp, for consistent API interactions.