+ [resultCount]="(resultsRD$ | async)?.payload?.totalElements" [inPlaceSearch]="inPlaceSearch">
-
+
{{ 'search.results.no-results' | translate }}
diff --git a/src/app/+search-page/search-results/search-results.component.ts b/src/app/+search-page/search-results/search-results.component.ts
index 9656ba9574..ea6b407ee7 100644
--- a/src/app/+search-page/search-results/search-results.component.ts
+++ b/src/app/+search-page/search-results/search-results.component.ts
@@ -6,7 +6,7 @@ import { SetViewMode } from '../../shared/view-mode';
import { SearchOptions } from '../search-options.model';
import { SearchResult } from '../search-result.model';
import { PaginatedList } from '../../core/data/paginated-list';
-import { isNotEmpty } from '../../shared/empty.util';
+import { hasNoValue, isNotEmpty } from '../../shared/empty.util';
import { SortOptions } from '../../core/cache/models/sort-options.model';
@Component({
@@ -22,6 +22,8 @@ import { SortOptions } from '../../core/cache/models/sort-options.model';
* Component that represents all results from a search
*/
export class SearchResultsComponent {
+ hasNoValue = hasNoValue;
+
/**
* The actual search result objects
*/
@@ -60,7 +62,7 @@ export class SearchResultsComponent {
*/
getTitleKey() {
if (isNotEmpty(this.fixedFilter)) {
- return 'search.' + this.fixedFilter + '.results.head'
+ return this.fixedFilter + '.search.results.head'
} else {
return 'search.results.head';
}
diff --git a/src/app/+search-page/search-service/search-configuration.service.spec.ts b/src/app/+search-page/search-service/search-configuration.service.spec.ts
index 79932805c1..fb95ab8d04 100644
--- a/src/app/+search-page/search-service/search-configuration.service.spec.ts
+++ b/src/app/+search-page/search-service/search-configuration.service.spec.ts
@@ -171,20 +171,4 @@ describe('SearchConfigurationService', () => {
expect((service as any).routeService.getRouteParameterValue).toHaveBeenCalledWith('filter');
});
});
-
- describe('when updateFixedFilter is called', () => {
- const filter = 'filter';
-
- beforeEach(() => {
- service.updateFixedFilter(filter);
- });
-
- it('should update the paginated search options with the correct fixed filter', () => {
- expect(service.paginatedSearchOptions.getValue().fixedFilter).toEqual(filter);
- });
-
- it('should update the search options with the correct fixed filter', () => {
- expect(service.searchOptions.getValue().fixedFilter).toEqual(filter);
- });
- });
});
diff --git a/src/app/+search-page/search-service/search-configuration.service.ts b/src/app/+search-page/search-service/search-configuration.service.ts
index 1c12fe5037..5520b2c5aa 100644
--- a/src/app/+search-page/search-service/search-configuration.service.ts
+++ b/src/app/+search-page/search-service/search-configuration.service.ts
@@ -9,7 +9,7 @@ import {
of as observableOf,
Subscription
} from 'rxjs';
-import { filter, flatMap, map } from 'rxjs/operators';
+import { filter, flatMap, map, switchMap, tap } from 'rxjs/operators';
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
import { SearchOptions } from '../search-options.model';
@@ -45,7 +45,7 @@ export class SearchConfigurationService implements OnDestroy {
/**
* Default configuration parameter setting
*/
- protected defaultConfiguration = 'default';
+ protected defaultConfiguration;
/**
* Default scope setting
@@ -100,10 +100,8 @@ export class SearchConfigurationService implements OnDestroy {
const defs = defRD.payload;
this.paginatedSearchOptions = new BehaviorSubject
(defs);
this.searchOptions = new BehaviorSubject(defs);
-
this.subs.push(this.subscribeToSearchOptions(defs));
this.subs.push(this.subscribeToPaginatedSearchOptions(defs));
-
}
)
}
@@ -207,7 +205,7 @@ export class SearchConfigurationService implements OnDestroy {
*/
getCurrentFixedFilter(): Observable {
return this.routeService.getRouteParameterValue('filter').pipe(
- flatMap((f) => this.fixedFilterService.getQueryByFilterName(f))
+ switchMap((f) => this.fixedFilterService.getQueryByFilterName(f))
);
}
@@ -358,21 +356,7 @@ export class SearchConfigurationService implements OnDestroy {
isNotEmptyOperator(),
map((fixedFilter) => {
return { fixedFilter }
- })
+ }),
);
}
-
- /**
- * Update the fixed filter in paginated and non-paginated search options with a given value
- * @param {string} fixedFilter
- */
- public updateFixedFilter(fixedFilter: string) {
- const currentPaginatedValue: PaginatedSearchOptions = this.paginatedSearchOptions.getValue();
- const updatedPaginatedValue: PaginatedSearchOptions = Object.assign(currentPaginatedValue, { fixedFilter: fixedFilter });
- this.paginatedSearchOptions.next(updatedPaginatedValue);
-
- const currentValue: SearchOptions = this.searchOptions.getValue();
- const updatedValue: SearchOptions = Object.assign(currentValue, { fixedFilter: fixedFilter });
- this.searchOptions.next(updatedValue);
- }
}
diff --git a/src/app/+search-page/search-settings/search-settings.component.scss b/src/app/+search-page/search-settings/search-settings.component.scss
index 0a3824f815..cd18456888 100644
--- a/src/app/+search-page/search-settings/search-settings.component.scss
+++ b/src/app/+search-page/search-settings/search-settings.component.scss
@@ -1,5 +1,3 @@
-@import '../../../styles/variables.scss';
-
.setting-option {
- border: 1px solid map-get($theme-colors, light);
+ border: 1px solid map-get($theme-colors, light);
}
diff --git a/src/app/+search-page/search-sidebar/search-sidebar.component.html b/src/app/+search-page/search-sidebar/search-sidebar.component.html
index 50877052ec..7a5857fcff 100644
--- a/src/app/+search-page/search-sidebar/search-sidebar.component.html
+++ b/src/app/+search-page/search-sidebar/search-sidebar.component.html
@@ -10,7 +10,7 @@