Skip to content
Merged
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
8 changes: 3 additions & 5 deletions packages/main/src/components/FilterBar/FilterBar.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,8 @@ describe('FilterBar.cy.tsx', () => {
</FilterBar>,
);

cy.findByText('Go').should('be.visible');
cy.get('[ui5-toolbar-item]').should('exist');
cy.get('[ui5-toolbar-item] [ui5-button]').should('have.attr', 'accessible-description', 'Show Results');
cy.findToolbarButtonByText('Go').should('be.visible');
cy.findToolbarButtonByText('Go').should('have.attr', 'accessible-description', 'Show Results');
cy.findToolbarButtonByText('Filters').should('be.visible');
cy.findToolbarButtonByText('Adapt Filters').should('not.exist');
cy.findToolbarButtonByText('Hide Filter Bar').should('be.visible');
Expand All @@ -447,7 +446,6 @@ describe('FilterBar.cy.tsx', () => {
);

cy.findByText('Go').should('be.visible');
cy.get('[ui5-toolbar-item]').should('not.exist');
cy.get('[ui5-button]').should('have.attr', 'accessible-description', 'Show Results');
cy.findByText('Filters').should('not.exist');
cy.findByText('Adapt Filters').should('be.visible');
Expand Down Expand Up @@ -508,7 +506,7 @@ describe('FilterBar.cy.tsx', () => {
</FilterGroupItem>
</FilterBar>,
);
cy.findByText('Go').click({ force: true });
cy.get('[text="Go"]').click({ force: true });
cy.get('@go').should('have.been.calledOnce');

cy.get('[text="Clear"]').click({ force: true });
Expand Down
17 changes: 10 additions & 7 deletions packages/main/src/components/FilterBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { Icon } from '../../webComponents/Icon/index.js';
import { Toolbar } from '../../webComponents/Toolbar/index.js';
import type { ToolbarButtonDomRef } from '../../webComponents/ToolbarButton/index.js';
import { ToolbarButton } from '../../webComponents/ToolbarButton/index.js';
import { ToolbarItem } from '../../webComponents/ToolbarItem/index.js';
import { FilterGroupItem } from '../FilterGroupItem/index.js';
import type { FilterGroupItemInternalProps } from '../FilterGroupItem/types.js';
import { FlexBox } from '../FlexBox/index.js';
Expand Down Expand Up @@ -235,14 +234,18 @@ const FilterBar = forwardRef<HTMLDivElement, FilterBarPropTypes>((props, ref) =>
const filtersButtonText = `${filtersText}${
activeFiltersCount && parseInt(activeFiltersCount as string, 10) ? ` (${activeFiltersCount})` : ''
}`;
const GoButton = showGoOnFB && (
<Button onClick={handleGoOnFb} design={ButtonDesign.Emphasized} accessibleDescription={goDescription}>
{goText}
</Button>
);
const FBButtons = (
<>
{showGoOnFB && (hideToolbar ? GoButton : <ToolbarItem>{GoButton}</ToolbarItem>)}
{showGoOnFB && (
<FBButtonComponent
text={hideToolbar ? undefined : goText}
onClick={handleGoOnFb}
design={ButtonDesign.Emphasized}
accessibleDescription={goDescription}
>
{hideToolbar ? goText : undefined}
</FBButtonComponent>
)}
{!hideToggleFiltersButton && !hideToolbar && !isPhone && (
<ToolbarButton
text={showFilters ? hideFilterBarText : showFilterBarText}
Expand Down
3 changes: 1 addition & 2 deletions packages/main/src/components/FilterBar/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { CSSProperties, MouseEvent, ReactElement, ReactNode } from 'react';
import type { CommonProps } from '../../types/index.js';
import type { ButtonPropTypes } from '../../webComponents/Button/index.js';
import type { DialogPropTypes } from '../../webComponents/Dialog/index.js';
import type { InputPropTypes } from '../../webComponents/Input/index.js';
import type { ToolbarButtonPropTypes } from '../../webComponents/ToolbarButton/index.js';
Expand Down Expand Up @@ -211,7 +210,7 @@ export interface FilterBarPropTypes extends CommonProps {
/**
* The event is fired when the "Go" button is clicked.
*/
onGo?: ButtonPropTypes['onClick'];
onGo?: ToolbarButtonPropTypes['onClick'];
/**
* The event is fired when the "Reset" button in the filter dialog is pressed, or the "Restore" button in the FilterBar.
*/
Expand Down
Loading