From ecf67cbf6280c7d88b27b65da4e88d78acff8a93 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 17 Jan 2024 15:05:57 +0100 Subject: [PATCH] 111103: Added SearchComponent to custom theme in order to easily team it & added missing provider to themed wrapper --- src/app/shared/search/themed-search.component.ts | 8 ++++++++ .../custom/app/shared/search/search.component.html | 0 .../custom/app/shared/search/search.component.scss | 0 .../custom/app/shared/search/search.component.ts | 13 +++++++++++++ src/themes/custom/lazy-theme.module.ts | 2 ++ 5 files changed, 23 insertions(+) create mode 100644 src/themes/custom/app/shared/search/search.component.html create mode 100644 src/themes/custom/app/shared/search/search.component.scss create mode 100644 src/themes/custom/app/shared/search/search.component.ts diff --git a/src/app/shared/search/themed-search.component.ts b/src/app/shared/search/themed-search.component.ts index fe531e4f0f5..3a2d5022407 100644 --- a/src/app/shared/search/themed-search.component.ts +++ b/src/app/shared/search/themed-search.component.ts @@ -9,6 +9,8 @@ import { ViewMode } from '../../core/shared/view-mode.model'; import { SearchObjects } from './models/search-objects.model'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { ListableObject } from '../object-collection/shared/listable-object.model'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; +import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; /** * Themed wrapper for {@link SearchComponent} @@ -17,6 +19,12 @@ import { ListableObject } from '../object-collection/shared/listable-object.mode selector: 'ds-themed-search', styleUrls: [], templateUrl: '../theme-support/themed.component.html', + providers: [ + { + provide: SEARCH_CONFIG_SERVICE, + useClass: SearchConfigurationService + } + ] }) export class ThemedSearchComponent extends ThemedComponent { protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showCsvExport', 'showSidebar', 'showThumbnails', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics', 'query']; diff --git a/src/themes/custom/app/shared/search/search.component.html b/src/themes/custom/app/shared/search/search.component.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/themes/custom/app/shared/search/search.component.scss b/src/themes/custom/app/shared/search/search.component.scss new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/themes/custom/app/shared/search/search.component.ts b/src/themes/custom/app/shared/search/search.component.ts new file mode 100644 index 00000000000..f54f707e538 --- /dev/null +++ b/src/themes/custom/app/shared/search/search.component.ts @@ -0,0 +1,13 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { pushInOut } from '../../../../../app/shared/animations/push'; +import { SearchComponent as BaseComponent } from '../../../../../app/shared/search/search.component'; + +@Component({ + selector: 'ds-search', + styleUrls: ['./search.component.scss'], + templateUrl: './search.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + animations: [pushInOut], +}) +export class SearchComponent extends BaseComponent { +} diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index edb3f5478c9..4c4faa51931 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -156,6 +156,7 @@ import { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/ import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; import { FormModule } from '../../app/shared/form/form.module'; import { RequestCopyModule } from 'src/app/request-copy/request-copy.module'; +import { SearchComponent } from './app/shared/search/search.component'; const DECLARATIONS = [ FileSectionComponent, @@ -239,6 +240,7 @@ const DECLARATIONS = [ SubmissionSectionUploadFileComponent, ItemStatusComponent, EditBitstreamPageComponent, + SearchComponent, ]; @NgModule({