[WEB-2420] fix: svg not supported in image uploads in the editor#5558
[WEB-2420] fix: svg not supported in image uploads in the editor#5558
Conversation
WalkthroughThe changes made in this pull request involve the modification of image upload functionalities within the editor. Specifically, the accepted file types for image uploads have been restricted by removing support for SVG files. This alteration affects both the command for inserting images and the validation logic for file types, ensuring that only JPEG, JPG, PNG, and WEBP formats are permissible for uploads. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Editor
participant Validator
User->>Editor: Upload Image
Editor->>Validator: Validate File Type
Validator-->>Editor: File Type Valid (JPEG/JPG/PNG/WEBP)
Editor-->>User: Image Inserted Successfully
User->>Editor: Upload SVG Image
Editor->>Validator: Validate File Type
Validator-->>Editor: File Type Invalid (SVG)
Editor-->>User: Alert Invalid File Type
Possibly related PRs
Suggested labels
Poem
Tip New featuresWalkthrough comment now includes:
Notes:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/editor/src/core/helpers/editor-commands.ts (1 hunks)
- packages/editor/src/core/plugins/image/utils/validate-file.ts (1 hunks)
Additional comments not posted (1)
packages/editor/src/core/helpers/editor-commands.ts (1)
149-149: Approved: Updated accepted file types.The update to the
acceptattribute of the input element correctly reflects the new policy of not supporting SVG files. This change is consistent with the PR objectives and aligns with the changes made in the file validation logic.
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/editor/src/core/plugins/image/utils/validate-file.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/editor/src/core/plugins/image/utils/validate-file.ts
Summary by CodeRabbit
New Features
Bug Fixes