diff --git a/src/app/shared/search/search-filters/themed-search-filters.component.ts b/src/app/shared/search/search-filters/themed-search-filters.component.ts index a9a9c10e519..d520ac2b0ab 100644 --- a/src/app/shared/search/search-filters/themed-search-filters.component.ts +++ b/src/app/shared/search/search-filters/themed-search-filters.component.ts @@ -1,28 +1,31 @@ -import { Component, Input } from '@angular/core'; +import { Component, Input, Output, EventEmitter } from '@angular/core'; import { ThemedComponent } from '../../theme-support/themed.component'; import { SearchFiltersComponent } from './search-filters.component'; import { Observable } from 'rxjs/internal/Observable'; import { RemoteData } from '../../../core/data/remote-data'; import { SearchFilterConfig } from '../models/search-filter-config.model'; +import { AppliedFilter } from '../models/applied-filter.model'; /** * Themed wrapper for SearchFiltersComponent */ @Component({ selector: 'ds-themed-search-filters', - styleUrls: [], templateUrl: '../../theme-support/themed.component.html', }) export class ThemedSearchFiltersComponent extends ThemedComponent { - @Input() currentConfiguration; + @Input() currentConfiguration: string; @Input() currentScope: string; - @Input() inPlaceSearch; + @Input() inPlaceSearch: boolean; @Input() refreshFilters: Observable; @Input() filters: Observable>; + @Output() changeAppliedFilters: EventEmitter> = new EventEmitter(); protected inAndOutputNames: (keyof SearchFiltersComponent & keyof this)[] = [ - 'filters', 'currentConfiguration', 'currentScope', 'inPlaceSearch', 'refreshFilters']; + 'filters', 'currentConfiguration', 'currentScope', 'inPlaceSearch', 'refreshFilters', + 'changeAppliedFilters', + ]; protected getComponentName(): string { return 'SearchFiltersComponent'; diff --git a/src/app/shared/search/search-sidebar/search-sidebar.component.ts b/src/app/shared/search/search-sidebar/search-sidebar.component.ts index b5692e245ef..8f7e3236e9b 100644 --- a/src/app/shared/search/search-sidebar/search-sidebar.component.ts +++ b/src/app/shared/search/search-sidebar/search-sidebar.component.ts @@ -29,7 +29,7 @@ export class SearchSidebarComponent { /** * The configuration to use for the search options */ - @Input() configuration; + @Input() configuration: string; /** * The list of available configuration options @@ -54,7 +54,7 @@ export class SearchSidebarComponent { /** * The total amount of results */ - @Input() resultCount; + @Input() resultCount: number; /** * The list of available view mode options @@ -69,7 +69,7 @@ export class SearchSidebarComponent { /** * True when the search component should show results on the current page */ - @Input() inPlaceSearch; + @Input() inPlaceSearch: boolean; /** * The configuration for the current paginated search results diff --git a/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts b/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts index 935f7975328..2ffb1f8060d 100644 --- a/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts +++ b/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts @@ -8,37 +8,41 @@ import { PaginatedSearchOptions } from '../models/paginated-search-options.model import { BehaviorSubject, Observable } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; import { SearchFilterConfig } from '../models/search-filter-config.model'; +import { AppliedFilter } from '../models/applied-filter.model'; /** * Themed wrapper for SearchSidebarComponent */ @Component({ selector: 'ds-themed-search-sidebar', - styleUrls: [], templateUrl: '../../theme-support/themed.component.html', }) export class ThemedSearchSidebarComponent extends ThemedComponent { - @Input() configuration; + @Input() configuration: string; @Input() configurationList: SearchConfigurationOption[]; @Input() currentScope: string; @Input() currentSortOption: SortOptions; @Input() filters: Observable>; - @Input() resultCount; + @Input() resultCount: number; @Input() viewModeList: ViewMode[]; - @Input() showViewModes = true; - @Input() inPlaceSearch; + @Input() showViewModes: boolean; + @Input() inPlaceSearch: boolean; @Input() searchOptions: PaginatedSearchOptions; @Input() sortOptionsList: SortOptions[]; @Input() refreshFilters: BehaviorSubject; - @Output() toggleSidebar = new EventEmitter(); - @Output() changeConfiguration: EventEmitter = new EventEmitter(); - @Output() changeViewMode: EventEmitter = new EventEmitter(); + @Output() toggleSidebar: EventEmitter = new EventEmitter(); + @Output() changeConfiguration: EventEmitter = new EventEmitter(); + @Output() changeAppliedFilters: EventEmitter> = new EventEmitter(); + @Output() changeViewMode: EventEmitter = new EventEmitter(); protected inAndOutputNames: (keyof SearchSidebarComponent & keyof this)[] = [ 'configuration', 'configurationList', 'currentScope', 'currentSortOption', 'resultCount', 'filters', 'viewModeList', 'showViewModes', 'inPlaceSearch', - 'searchOptions', 'sortOptionsList', 'refreshFilters', 'toggleSidebar', 'changeConfiguration', 'changeViewMode']; + 'searchOptions', 'sortOptionsList', 'refreshFilters', 'toggleSidebar', 'changeConfiguration', + 'changeAppliedFilters', + 'changeViewMode', + ]; protected getComponentName(): string { return 'SearchSidebarComponent';