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:
parent
f454d83238
commit
4f501419cd
|
|
@ -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",
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
@ -63,7 +63,3 @@ export const ToastBody = styled(Text)`
|
||||||
export const StyledButton = styled(Button)`
|
export const StyledButton = styled(Button)`
|
||||||
align-self: center;
|
align-self: center;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const StyledPre = styled.pre`
|
|
||||||
font: inherit;
|
|
||||||
`;
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,7 @@ import { Slide, toast as toastifyToast } from "react-toastify";
|
||||||
import "react-toastify/dist/ReactToastify.min.css";
|
import "react-toastify/dist/ReactToastify.min.css";
|
||||||
|
|
||||||
import type { ToastProps } from "./Toast.types";
|
import type { ToastProps } from "./Toast.types";
|
||||||
import {
|
import { StyledButton, StyledToast, ToastBody } from "./Toast.styles";
|
||||||
StyledButton,
|
|
||||||
StyledPre,
|
|
||||||
StyledToast,
|
|
||||||
ToastBody,
|
|
||||||
} from "./Toast.styles";
|
|
||||||
import { getIconByKind } from "../Icon/getIconByKind";
|
import { getIconByKind } from "../Icon/getIconByKind";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45,7 +40,7 @@ const toast = {
|
||||||
|
|
||||||
return toastifyToast(
|
return toastifyToast(
|
||||||
<ToastBody kind="body-m">
|
<ToastBody kind="body-m">
|
||||||
<StyledPre>{content}</StyledPre>
|
{content}
|
||||||
{actionText && (
|
{actionText && (
|
||||||
<StyledButton
|
<StyledButton
|
||||||
kind="tertiary"
|
kind="tertiary"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user