Skip to content
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

UI: Search button only performs a search on a page level #199

Merged
merged 1 commit into from
Jun 5, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Do not display objects that have also a delete marker (gh#aquarist-labs/s3gw#548).
- Search button only performs a search on a page level (gh#aquarist-labs/s3gw#556).

## [0.16.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,9 @@ export class DatatableComponent implements Datatable, OnInit {
private applyFilters(): void {
// Filter the data according the following rules:
// 1. Order the data according the given criteria (column sorting).
// 2. Get the data that is displayed on the given page (pagination).
// 3. Apply the given search filter.
// 2. Apply the given search filter.
// 3. Get the data that is displayed on the given page (pagination).
const filteredData = _.orderBy(this.data, [this.sortHeader], [this.sortDirection])
.slice((this.page - 1) * this.pageSize, (this.page - 1) * this.pageSize + this.pageSize)
.filter((o: DatatableData) =>
_.some(this.columns, (column: DatatableColumn) => {
let value = _.get(o, column.prop);
Expand All @@ -499,7 +498,8 @@ export class DatatableComponent implements Datatable, OnInit {
}
return _.includes(_.lowerCase(value), _.lowerCase(this.searchFilter));
})
);
)
.slice((this.page - 1) * this.pageSize, (this.page - 1) * this.pageSize + this.pageSize);
if (
filteredData.length !== this.filteredData.length ||
!_.isEqual(filteredData, this.filteredData)
Expand Down