From 557ee052f06e9b711c22fd8f4b4522e6e691400f Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Wed, 30 Apr 2025 10:14:35 +0530 Subject: [PATCH] fix: update visibility condition for infinite scroll in TableWidgetV2 (#40474) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Updated the 'hidden' property in the TableWidgetV2 configuration to account for both the INFINITE_SCROLL_ENABLED feature flag and the serverSidePaginationEnabled prop, ensuring proper visibility control based on these conditions. Fixes #40409 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Table" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: cba8275ab184bc9c3c8e0a54c54994e3409b9c98 > Cypress dashboard. > Tags: `@tag.Table` > Spec: >
Tue, 29 Apr 2025 16:01:26 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **Refactor** - Updated the visibility logic for the infinite scroll option in table pagination settings to better reflect feature availability and widget configuration. - **Tests** - Enhanced test coverage by enabling server-side pagination alongside infinite scroll in table widget scenarios. --- .../TableV2/InfiniteScrollVariableHeightRows_spec.ts | 1 + .../ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts | 1 + .../TableWidgetV2/widget/propertyConfig/contentConfig.ts | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/InfiniteScrollVariableHeightRows_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/InfiniteScrollVariableHeightRows_spec.ts index bd06c6c2dd..b5046d8fce 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/InfiniteScrollVariableHeightRows_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/InfiniteScrollVariableHeightRows_spec.ts @@ -43,6 +43,7 @@ describe( propPane.EnterJSContext("Table data", JSON.stringify(testData)); + propPane.TogglePropertyState("Server side pagination", "On"); propPane.TogglePropertyState("Infinite scroll", "On"); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts index 6579ba49b2..5d8c88ed98 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts @@ -48,6 +48,7 @@ describe( it("1. should enable infinite scroll and verify records are loaded automatically when scrolling", () => { // Enable infinite scroll in the property pane + propPane.TogglePropertyState("Server side pagination", "On"); propPane.TogglePropertyState("Infinite scroll", "On"); // Wait for network call to complete diff --git a/app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts b/app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts index bf12ab66c6..278554f7f1 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts +++ b/app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts @@ -200,8 +200,10 @@ export default [ updateCellEditabilityOnInfiniteScrollChange, updateSearchSortFilterOnInfiniteScrollChange, ]), - dependencies: ["primaryColumns"], - hidden: () => !Widget.getFeatureFlag(INFINITE_SCROLL_ENABLED), + dependencies: ["primaryColumns", "serverSidePaginationEnabled"], + hidden: (props: TableWidgetProps) => + !Widget.getFeatureFlag(INFINITE_SCROLL_ENABLED) || + !props.serverSidePaginationEnabled, }, { helpText: createMessage(TABLE_WIDGET_TOTAL_RECORD_TOOLTIP),