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

Send user back to first page when they make searches. #1550

Merged
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
4 changes: 2 additions & 2 deletions galaxyui/src/app/search/search.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<div class="search-bar">
<div class="search-field">
<div class="input-group">
<input type="text" [(ngModel)]="queryParams.keywords" (keyup.enter)="searchContent()" class="form-control" placeholder="Search for...">
<input type="text" [(ngModel)]="queryParams.keywords" (keyup.enter)="searchEntered()" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-default" type="button" (click)="searchContent()"><span class="fa fa-search"></span></button>
<button class="btn btn-default" type="button" (click)="searchEntered()"><span class="fa fa-search"></span></button>
</span>
</div>
</div>
Expand Down
13 changes: 10 additions & 3 deletions galaxyui/src/app/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class SearchComponent implements OnInit, AfterViewInit {
}
sortParams += $event.field.id;
this.queryParams['order_by'] = sortParams;
this.searchContent();
this.searchEntered();
}

filterChanged($event: FilterEvent): void {
Expand Down Expand Up @@ -327,7 +327,7 @@ export class SearchComponent implements OnInit, AfterViewInit {
this.appliedFilters = [];
this.contentItems = [];
}
this.searchContent();
this.searchEntered();
}

getToolbarConfig(): ToolbarConfig {
Expand Down Expand Up @@ -374,10 +374,17 @@ export class SearchComponent implements OnInit, AfterViewInit {

if (update) {
this.setAppliedFilters(this.queryParams);
this.searchContent();
this.searchEntered();
}
}

searchEntered() {
this.queryParams['page'] = 1;
this.pageNumber = 1;
this.paginationConfig.pageNumber = 1;
this.searchContent();
}

searchContent() {
this.pageLoading = true;
this.setUrlParams(this.queryParams);
Expand Down