From 22a53c4791cbbe7e9d5b0269ace1b56dd0dc9708 Mon Sep 17 00:00:00 2001 From: saiprabhu-dandanayak Date: Thu, 5 Sep 2024 13:42:49 +0530 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9C=A8=20feat:=20allow=20multiple=20line?= =?UTF-8?q?s=20in=20alert=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...utton_showAlert_multiline_message_spec..ts | 24 +++++++++++++++++++ .../design-system/ads/src/Toast/Toast.tsx | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create 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 new file mode 100644 index 000000000000..c8055d41c60b --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_showAlert_multiline_message_spec..ts @@ -0,0 +1,24 @@ +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.wait(500); + cy.get('.Toastify', { timeout: 1000 }) + .should('have.text', 'sai\n\nprabhu'); + }); + }, + ); 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 6f96522219d6..39fe869d8076 100644 --- a/app/client/packages/design-system/ads/src/Toast/Toast.tsx +++ b/app/client/packages/design-system/ads/src/Toast/Toast.tsx @@ -39,7 +39,7 @@ const toast = { const toastId = JSON.stringify({ ...options, content }); return toastifyToast( - {content} +
{content}
{actionText && ( Date: Thu, 5 Sep 2024 14:23:54 +0530 Subject: [PATCH 2/6] formatted files --- ...utton_showAlert_multiline_message_spec..ts | 48 ++++++++++--------- .../design-system/ads/src/Toast/Toast.tsx | 2 +- 2 files changed, 26 insertions(+), 24 deletions(-) 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 index c8055d41c60b..c2a31f76d8e5 100644 --- 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 @@ -1,24 +1,26 @@ 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.wait(500); - cy.get('.Toastify', { timeout: 1000 }) - .should('have.text', 'sai\n\nprabhu'); - }); - }, - ); + 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.wait(500); + cy.get(".Toastify", { timeout: 1000 }).should( + "have.text", + "sai\n\nprabhu", + ); + }); + }, +); 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 39fe869d8076..3cfdf53926c0 100644 --- a/app/client/packages/design-system/ads/src/Toast/Toast.tsx +++ b/app/client/packages/design-system/ads/src/Toast/Toast.tsx @@ -39,7 +39,7 @@ const toast = { const toastId = JSON.stringify({ ...options, content }); return toastifyToast( -
{content}
+
{content}
{actionText && ( Date: Tue, 24 Sep 2024 17:31:52 +0530 Subject: [PATCH 3/6] fix:replaced ..ts with .ts for cypress file --- ...essage_spec..ts => Button_showAlert_multiline_message_spec.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/{Button_showAlert_multiline_message_spec..ts => Button_showAlert_multiline_message_spec.ts} (100%) 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 similarity index 100% rename from app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_showAlert_multiline_message_spec..ts rename to app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_showAlert_multiline_message_spec.ts From 79e48f05d93de6a5985d87bc3ccdb8ec11a6cfa2 Mon Sep 17 00:00:00 2001 From: saiprabhu-dandanayak Date: Tue, 24 Sep 2024 17:57:53 +0530 Subject: [PATCH 4/6] fix:removed cy.wait() --- .../Widgets/Button/Button_showAlert_multiline_message_spec.ts | 1 - 1 file changed, 1 deletion(-) 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 index c2a31f76d8e5..25f872bd31ad 100644 --- 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 @@ -16,7 +16,6 @@ describe( it("Verify showAlert message renders correctly with newline characters", () => { propPane.EnterJSContext("onClick", "showAlert(`sai\n\nprabhu`)"); agHelper.ClickButton("Submit"); - cy.wait(500); cy.get(".Toastify", { timeout: 1000 }).should( "have.text", "sai\n\nprabhu", From ea337a4f5d9e9ee762f0f12474c58272eba989dd Mon Sep 17 00:00:00 2001 From: saiprabhu-dandanayak Date: Wed, 25 Sep 2024 17:36:40 +0530 Subject: [PATCH 5/6] fix:removed in-line styling --- .../packages/design-system/ads/src/Toast/Toast.styles.tsx | 4 ++++ app/client/packages/design-system/ads/src/Toast/Toast.tsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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 f27906c4b89e..04127a478cac 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,3 +63,7 @@ export const ToastBody = styled(Text)` export const StyledButton = styled(Button)` align-self: center; `; + +export const StyledPre = styled.pre` + font: inherit; +`; \ No newline at end of file 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 8bb58cbbfaad..c6b8b0a936e8 100644 --- a/app/client/packages/design-system/ads/src/Toast/Toast.tsx +++ b/app/client/packages/design-system/ads/src/Toast/Toast.tsx @@ -4,7 +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, StyledToast, ToastBody } from "./Toast.styles"; +import { StyledButton, StyledPre, StyledToast, ToastBody } from "./Toast.styles"; import { getIconByKind } from "../Icon/getIconByKind"; /** @@ -40,7 +40,7 @@ const toast = { return toastifyToast( -
{content}
+ {content} {actionText && ( Date: Mon, 30 Sep 2024 13:43:31 +0530 Subject: [PATCH 6/6] fix:lint & prettier issues --- .../packages/design-system/ads/src/Toast/Toast.styles.tsx | 2 +- app/client/packages/design-system/ads/src/Toast/Toast.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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 04127a478cac..9ae7c80464d0 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 @@ -66,4 +66,4 @@ export const StyledButton = styled(Button)` export const StyledPre = styled.pre` font: inherit; -`; \ No newline at end of file +`; 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 c6b8b0a936e8..b83da02d70af 100644 --- a/app/client/packages/design-system/ads/src/Toast/Toast.tsx +++ b/app/client/packages/design-system/ads/src/Toast/Toast.tsx @@ -4,7 +4,12 @@ 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, + StyledPre, + StyledToast, + ToastBody, +} from "./Toast.styles"; import { getIconByKind } from "../Icon/getIconByKind"; /**