Merge branch 'use-applied-filter-to-display-label-on-search_contribute-7.6' into use-applied-filter-to-display-label-on-search_contribute-main

This commit is contained in:
Alexandre Vryghem
2024-02-16 21:56:33 +01:00
3 changed files with 24 additions and 17 deletions

View File

@@ -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';

View File

@@ -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

View File

@@ -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';