mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Made SearchSidebarComponent themeable
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { ThemedComponent } from '../../theme-support/themed.component';
|
||||
import { SearchSidebarComponent } from './search-sidebar.component';
|
||||
import { SearchConfigurationOption } from '../search-switch-configuration/search-configuration-option.model';
|
||||
import { SortOptions } from '../../../core/cache/models/sort-options.model';
|
||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||
import { PaginatedSearchOptions } from '../models/paginated-search-options.model';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* 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() configurationList: SearchConfigurationOption[];
|
||||
@Input() currentScope: string;
|
||||
@Input() currentSortOption: SortOptions;
|
||||
@Input() resultCount;
|
||||
@Input() viewModeList: ViewMode[];
|
||||
@Input() showViewModes = true;
|
||||
@Input() inPlaceSearch;
|
||||
@Input() searchOptions: PaginatedSearchOptions;
|
||||
@Input() sortOptionsList: SortOptions[];
|
||||
@Input() refreshFilters: Observable<any>;
|
||||
@Output() toggleSidebar = new EventEmitter<boolean>();
|
||||
@Output() changeConfiguration: EventEmitter<SearchConfigurationOption> = new EventEmitter<SearchConfigurationOption>();
|
||||
@Output() changeViewMode: EventEmitter<ViewMode> = new EventEmitter<ViewMode>();
|
||||
|
||||
protected inAndOutputNames: (keyof SearchSidebarComponent & keyof this)[] = [
|
||||
'configuration', 'configurationList', 'currentScope', 'currentSortOption',
|
||||
'resultCount', 'viewModeList', 'showViewModes', 'inPlaceSearch',
|
||||
'searchOptions', 'sortOptionsList', 'refreshFilters', 'toggleSidebar', 'changeConfiguration', 'changeViewMode'];
|
||||
|
||||
protected getComponentName(): string {
|
||||
return 'SearchSidebarComponent';
|
||||
}
|
||||
|
||||
protected importThemedComponent(themeName: string): Promise<any> {
|
||||
return import(`../../../../themes/${themeName}/app/shared/search/search-sidebar/search-sidebar.component`);
|
||||
}
|
||||
|
||||
protected importUnthemedComponent(): Promise<any> {
|
||||
return import('./search-sidebar.component');
|
||||
}
|
||||
}
|
@@ -30,6 +30,7 @@ import { SearchResultsComponent } from './search-results/search-results.componen
|
||||
import { SearchComponent } from './search.component';
|
||||
import { ThemedSearchComponent } from './themed-search.component';
|
||||
import { ThemedSearchFiltersComponent } from './search-filters/themed-search-filters.component';
|
||||
import { ThemedSearchSidebarComponent } from './search-sidebar/themed-search-sidebar.component';
|
||||
|
||||
const COMPONENTS = [
|
||||
SearchComponent,
|
||||
@@ -55,6 +56,7 @@ const COMPONENTS = [
|
||||
ConfigurationSearchPageComponent,
|
||||
ThemedConfigurationSearchPageComponent,
|
||||
ThemedSearchFiltersComponent,
|
||||
ThemedSearchSidebarComponent,
|
||||
];
|
||||
|
||||
const ENTRY_COMPONENTS = [
|
||||
|
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE_ATMIRE and NOTICE_ATMIRE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* https://www.atmire.com/software-license/
|
||||
*/
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
SearchSidebarComponent as BaseComponent,
|
||||
} from '../../../../../../app/shared/search/search-sidebar/search-sidebar.component';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-dspace-page.component';
|
||||
import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'ds-search-sidebar',
|
||||
// styleUrls: ['./search-sidebar.component.scss'],
|
||||
styleUrls: ['../../../../../../app/shared/search/search-sidebar/search-sidebar.component.scss'],
|
||||
// templateUrl: './search-sidebar.component.html',
|
||||
templateUrl: '../../../../../../app/shared/search/search-sidebar/search-sidebar.component.html',
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService
|
||||
}
|
||||
]
|
||||
|
||||
})
|
||||
|
||||
export class SearchSidebarComponent extends BaseComponent {
|
||||
}
|
@@ -85,6 +85,7 @@ import { ResourcePoliciesModule } from '../../app/shared/resource-policies/resou
|
||||
import { ComcolModule } from '../../app/shared/comcol/comcol.module';
|
||||
import { FeedbackComponent } from './app/info/feedback/feedback.component';
|
||||
import { SearchFiltersComponent } from './app/shared/search/search-filters/search-filters.component';
|
||||
import { SearchSidebarComponent } from './app/shared/search/search-sidebar/search-sidebar.component';
|
||||
|
||||
const DECLARATIONS = [
|
||||
FileSectionComponent,
|
||||
@@ -129,6 +130,7 @@ const DECLARATIONS = [
|
||||
BreadcrumbsComponent,
|
||||
FeedbackComponent,
|
||||
SearchFiltersComponent,
|
||||
SearchSidebarComponent,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
Reference in New Issue
Block a user