Skip to content

fix: add allowed extensions props on formik input component#913

Merged
smarcet merged 3 commits into
masterfrom
fix/page-module-download-extensions
May 19, 2026
Merged

fix: add allowed extensions props on formik input component#913
smarcet merged 3 commits into
masterfrom
fix/page-module-download-extensions

Conversation

@tomrndom
Copy link
Copy Markdown

@tomrndom tomrndom commented May 5, 2026

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

image image

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

Summary by CodeRabbit

  • New Features

    • File upload now supports configurable allowed file extensions.
    • Document upload accepts PDFs in addition to supported image formats.
  • Tests

    • Upload-related tests updated to reflect the refactored upload component import.
  • Chores

    • Internal dependency for the upload component adjusted (maintenance update).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an optional allowedExtensions prop to MuiFormikUpload (falls back to ALLOWED_INVENTORY_IMAGE_FORMATS), passes ["pdf", ...ALLOWED_INVENTORY_IMAGE_FORMATS] from a document module, updates a test mock path to the external package, and updates the openstack-uicore-foundation dependency version.

Changes

MuiFormikUpload allowedExtensions

Layer / File(s) Summary
PropTypes / Public API
src/components/mui/formik-inputs/mui-formik-upload.js
MuiFormikUpload.propTypes declares allowedExtensions as an array of strings and maxFiles as a number.
Component Implementation
src/components/mui/formik-inputs/mui-formik-upload.js
MuiFormikUpload destructures allowedExtensions prop and applies it to mediaType.type.allowed_extensions, falling back to ALLOWED_INVENTORY_IMAGE_FORMATS.
Integration / Usage
src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js
DocumentDownloadModule imports MuiFormikUpload and ALLOWED_INVENTORY_IMAGE_FORMATS, then passes allowedExtensions = ["pdf", ...ALLOWED_INVENTORY_IMAGE_FORMATS].
Tests / Mocks
src/pages/sponsors-global/page-templates/page-template-popup/page-template-module-form.test.js
Jest mock target path for the upload component is updated to openstack-uicore-foundation/lib/components/mui/formik-inputs/upload while keeping the same mock implementation.
Dependency manifest
package.json
openstack-uicore-foundation dependency version updated in dependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • smarcet

Poem

🐰 I hopped through props with ears held high,

Allowed extensions now pass on by.
PDF joins images in a tidy row,
Uploads accept what callers show.
A small carrot cheer for files that go!

🚥 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 PR title clearly and specifically describes the main change: adding an allowedExtensions prop to the formik upload component.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/page-module-download-extensions

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

@tomrndom tomrndom requested review from smarcet and removed request for smarcet May 6, 2026 12:57
@tomrndom
Copy link
Copy Markdown
Author

tomrndom commented May 7, 2026

@smarcet waiting changes from OpenStackweb/openstack-uicore-foundation#236 to update uicore version

@tomrndom tomrndom force-pushed the fix/page-module-download-extensions branch from b2683d5 to 595e3c6 Compare May 8, 2026 15:29
tomrndom added 3 commits May 19, 2026 10:23
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@tomrndom tomrndom force-pushed the fix/page-module-download-extensions branch from 654ddf1 to f0ce2ad Compare May 19, 2026 13:25
Copy link
Copy Markdown

@smarcet smarcet left a comment

Choose a reason for hiding this comment

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

LGTM

@smarcet smarcet merged commit 3f73c89 into master May 19, 2026
9 checks passed
smarcet pushed a commit that referenced this pull request May 19, 2026
* fix: add allowed extensions props on formik input component

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

* fix: replace mui formik upload with uicore component

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

* fix: adjust mock import on test

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

---------

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
smarcet pushed a commit that referenced this pull request May 19, 2026
* fix: add allowed extensions props on formik input component

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

* fix: replace mui formik upload with uicore component

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

* fix: adjust mock import on test

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

---------

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
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