mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 06:23:03 +00:00
[CST-4633] fix issue with view mode list
This commit is contained in:
@@ -4,6 +4,7 @@ import { SearchConfigurationOption } from '../search-switch-configuration/search
|
||||
import { Observable } from 'rxjs';
|
||||
import { PaginatedSearchOptions } from '../models/paginated-search-options.model';
|
||||
import { SortOptions } from '../../../core/cache/models/sort-options.model';
|
||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||
|
||||
/**
|
||||
* This component renders a simple item page.
|
||||
@@ -50,7 +51,7 @@ export class SearchSidebarComponent {
|
||||
/**
|
||||
* The list of available view mode options
|
||||
*/
|
||||
@Input() viewModeList;
|
||||
@Input() viewModeList: ViewMode[];
|
||||
|
||||
/**
|
||||
* Whether to show the view mode switch
|
||||
|
@@ -47,6 +47,7 @@
|
||||
[sortOptionsList]="(sortOptionsList$ | async)"
|
||||
[currentSortOption]="(currentSortOptions$ | async)"
|
||||
[inPlaceSearch]="inPlaceSearch"
|
||||
[viewModeList]="viewModeList"
|
||||
(changeConfiguration)="changeContext($event.context)"></ds-search-sidebar>
|
||||
<ds-search-sidebar id="search-sidebar-sm" *ngIf="(isXsOrSm$ | async)"
|
||||
[configurationList]="configurationList"
|
||||
@@ -56,6 +57,7 @@
|
||||
[searchOptions]="(searchOptions$ | async)"
|
||||
[sortOptionsList]="(sortOptionsList$ | async)"
|
||||
[currentSortOption]="(currentSortOptions$ | async)"
|
||||
[viewModeList]="viewModeList"
|
||||
(toggleSidebar)="closeSidebar()"
|
||||
(changeConfiguration)="changeContext($event.context)">
|
||||
</ds-search-sidebar>
|
||||
|
@@ -96,6 +96,11 @@ export class SearchComponent implements OnInit {
|
||||
*/
|
||||
@Input() showSidebar = true;
|
||||
|
||||
/**
|
||||
* List of available view mode
|
||||
*/
|
||||
@Input() useUniquePageId: false;
|
||||
|
||||
/**
|
||||
* List of available view mode
|
||||
*/
|
||||
@@ -178,8 +183,11 @@ export class SearchComponent implements OnInit {
|
||||
* If something changes, update the list of scopes for the dropdown
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
// Create an unique pagination id related to the instance of the SearchComponent
|
||||
this.paginationId = uniqueId(this.paginationId);
|
||||
if (this.useUniquePageId) {
|
||||
// Create an unique pagination id related to the instance of the SearchComponent
|
||||
this.paginationId = uniqueId(this.paginationId);
|
||||
}
|
||||
|
||||
this.searchConfigService.setPaginationId(this.paginationId);
|
||||
|
||||
if (hasValue(this.fixedFilterQuery)) {
|
||||
|
@@ -17,13 +17,17 @@ import { Router } from '@angular/router';
|
||||
templateUrl: './view-mode-switch.component.html'
|
||||
})
|
||||
export class ViewModeSwitchComponent implements OnInit, OnDestroy {
|
||||
@Input() viewModeList: ViewMode[];
|
||||
|
||||
/**
|
||||
* True when the search component should show results on the current page
|
||||
*/
|
||||
@Input() inPlaceSearch;
|
||||
|
||||
/**
|
||||
* List of available view mode
|
||||
*/
|
||||
@Input() viewModeList: ViewMode[];
|
||||
|
||||
/**
|
||||
* The current view mode
|
||||
*/
|
||||
|
Reference in New Issue
Block a user