fix: Revert "feat: allow multiple lines in alert component" (#36643)

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"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11138591480>
> Commit: 598a1d3c6e94fc817c1bc75293b60936a422f77c
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11138591480&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 02 Oct 2024 07:27:39 UTC
<!-- end of auto-generated comment: Cypress test results  -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
albinAppsmith 2024-10-02 12:58:16 +05:30 committed by GitHub
parent f454d83238
commit 4f501419cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 36 deletions

View File

@ -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",
);
});
},
);

View File

@ -63,7 +63,3 @@ export const ToastBody = styled(Text)`
export const StyledButton = styled(Button)`
align-self: center;
`;
export const StyledPre = styled.pre`
font: inherit;
`;

View File

@ -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(
<ToastBody kind="body-m">
<StyledPre>{content}</StyledPre>
{content}
{actionText && (
<StyledButton
kind="tertiary"