diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js index 0a56162c813a..ac2d450fcfcb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js @@ -7,7 +7,6 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); import { agHelper, apiPage, - entityExplorer, propPane, } from "../../../../../support/Objects/ObjectsCore"; @@ -116,6 +115,38 @@ describe( // verify customColumn is visible in the table cy.get(".draggable-header:contains('CustomColumn')").should("be.visible"); cy.closePropertyPane(); + cy.deleteColumn("customColumn1"); + }); + + it("5. Verify computed value with try-catch blocks handles missing nested properties", function () { + cy.openPropertyPane("tablewidgetv2"); + + // Set table data with nested object and missing property + propPane.UpdatePropertyFieldValue( + "Table data", + `{{[{"name": "Rahul", age: {value: 31}}, {"name": "Jacq", age: {}}, {"name": "John"}]}}`, + ); + + cy.editColumn("age"); + propPane.UpdatePropertyFieldValue( + "Computed value", + "{{currentRow.age.value}}", + ); + + cy.readTableV2data(0, 1).then((val) => { + expect(val).to.equal("31"); + }); + + cy.readTableV2data(1, 1).then((val) => { + expect(val).to.equal(""); + }); + + cy.readTableV2data(2, 1).then((val) => { + expect(val).to.equal(""); + }); + + // Clean up + cy.backFromPropertyPanel(); }); }, ); diff --git a/app/client/packages/design-system/widgets/src/components/Button/src/Button.tsx b/app/client/packages/design-system/widgets/src/components/Button/src/Button.tsx index 8aeab5dee079..9682f927a1a3 100644 --- a/app/client/packages/design-system/widgets/src/components/Button/src/Button.tsx +++ b/app/client/packages/design-system/widgets/src/components/Button/src/Button.tsx @@ -57,7 +57,7 @@ const _Button = (props: ButtonProps, ref: ForwardedRef) => { {isLoading && ( - + {loadingText} )} diff --git a/app/client/packages/design-system/widgets/src/components/Button/src/types.ts b/app/client/packages/design-system/widgets/src/components/Button/src/types.ts index fd181f5e16ff..82ebeb68d55c 100644 --- a/app/client/packages/design-system/widgets/src/components/Button/src/types.ts +++ b/app/client/packages/design-system/widgets/src/components/Button/src/types.ts @@ -40,7 +40,7 @@ export interface ButtonProps extends HeadlessButtonProps { /** Size of the button * @default medium */ - size?: Omit; + size?: Exclude; /** Indicates if the button should be disabled when the form is invalid */ disableOnInvalidForm?: boolean; /** Indicates if the button should reset the form when clicked */ diff --git a/app/client/packages/design-system/widgets/src/components/Button/stories/Button.stories.tsx b/app/client/packages/design-system/widgets/src/components/Button/stories/Button.stories.tsx index 8525882f1990..b456ff828805 100644 --- a/app/client/packages/design-system/widgets/src/components/Button/stories/Button.stories.tsx +++ b/app/client/packages/design-system/widgets/src/components/Button/stories/Button.stories.tsx @@ -1,6 +1,13 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; -import { Button, Flex, BUTTON_VARIANTS, COLORS, SIZES } from "@appsmith/wds"; +import { + Button, + Flex, + BUTTON_VARIANTS, + COLORS, + SIZES, + type ButtonProps, +} from "@appsmith/wds"; import { objectKeys } from "@appsmith/utils"; /** @@ -59,15 +66,21 @@ export const Sizes: Story = { render: () => ( - {Object.keys(SIZES) - .filter((size) => !["large"].includes(size)) + {objectKeys(SIZES) + .filter( + (size): size is NonNullable => + !["large"].includes(size), + ) .map((size) => (