Skip to content

fix(AnalyticalTable): update loading indicator and overlay styles #7447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1543,8 +1543,18 @@ describe('AnalyticalTable', () => {
cy.mount(<AnalyticalTable data={[]} columns={columns} loading loadingDelay={0} />);
cy.get('[data-component-name="AnalyticalTableLoadingPlaceholder"]').should('be.visible');
cy.get('.ui5-busy-indicator-busy-area').should('not.exist');
cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"] > :not([class*="busyIndicator"])').should(
'not.have.css',
'opacity',
'0.4',
);
cy.mount(<AnalyticalTable data={data} columns={columns} loading />);
cy.get('.ui5-busy-indicator-busy-area', { timeout: 2000 }).should('be.visible');
cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"] > :not([class*="busyIndicator"])').should(
'have.css',
'opacity',
'0.4',
);
cy.mount(<AnalyticalTable data={data} columns={columns} loading loadingDelay={50000} />);
cy.get('.ui5-busy-indicator-busy-area', { timeout: 2000 }).should('not.exist');
cy.mount(<AnalyticalTable data={[]} columns={columns} />);
Expand Down Expand Up @@ -1895,8 +1905,22 @@ describe('AnalyticalTable', () => {
});

it('overlay', (done) => {
cy.mount(<AnalyticalTable data={data} columns={columns} />);
cy.findByRole('region').should('not.exist');
cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"] > :not([class^="overlay"])').should(
'not.have.css',
'opacity',
'0.4',
);
cy.findByText('A').click();

cy.mount(<AnalyticalTable data={data} columns={columns} showOverlay />);
cy.findByRole('region').should('be.visible').should('have.css', 'opacity', '0.8');
cy.findByRole('region').should('be.visible');
cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"] > :not([class^="overlay"])').should(
'have.css',
'opacity',
'0.4',
);
cy.findByText('A').shouldNotBeClickable(done);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
}
}

.tableContainerWithScrollBar {
position: relative;

&:has(> .overlay) {
> :not(.overlay) {
opacity: var(--sapContent_DisabledOpacity);
}
}

&:has(> .busyIndicator) {
> :not(.busyIndicator) {
opacity: var(--sapContent_DisabledOpacity);
}
}
}

.table {
position: relative;
width: 100%;
Expand All @@ -37,10 +53,6 @@
}
}

.tableContainerWithScrollBar {
position: relative;
}

.busyIndicator {
position: absolute;
z-index: 1;
Expand All @@ -52,8 +64,6 @@
position: absolute;
z-index: 1;
inset: 0;
background: var(--sapGroup_ContentBackground);
opacity: 0.8;

&:focus {
outline-offset: calc(-1 * var(--sapContent_FocusWidth));
Expand Down
6 changes: 1 addition & 5 deletions packages/main/src/components/AnalyticalTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,8 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
active={true}
delay={loadingDelay}
data-component-name="AnalyticalTableBusyIndicator"
>
{/*todo: This is necessary; otherwise, the overlay bg color will not be applied. https://github.com/SAP/ui5-webcomponents/issues/9723 */}
<span />
</BusyIndicator>
/>
)}
{/*todo: use global CSS once --sapBlockLayer_Opacity is available*/}
{showOverlay && (
<>
<span id={invalidTableTextId} className={classNames.hiddenA11yText} aria-hidden="true">
Expand Down
Loading