Skip to content

Commit

Permalink
Merge pull request #1486 from bcgov/task/alcs-1650
Browse files Browse the repository at this point in the history
Public search scroll to result
  • Loading branch information
urmikgov authored Mar 11, 2024
2 parents 8396035 + 316a933 commit aab36e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ <h3>Search by one or more of the following fields:</h3>

<div class="button-controls">
<button type="button" mat-stroked-button color="accent" (click)="onClear()">Clear</button>
<button type="submit" mat-flat-button color="primary" [disabled]="formEmpty || !searchForm.valid">Search</button>
<button type="submit" mat-flat-button color="primary" [disabled]="formEmpty || !searchForm.valid || isLoading">Search</button>
</div>
</form>

<div *ngIf="isLoading && searchResultsHidden" class="center">
<mat-spinner></mat-spinner>
</div>
<div class="search-fields-wrapper search-result-wrapper" *ngIf="!searchResultsHidden">
<h3 class="search-title">Search Results</h3>
<h3 class="search-title" id="searchResults">Search Results</h3>
<div *ngIf="isLoading && !searchResultsHidden" class="center">
<mat-spinner></mat-spinner>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ToastService } from '../../../services/toast/toast.service';
import { MOBILE_BREAKPOINT } from '../../../shared/utils/breakpoints';
import { FileTypeFilterDropDownComponent } from './file-type-filter-drop-down/file-type-filter-drop-down.component';
import { TableChange } from './search.interface';
import { scrollToElement } from '../../../shared/utils/scroll-helper';

const STATUS_MAP = {
'Received by ALC': 'RECA',
Expand Down Expand Up @@ -193,6 +194,7 @@ export class PublicSearchComponent implements OnInit, OnDestroy {
sessionStorage.setItem(SEARCH_SESSION_STORAGE_KEY, searchDto);

this.isLoading = true;
scrollToElement({ id: `searchResults`, center: false });
const result = await this.searchService.search(searchParams);
this.searchResultsHidden = false;
this.isLoading = false;
Expand Down

0 comments on commit aab36e6

Please sign in to comment.