From d32798f6b0eaa624e6423bd7237af116f1e96273 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Mon, 16 Jun 2025 16:50:32 +0200 Subject: [PATCH] feat(AnalyticalTable): introduce `alwaysShowBusyIndicator` prop --- .../src/components/AnalyticalTable/AnalyticalTable.cy.tsx | 4 ++++ packages/main/src/components/AnalyticalTable/index.tsx | 7 ++++--- .../main/src/components/AnalyticalTable/types/index.ts | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx b/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx index 761987a8c25..148c859876a 100644 --- a/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx +++ b/packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx @@ -1543,7 +1543,11 @@ describe('AnalyticalTable', () => { cy.mount(); cy.get('[data-component-name="AnalyticalTableLoadingPlaceholder"]').should('be.visible'); cy.get('.ui5-busy-indicator-busy-area').should('not.exist'); + cy.mount(); + cy.get('[data-component-name="AnalyticalTableLoadingPlaceholder"]').should('not.exist'); + cy.get('.ui5-busy-indicator-busy-area').should('be.visible'); cy.mount(); + cy.get('[data-component-name="AnalyticalTableLoadingPlaceholder"]').should('not.exist'); cy.get('.ui5-busy-indicator-busy-area', { timeout: 2000 }).should('be.visible'); cy.mount(); cy.get('.ui5-busy-indicator-busy-area', { timeout: 2000 }).should('not.exist'); diff --git a/packages/main/src/components/AnalyticalTable/index.tsx b/packages/main/src/components/AnalyticalTable/index.tsx index 158a5d6b24e..538df095131 100644 --- a/packages/main/src/components/AnalyticalTable/index.tsx +++ b/packages/main/src/components/AnalyticalTable/index.tsx @@ -107,8 +107,9 @@ const measureElement = (el: HTMLElement) => { */ const AnalyticalTable = forwardRef((props, ref) => { const { - alternateRowColor, adjustTableHeightOnPopIn, + alternateRowColor, + alwaysShowBusyIndicator, className, columnOrder, columns, @@ -750,7 +751,7 @@ const AnalyticalTable = forwardRef - {loading && !!rows.length && ( + {loading && (!!rows.length || alwaysShowBusyIndicator) && ( - {loading ? ( + {loading && !alwaysShowBusyIndicator ? ( { /** * Indicates whether a loading indicator should be shown. * - * __Note:__ If the data array is not empty and loading is set to `true` a `BusyIndicator` will be displayed on top of the table, otherwise a skeleton placeholder will be shown. + * __Note:__ If the data array is not empty and loading is set to `true` a `BusyIndicator` will be displayed on top of the table, otherwise a skeleton placeholder will be shown. You can control this behavior via the `alwaysShowBusyIndicator` prop. */ loading?: boolean; /** @@ -709,6 +709,10 @@ export interface AnalyticalTablePropTypes extends Omit { * Setting this prop to `true` will show an overlay on top of the AnalyticalTable content preventing users from interacting with it. */ showOverlay?: boolean; + /** + * If `true`, always shows the `BusyIndicator` component when loading instead of the skeleton loader. + */ + alwaysShowBusyIndicator?: boolean; /** * Defines the text shown if the data array is empty or a filtered table doesn't return results. *