Skip to content

Commit

Permalink
UISAUTCOMP-124: SearchResultsList - pass sortDirection and showSortIn…
Browse files Browse the repository at this point in the history
…dicator props.
  • Loading branch information
Dmytro-Melnyshyn committed Aug 13, 2024
1 parent f8c83a6 commit 77b0bb1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [UISAUTCOMP-117](https://issues.folio.org/browse/UISAUTCOMP-117) Provide deprecation notice to `useUserTenantPermissions.js`.
- [UISAUTCOMP-119](https://issues.folio.org/browse/UISAUTCOMP-119) Pass `source` with `failure` and `failureMessage` to the `SearchAndSortNoResultsMessage` component to display the correct message in the results if there is no permission to search records.
- [UISAUTCOMP-123](https://issues.folio.org/browse/UISAUTCOMP-123) Pass the `isCursorAtEnd` prop to the `TextArea` component.
- [UISAUTCOMP-124](https://issues.folio.org/browse/UISAUTCOMP-124) `SearchResultsList` - pass `sortDirection` and `showSortIndicator` props.

## [4.0.1] (https://github.com/folio-org/stripes-authority-components/tree/v4.0.1) (2024-04-02)

Expand Down
5 changes: 5 additions & 0 deletions lib/SearchResultsList/SearchResultsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const propTypes = {
pageSize: PropTypes.number.isRequired,
query: PropTypes.string.isRequired,
renderHeadingRef: PropTypes.func.isRequired,
showSortIndicator: PropTypes.bool,
sortedColumn: PropTypes.string,
sortOrder: PropTypes.string,
toggleFilterPane: PropTypes.func.isRequired,
Expand All @@ -65,6 +66,7 @@ const SearchResultsList = ({
pageSize,
onNeedMoreData,
visibleColumns,
showSortIndicator,
sortedColumn,
sortOrder,
onHeaderClick,
Expand Down Expand Up @@ -183,7 +185,9 @@ const SearchResultsList = ({
pageAmount={pageSize}
loading={loading}
sortedColumn={sortedColumn}
sortDirection={sortOrder}
sortOrder={sortOrder}
showSortIndicator={showSortIndicator}
onHeaderClick={onHeaderClick}
autosize
hidePageIndices={hidePageIndices}
Expand Down Expand Up @@ -228,6 +232,7 @@ SearchResultsList.defaultProps = {
itemToView: null,
onRowFocus: null,
onHeaderClick: null,
showSortIndicator: false,
sortedColumn: null,
sortOrder: null,
totalResults: NaN,
Expand Down
12 changes: 0 additions & 12 deletions lib/SearchResultsList/SearchResultsList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,6 @@ describe('Given SearchResultsList', () => {
expect(mockRenderHeadingRef).toHaveBeenNthCalledWith(2, expect.objectContaining(authorities[1]), undefined);
});

describe('when search is pending', () => {
it('should display pending message', () => {
const { getByText } = renderSearchResultsList({
authorities: [],
totalResults: 0,
loading: true,
});

expect(getByText('stripes-smart-components.sas.noResults.loading')).toBeDefined();
});
});

describe('when search is finished and no results were returned', () => {
it('should display pending message', () => {
const { getByText } = renderSearchResultsList({
Expand Down

0 comments on commit 77b0bb1

Please sign in to comment.