Skip to content

Commit

Permalink
110889: Added the new EventEmitters to the ThemedSearchFiltersCompone…
Browse files Browse the repository at this point in the history
…nt & ThemedSearchSidebarComponent
  • Loading branch information
alexandrevryghem committed Feb 16, 2024
1 parent f655777 commit 5ec0880
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -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<SearchFiltersComponent> {

@Input() currentConfiguration;
@Input() currentConfiguration: string;
@Input() currentScope: string;
@Input() inPlaceSearch;
@Input() inPlaceSearch: boolean;
@Input() refreshFilters: Observable<any>;
@Input() filters: Observable<RemoteData<SearchFilterConfig[]>>;
@Output() changeAppliedFilters: EventEmitter<Map<string, AppliedFilter[]>> = new EventEmitter();

protected inAndOutputNames: (keyof SearchFiltersComponent & keyof this)[] = [
'filters', 'currentConfiguration', 'currentScope', 'inPlaceSearch', 'refreshFilters'];
'filters', 'currentConfiguration', 'currentScope', 'inPlaceSearch', 'refreshFilters',
'changeAppliedFilters',
];

protected getComponentName(): string {
return 'SearchFiltersComponent';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -54,7 +54,7 @@ export class SearchSidebarComponent {
/**
* The total amount of results
*/
@Input() resultCount;
@Input() resultCount: number;

/**
* The list of available view mode options
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SearchSidebarComponent> {

@Input() configuration;
@Input() configuration: string;
@Input() configurationList: SearchConfigurationOption[];
@Input() currentScope: string;
@Input() currentSortOption: SortOptions;
@Input() filters: Observable<RemoteData<SearchFilterConfig[]>>;
@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<boolean>;
@Output() toggleSidebar = new EventEmitter<boolean>();
@Output() changeConfiguration: EventEmitter<SearchConfigurationOption> = new EventEmitter<SearchConfigurationOption>();
@Output() changeViewMode: EventEmitter<ViewMode> = new EventEmitter<ViewMode>();
@Output() toggleSidebar: EventEmitter<boolean> = new EventEmitter();
@Output() changeConfiguration: EventEmitter<SearchConfigurationOption> = new EventEmitter();
@Output() changeAppliedFilters: EventEmitter<Map<string, AppliedFilter[]>> = new EventEmitter();
@Output() changeViewMode: EventEmitter<ViewMode> = 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';
Expand Down

0 comments on commit 5ec0880

Please sign in to comment.