Skip to content

Commit 386a1c9

Browse files
Merge branch 'use-applied-filter-to-display-label-on-search_contribute-7.6' into use-applied-filter-to-display-label-on-search_contribute-main
2 parents 32ff1db + 5ec0880 commit 386a1c9

3 files changed

Lines changed: 24 additions & 17 deletions

File tree

src/app/shared/search/search-filters/themed-search-filters.component.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1-
import { Component, Input } from '@angular/core';
1+
import { Component, Input, Output, EventEmitter } from '@angular/core';
22
import { ThemedComponent } from '../../theme-support/themed.component';
33
import { SearchFiltersComponent } from './search-filters.component';
44
import { Observable } from 'rxjs/internal/Observable';
55
import { RemoteData } from '../../../core/data/remote-data';
66
import { SearchFilterConfig } from '../models/search-filter-config.model';
7+
import { AppliedFilter } from '../models/applied-filter.model';
78

89
/**
910
* Themed wrapper for SearchFiltersComponent
1011
*/
1112
@Component({
1213
selector: 'ds-themed-search-filters',
13-
styleUrls: [],
1414
templateUrl: '../../theme-support/themed.component.html',
1515
})
1616
export class ThemedSearchFiltersComponent extends ThemedComponent<SearchFiltersComponent> {
1717

18-
@Input() currentConfiguration;
18+
@Input() currentConfiguration: string;
1919
@Input() currentScope: string;
20-
@Input() inPlaceSearch;
20+
@Input() inPlaceSearch: boolean;
2121
@Input() refreshFilters: Observable<any>;
2222
@Input() filters: Observable<RemoteData<SearchFilterConfig[]>>;
23+
@Output() changeAppliedFilters: EventEmitter<Map<string, AppliedFilter[]>> = new EventEmitter();
2324

2425
protected inAndOutputNames: (keyof SearchFiltersComponent & keyof this)[] = [
25-
'filters', 'currentConfiguration', 'currentScope', 'inPlaceSearch', 'refreshFilters'];
26+
'filters', 'currentConfiguration', 'currentScope', 'inPlaceSearch', 'refreshFilters',
27+
'changeAppliedFilters',
28+
];
2629

2730
protected getComponentName(): string {
2831
return 'SearchFiltersComponent';

src/app/shared/search/search-sidebar/search-sidebar.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class SearchSidebarComponent {
2929
/**
3030
* The configuration to use for the search options
3131
*/
32-
@Input() configuration;
32+
@Input() configuration: string;
3333

3434
/**
3535
* The list of available configuration options
@@ -54,7 +54,7 @@ export class SearchSidebarComponent {
5454
/**
5555
* The total amount of results
5656
*/
57-
@Input() resultCount;
57+
@Input() resultCount: number;
5858

5959
/**
6060
* The list of available view mode options
@@ -69,7 +69,7 @@ export class SearchSidebarComponent {
6969
/**
7070
* True when the search component should show results on the current page
7171
*/
72-
@Input() inPlaceSearch;
72+
@Input() inPlaceSearch: boolean;
7373

7474
/**
7575
* The configuration for the current paginated search results

src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,41 @@ import { PaginatedSearchOptions } from '../models/paginated-search-options.model
88
import { BehaviorSubject, Observable } from 'rxjs';
99
import { RemoteData } from '../../../core/data/remote-data';
1010
import { SearchFilterConfig } from '../models/search-filter-config.model';
11+
import { AppliedFilter } from '../models/applied-filter.model';
1112

1213
/**
1314
* Themed wrapper for SearchSidebarComponent
1415
*/
1516
@Component({
1617
selector: 'ds-themed-search-sidebar',
17-
styleUrls: [],
1818
templateUrl: '../../theme-support/themed.component.html',
1919
})
2020
export class ThemedSearchSidebarComponent extends ThemedComponent<SearchSidebarComponent> {
2121

22-
@Input() configuration;
22+
@Input() configuration: string;
2323
@Input() configurationList: SearchConfigurationOption[];
2424
@Input() currentScope: string;
2525
@Input() currentSortOption: SortOptions;
2626
@Input() filters: Observable<RemoteData<SearchFilterConfig[]>>;
27-
@Input() resultCount;
27+
@Input() resultCount: number;
2828
@Input() viewModeList: ViewMode[];
29-
@Input() showViewModes = true;
30-
@Input() inPlaceSearch;
29+
@Input() showViewModes: boolean;
30+
@Input() inPlaceSearch: boolean;
3131
@Input() searchOptions: PaginatedSearchOptions;
3232
@Input() sortOptionsList: SortOptions[];
3333
@Input() refreshFilters: BehaviorSubject<boolean>;
34-
@Output() toggleSidebar = new EventEmitter<boolean>();
35-
@Output() changeConfiguration: EventEmitter<SearchConfigurationOption> = new EventEmitter<SearchConfigurationOption>();
36-
@Output() changeViewMode: EventEmitter<ViewMode> = new EventEmitter<ViewMode>();
34+
@Output() toggleSidebar: EventEmitter<boolean> = new EventEmitter();
35+
@Output() changeConfiguration: EventEmitter<SearchConfigurationOption> = new EventEmitter();
36+
@Output() changeAppliedFilters: EventEmitter<Map<string, AppliedFilter[]>> = new EventEmitter();
37+
@Output() changeViewMode: EventEmitter<ViewMode> = new EventEmitter();
3738

3839
protected inAndOutputNames: (keyof SearchSidebarComponent & keyof this)[] = [
3940
'configuration', 'configurationList', 'currentScope', 'currentSortOption',
4041
'resultCount', 'filters', 'viewModeList', 'showViewModes', 'inPlaceSearch',
41-
'searchOptions', 'sortOptionsList', 'refreshFilters', 'toggleSidebar', 'changeConfiguration', 'changeViewMode'];
42+
'searchOptions', 'sortOptionsList', 'refreshFilters', 'toggleSidebar', 'changeConfiguration',
43+
'changeAppliedFilters',
44+
'changeViewMode',
45+
];
4246

4347
protected getComponentName(): string {
4448
return 'SearchSidebarComponent';

0 commit comments

Comments
 (0)