Skip to content

fix: add allowedExtensions prop into formik upload component#236

Open
tomrndom wants to merge 1 commit intomainfrom
fix/formik-upload-extensions
Open

fix: add allowedExtensions prop into formik upload component#236
tomrndom wants to merge 1 commit intomainfrom
fix/formik-upload-extensions

Conversation

@tomrndom
Copy link
Copy Markdown
Contributor

@tomrndom tomrndom commented May 6, 2026

ref: https://app.clickup.com/t/86b9c38wj

image image

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

Release Notes

  • New Features
    • Added customizable image file extension support for uploads
    • Added configurable file upload limits to control the maximum number of files per upload session

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@tomrndom tomrndom requested a review from smarcet May 6, 2026 13:03
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a4602a46-1914-4c0b-b20c-25b19a5f6ff7

📥 Commits

Reviewing files that changed from the base of the PR and between 61be5aa and e774739.

📒 Files selected for processing (1)
  • src/components/mui/formik-inputs/mui-formik-upload.js

📝 Walkthrough

Walkthrough

The MuiFormikUpload component gains two new optional props: allowedExtensions to customize accepted file types and maxFiles to limit concurrent uploads. The mediaType construction now uses the custom allowedExtensions when provided, otherwise falls back to the default constant.

Changes

Upload Configuration Flexibility

Layer / File(s) Summary
Component Props & Validation
src/components/mui/formik-inputs/mui-formik-upload.js
Added maxFiles prop with default value MAX_INVENTORY_IMAGES_UPLOAD_QTY and allowedExtensions prop to component destructuring. Updated mediaType construction to use allowedExtensions with fallback to ALLOWED_INVENTORY_IMAGE_FORMATS. Extended PropTypes for both new props.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • OpenStackweb/openstack-uicore-foundation#227: Both PRs modify the same upload component; the related PR adds maxFiles-based error handling and component upgrades while this PR introduces the maxFiles and allowedExtensions props.

Suggested reviewers

  • smarcet
  • santipalenque

Poem

🐰 A rabbit hops through files with glee,
New props unlock flexibility!
Extensions bend, and files align,
Upload limits now feel divine.
Configuration blooms, precise and bright! 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding an allowedExtensions prop to the formik upload component. It is clear, specific, and directly related to the primary modification in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/formik-upload-extensions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant