55647: Intermediate FixedFilter fixes

This commit is contained in:
Kristof De Langhe
2018-09-18 16:08:29 +02:00
parent 363e1459cc
commit d8ce01b27a
5 changed files with 15 additions and 7 deletions

View File

@@ -27,8 +27,9 @@ export class FilteredSearchPageComponent extends SearchPageComponent {
protected sidebarService: SearchSidebarService,
protected windowService: HostWindowService,
protected filterService: SearchFilterService,
protected searchConfigService: SearchConfigurationService) {
super(service, sidebarService, windowService, filterService, searchConfigService);
protected searchConfigService: SearchConfigurationService,
protected routeService: RouteService) {
super(service, sidebarService, windowService, filterService, searchConfigService, routeService);
}
}

View File

@@ -16,11 +16,12 @@ export class SearchOptions {
filters?: any;
fixedFilter?: any;
constructor(options: {scope?: string, query?: string, dsoType?: DSpaceObjectType, filters?: SearchFilter[]}) {
constructor(options: {scope?: string, query?: string, dsoType?: DSpaceObjectType, filters?: SearchFilter[], fixedFilter?: any}) {
this.scope = options.scope;
this.query = options.query;
this.dsoType = options.dsoType;
this.filters = options.filters;
this.fixedFilter = options.fixedFilter;
}
/**

View File

@@ -31,7 +31,8 @@
</button>
</div>
<ds-search-results [searchResults]="resultsRD$ | async"
[searchConfig]="searchOptions$ | async"></ds-search-results>
[searchConfig]="searchOptions$ | async"
[fixedFilter]="fixedFilter | async"></ds-search-results>
</div>
</div>
</div>

View File

@@ -16,6 +16,7 @@ import { hasValue } from '../shared/empty.util';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { SearchConfigurationService } from './search-service/search-configuration.service';
import { getSucceededRemoteData } from '../core/shared/operators';
import { RouteService } from '../shared/services/route.service';
/**
* This component renders a simple item page.
@@ -61,11 +62,14 @@ export class SearchPageComponent implements OnInit {
*/
sub: Subscription;
fixedFilter;
constructor(protected service: SearchService,
protected sidebarService: SearchSidebarService,
protected windowService: HostWindowService,
protected filterService: SearchFilterService,
protected searchConfigService: SearchConfigurationService) {
protected searchConfigService: SearchConfigurationService,
protected routeService: RouteService) {
this.isXsOrSm$ = this.windowService.isXsOrSm();
}
@@ -86,6 +90,7 @@ export class SearchPageComponent implements OnInit {
this.scopeListRD$ = this.searchConfigService.getCurrentScope('').pipe(
switchMap((scopeId) => this.service.getScopes(scopeId))
);
this.fixedFilter = this.routeService.getRouteParameterValue('filter');
}
/**

View File

@@ -54,7 +54,7 @@ export class SearchSettingsComponent implements OnInit {
},
queryParamsHandling: 'merge'
};
this.router.navigate([ '/search' ], navigationExtras);
this.router.navigate([ this.service.getSearchLink() ], navigationExtras);
}
/**
@@ -71,6 +71,6 @@ export class SearchSettingsComponent implements OnInit {
},
queryParamsHandling: 'merge'
};
this.router.navigate([ '/search' ], navigationExtras);
this.router.navigate([ this.service.getSearchLink() ], navigationExtras);
}
}