From 4bc3f43825b2463e03c6cf91d6834a4d3fb6075b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Tue, 5 May 2026 14:49:22 -0300 Subject: [PATCH 1/3] fix: add allowed extensions props on formik input component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- .../modules/page-template-document-download-module.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js b/src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js index 3cd675e3a..a34cf7a4b 100644 --- a/src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js +++ b/src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js @@ -5,7 +5,10 @@ import { useField } from "formik"; import { Divider, Grid2, InputLabel } from "@mui/material"; import { MuiFormikUpload } from "openstack-uicore-foundation/lib/components"; import MuiFormikTextField from "../../../../../components/mui/formik-inputs/mui-formik-textfield"; -import { PAGE_MODULES_DOWNLOAD } from "../../../../../utils/constants"; +import { + ALLOWED_INVENTORY_IMAGE_FORMATS, + PAGE_MODULES_DOWNLOAD +} from "../../../../../utils/constants"; import MuiFormikRadioGroup from "../../../../../components/mui/formik-inputs/mui-formik-radio-group"; const DocumentDownloadModule = ({ baseName, index }) => { @@ -79,6 +82,7 @@ const DocumentDownloadModule = ({ baseName, index }) => { id={`document-module-upload-${index}`} name={buildFieldName("file")} maxFiles={1} + allowedExtensions={["pdf", ...ALLOWED_INVENTORY_IMAGE_FORMATS]} /> )} From d63a157ad44e2810b48cea97e6668206d70a4598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Wed, 6 May 2026 10:06:17 -0300 Subject: [PATCH 2/3] fix: replace mui formik upload with uicore component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- .../modules/page-template-document-download-module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js b/src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js index a34cf7a4b..916d5d75f 100644 --- a/src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js +++ b/src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js @@ -3,7 +3,7 @@ import PropTypes from "prop-types"; import T from "i18n-react/dist/i18n-react"; import { useField } from "formik"; import { Divider, Grid2, InputLabel } from "@mui/material"; -import { MuiFormikUpload } from "openstack-uicore-foundation/lib/components"; +import MuiFormikUpload from "openstack-uicore-foundation/lib/components/mui/formik-inputs/upload"; import MuiFormikTextField from "../../../../../components/mui/formik-inputs/mui-formik-textfield"; import { ALLOWED_INVENTORY_IMAGE_FORMATS, From f0ce2ad287f64cf4b1143c0b66741ab0723be741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Thu, 7 May 2026 18:19:09 -0300 Subject: [PATCH 3/3] fix: adjust mock import on test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- .../page-template-popup/page-template-module-form.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/sponsors-global/page-templates/page-template-popup/page-template-module-form.test.js b/src/pages/sponsors-global/page-templates/page-template-popup/page-template-module-form.test.js index 6d4df885b..ab792f581 100644 --- a/src/pages/sponsors-global/page-templates/page-template-popup/page-template-module-form.test.js +++ b/src/pages/sponsors-global/page-templates/page-template-popup/page-template-module-form.test.js @@ -29,6 +29,14 @@ jest.mock( } ); +jest.mock( + "openstack-uicore-foundation/lib/components/mui/formik-inputs/upload", + () => + function MockMuiFormikUpload({ name }) { + return
Upload
; + } +); + jest.mock( "../../../../components/mui/formik-inputs/mui-formik-textfield", () =>