Skip to content

Conversation

@PatrickePatate
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 4, 2025 14:34
Copilot finished reviewing on behalf of PatrickePatate December 4, 2025 14:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for general file uploads (not just images) in editor fields by introducing a new File toolbar button and associated configuration methods.

  • Added OzuEditorToolbarButton::File enum case for file upload functionality
  • Implemented setAllowedExtensions() method to control which file types can be uploaded
  • Updated setMaxFileSize() validation to work with both Image and File upload buttons

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/OzuCms/Form/OzuEditorToolbarButton.php Added new File enum case for general file upload button
src/OzuCms/Form/OzuEditorField.php Added allowedExtensions property and setAllowedExtensions() method; updated validation logic for setMaxFileSize() to support both Image and File uploads
tests/Unit/OzuEditorFieldTest.php Added comprehensive test coverage for new file upload functionality including validation, normalization, and conditional inclusion of allowed extensions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


private int $maxFileSize = 5;

private array $allowedExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.webp'];
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default allowedExtensions value contains only image extensions (.jpg, .jpeg, .png, etc.), which may not be appropriate when the File toolbar button is enabled for general file uploads. Consider having different defaults based on whether Image or File button is used, or making this more flexible to handle non-image file types.

Copilot uses AI. Check for mistakes.
@PatrickePatate PatrickePatate merged commit 63de2d8 into main Dec 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants