From 4f501419cd14ea2be9b15ea9de0a159883a06015 Mon Sep 17 00:00:00 2001 From: albinAppsmith <87797149+albinAppsmith@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:58:16 +0530 Subject: [PATCH] fix: Revert "feat: allow multiple lines in alert component" (#36643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts appsmithorg/appsmith#36629 Reverts appsmithorg/appsmith#36126 Reverting this PR since it is causing multiple issues in toast and we are reverting the original PR caused this issue. ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 598a1d3c6e94fc817c1bc75293b60936a422f77c > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Wed, 02 Oct 2024 07:27:39 UTC ## Summary by CodeRabbit - **New Features** - Introduced a new styled button component for enhanced toast notifications. - Updated toast styling with customizable properties for better visual presentation. - **Bug Fixes** - Simplified toast body structure by removing unnecessary components, ensuring content displays correctly. - **Chores** - Removed outdated end-to-end test file for button widget alert functionality. --- ...Button_showAlert_multiline_message_spec.ts | 25 ------------------- .../ads/src/Toast/Toast.styles.tsx | 4 --- .../design-system/ads/src/Toast/Toast.tsx | 9 ++----- 3 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_showAlert_multiline_message_spec.ts diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_showAlert_multiline_message_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_showAlert_multiline_message_spec.ts deleted file mode 100644 index 25f872bd31..0000000000 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_showAlert_multiline_message_spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - draggableWidgets, - entityExplorer, - propPane, - agHelper, -} from "../../../../../support/Objects/ObjectsCore"; - -describe( - "Tests for showAlert message with newline characters in the alert message", - { tags: ["@tag.Widget", "@tag.Button"] }, - () => { - before("Login to the app and navigate to the workspace", function () { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); - }); - - it("Verify showAlert message renders correctly with newline characters", () => { - propPane.EnterJSContext("onClick", "showAlert(`sai\n\nprabhu`)"); - agHelper.ClickButton("Submit"); - cy.get(".Toastify", { timeout: 1000 }).should( - "have.text", - "sai\n\nprabhu", - ); - }); - }, -); diff --git a/app/client/packages/design-system/ads/src/Toast/Toast.styles.tsx b/app/client/packages/design-system/ads/src/Toast/Toast.styles.tsx index 9ae7c80464..f27906c4b8 100644 --- a/app/client/packages/design-system/ads/src/Toast/Toast.styles.tsx +++ b/app/client/packages/design-system/ads/src/Toast/Toast.styles.tsx @@ -63,7 +63,3 @@ export const ToastBody = styled(Text)` export const StyledButton = styled(Button)` align-self: center; `; - -export const StyledPre = styled.pre` - font: inherit; -`; diff --git a/app/client/packages/design-system/ads/src/Toast/Toast.tsx b/app/client/packages/design-system/ads/src/Toast/Toast.tsx index fd376895d4..26326aa9a4 100644 --- a/app/client/packages/design-system/ads/src/Toast/Toast.tsx +++ b/app/client/packages/design-system/ads/src/Toast/Toast.tsx @@ -4,12 +4,7 @@ import { Slide, toast as toastifyToast } from "react-toastify"; import "react-toastify/dist/ReactToastify.min.css"; import type { ToastProps } from "./Toast.types"; -import { - StyledButton, - StyledPre, - StyledToast, - ToastBody, -} from "./Toast.styles"; +import { StyledButton, StyledToast, ToastBody } from "./Toast.styles"; import { getIconByKind } from "../Icon/getIconByKind"; /** @@ -45,7 +40,7 @@ const toast = { return toastifyToast( - {content} + {content} {actionText && (