From b2f5a46a1835cf116b778ba70811c54b4a952127 Mon Sep 17 00:00:00 2001 From: Santiago Palenque Date: Wed, 27 May 2026 09:57:33 -0300 Subject: [PATCH] chore: remove old custom alert and update exports --- src/components/index.js | 2 +- .../mui/__tests__/custom-alert.test.js | 44 ------------------- src/components/mui/custom-alert.js | 31 ------------- webpack.common.js | 2 +- 4 files changed, 2 insertions(+), 77 deletions(-) delete mode 100644 src/components/mui/__tests__/custom-alert.test.js delete mode 100644 src/components/mui/custom-alert.js diff --git a/src/components/index.js b/src/components/index.js index 3116bc83..8829fa93 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -60,7 +60,7 @@ export {default as MuiChipNotify} from './mui/chip-notify' export {default as MuiChipSelectInput} from './mui/chip-select-input' export {default as MuiConfirmDialog} from './mui/confirm-dialog' export {GlobalConfirmDialog} from './mui/showConfirmDialog' -export {default as MuiCustomAlert} from './mui/custom-alert' +export {default as MuiCustomAlert} from './mui/CustomAlert' export {default as MuiDropdownCheckbox} from './mui/dropdown-checkbox' export {default as MuiMenuButton} from './mui/menu-button' export {default as MuiSearchInput} from './mui/search-input' diff --git a/src/components/mui/__tests__/custom-alert.test.js b/src/components/mui/__tests__/custom-alert.test.js deleted file mode 100644 index 33be0106..00000000 --- a/src/components/mui/__tests__/custom-alert.test.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright 2026 OpenStack Foundation - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * */ - -import React from "react"; -import { render, screen } from "@testing-library/react"; -import "@testing-library/jest-dom"; -import CustomAlert from "../custom-alert"; - -describe("CustomAlert", () => { - test("renders the message", () => { - render(); - expect(screen.getByText("Hello world")).toBeInTheDocument(); - }); - - test("renders without crashing when no props provided", () => { - const { container } = render(); - expect(container.firstChild).toBeInTheDocument(); - }); - - test("renders with error severity", () => { - render(); - expect(screen.getByText("Error message")).toBeInTheDocument(); - }); - - test("renders with success severity", () => { - render(); - expect(screen.getByText("Success!")).toBeInTheDocument(); - }); - - test("renders with warning severity", () => { - render(); - expect(screen.getByText("Warning!")).toBeInTheDocument(); - }); -}); diff --git a/src/components/mui/custom-alert.js b/src/components/mui/custom-alert.js deleted file mode 100644 index 56a841f9..00000000 --- a/src/components/mui/custom-alert.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2026 OpenStack Foundation - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * */ - -import React from "react"; -import { Alert } from "@mui/material"; - -const CustomAlert = ({ severity = "info", message = "", hideIcon = false }) => ( - - {message} - -); - -export default CustomAlert; diff --git a/webpack.common.js b/webpack.common.js index e555fe39..c908c970 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -84,7 +84,7 @@ module.exports = { 'components/mui/chip-notify': './src/components/mui/chip-notify.js', 'components/mui/chip-select-input': './src/components/mui/chip-select-input.js', 'components/mui/confirm-dialog': './src/components/mui/confirm-dialog.js', - 'components/mui/custom-alert': './src/components/mui/custom-alert.js', + 'components/mui/custom-alert': './src/components/mui/CustomAlert/index.js', 'components/mui/dnd-list': './src/components/mui/dnd-list.js', 'components/mui/dropdown-checkbox': './src/components/mui/dropdown-checkbox.js', 'components/mui/menu-button': './src/components/mui/menu-button.js',