diff --git a/src/app/admin/admin-search-page/admin-search-page.component.html b/src/app/admin/admin-search-page/admin-search-page.component.html index 69ff132fe3f..8a0d9cefb2d 100644 --- a/src/app/admin/admin-search-page/admin-search-page.component.html +++ b/src/app/admin/admin-search-page/admin-search-page.component.html @@ -1 +1 @@ - + diff --git a/src/app/admin/admin-search-page/admin-search-page.component.spec.ts b/src/app/admin/admin-search-page/admin-search-page.component.spec.ts index d3a39f12f4a..da530a851ec 100644 --- a/src/app/admin/admin-search-page/admin-search-page.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-page.component.spec.ts @@ -6,9 +6,9 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { ThemedConfigurationSearchPageComponent } from '../../search-page/themed-configuration-search-page.component'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { AdminSearchPageComponent } from './admin-search-page.component'; +import { ThemedSearchComponent } from '../../shared/search/themed-search.component'; describe('AdminSearchPageComponent', () => { let component: AdminSearchPageComponent; @@ -23,7 +23,9 @@ describe('AdminSearchPageComponent', () => { schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(AdminSearchPageComponent, { remove: { - imports: [ThemedConfigurationSearchPageComponent], + imports: [ + ThemedSearchComponent, + ], }, }) .compileComponents(); diff --git a/src/app/admin/admin-search-page/admin-search-page.component.ts b/src/app/admin/admin-search-page/admin-search-page.component.ts index 341c2b12139..7726a3be83d 100644 --- a/src/app/admin/admin-search-page/admin-search-page.component.ts +++ b/src/app/admin/admin-search-page/admin-search-page.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { Context } from '../../core/shared/context.model'; -import { ThemedConfigurationSearchPageComponent } from '../../search-page/themed-configuration-search-page.component'; +import { ThemedSearchComponent } from '../../shared/search/themed-search.component'; @Component({ selector: 'ds-base-admin-search-page', @@ -9,7 +9,7 @@ import { ThemedConfigurationSearchPageComponent } from '../../search-page/themed styleUrls: ['./admin-search-page.component.scss'], standalone: true, imports: [ - ThemedConfigurationSearchPageComponent, + ThemedSearchComponent, ], }) diff --git a/src/app/admin/admin-workflow-page/admin-workflow-page.component.html b/src/app/admin/admin-workflow-page/admin-workflow-page.component.html index d12cefb3313..83f89f1b9c4 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-page.component.html +++ b/src/app/admin/admin-workflow-page/admin-workflow-page.component.html @@ -1 +1 @@ - + diff --git a/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts index 252a38e7716..b1e2d247b3d 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts @@ -5,8 +5,8 @@ import { waitForAsync, } from '@angular/core/testing'; -import { ThemedConfigurationSearchPageComponent } from '../../search-page/themed-configuration-search-page.component'; import { AdminWorkflowPageComponent } from './admin-workflow-page.component'; +import { ThemedSearchComponent } from '../../shared/search/themed-search.component'; describe('AdminSearchPageComponent', () => { let component: AdminWorkflowPageComponent; @@ -20,7 +20,7 @@ describe('AdminSearchPageComponent', () => { .overrideComponent(AdminWorkflowPageComponent, { remove: { imports: [ - ThemedConfigurationSearchPageComponent, + ThemedSearchComponent, ], }, }) diff --git a/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts index 74de483c017..3d200ec9113 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { Context } from '../../core/shared/context.model'; -import { ThemedConfigurationSearchPageComponent } from '../../search-page/themed-configuration-search-page.component'; +import { ThemedSearchComponent } from '../../shared/search/themed-search.component'; @Component({ selector: 'ds-base-admin-workflow-page', @@ -9,7 +9,7 @@ import { ThemedConfigurationSearchPageComponent } from '../../search-page/themed styleUrls: ['./admin-workflow-page.component.scss'], standalone: true, imports: [ - ThemedConfigurationSearchPageComponent, + ThemedSearchComponent, ], }) diff --git a/src/app/core/data-services-map.ts b/src/app/core/data-services-map.ts index c9ebbc5ffc3..21c9034b309 100644 --- a/src/app/core/data-services-map.ts +++ b/src/app/core/data-services-map.ts @@ -68,6 +68,8 @@ import { SUPERVISION_ORDER } from './supervision-order/models/supervision-order. import { CLAIMED_TASK } from './tasks/models/claimed-task-object.resource-type'; import { POOL_TASK } from './tasks/models/pool-task-object.resource-type'; import { WORKFLOW_ACTION } from './tasks/models/workflow-action-object.resource-type'; +import { SEARCH_FILTER_CONFIG } from '../shared/search/models/types/search-filter-config.resource-type'; +import { SEARCH_SORT_OPTION } from '../shared/search/models/types/search-sort-option.resource-type'; export const LAZY_DATA_SERVICES: LazyDataServicesMap = new Map([ [AUTHORIZATION.value, () => import('./data/feature-authorization/authorization-data.service').then(m => m.AuthorizationDataService)], @@ -136,4 +138,6 @@ export const LAZY_DATA_SERVICES: LazyDataServicesMap = new Map([ [SUGGESTION_TARGET.value, () => import('./notifications/suggestions/target/suggestion-target-data.service').then(m => m.SuggestionTargetDataService)], [DUPLICATE.value, () => import('./submission/submission-duplicate-data.service').then(m => m.SubmissionDuplicateDataService)], [CorrectionType.type.value, () => import('./submission/correctiontype-data.service').then(m => m.CorrectionTypeDataService)], + [SEARCH_FILTER_CONFIG.value, () => import('./data/href-only-data.service').then(m => m.HrefOnlyDataService)], + [SEARCH_SORT_OPTION.value, () => import('./data/href-only-data.service').then(m => m.HrefOnlyDataService)], ]); diff --git a/src/app/core/provide-core.ts b/src/app/core/provide-core.ts index 0057c0823d7..fd1f9b1b114 100644 --- a/src/app/core/provide-core.ts +++ b/src/app/core/provide-core.ts @@ -84,6 +84,9 @@ import { RatingAdvancedWorkflowInfo } from './tasks/models/rating-advanced-workf import { SelectReviewerAdvancedWorkflowInfo } from './tasks/models/select-reviewer-advanced-workflow-info.model'; import { TaskObject } from './tasks/models/task-object.model'; import { WorkflowAction } from './tasks/models/workflow-action-object.model'; +import { DiscoveryConfiguration } from '../shared/search/models/discovery-configuration.model'; +import { Facet } from '../shared/search/models/facet.model'; +import { SearchSortOption } from '../shared/search/models/search-sort-option.model'; export const provideCore = () => { @@ -187,4 +190,7 @@ export const models = SubmissionCoarNotifyConfig, NotifyRequestsStatus, SystemWideAlert, + DiscoveryConfiguration, + Facet, + SearchSortOption, ]; diff --git a/src/app/home-page/home-page.component.html b/src/app/home-page/home-page.component.html index b53672768af..c96a29e7177 100644 --- a/src/app/home-page/home-page.component.html +++ b/src/app/home-page/home-page.component.html @@ -1,14 +1,14 @@ @if (showDiscoverFilters) { - - + } @if (!showDiscoverFilters) {
diff --git a/src/app/home-page/home-page.component.scss b/src/app/home-page/home-page.component.scss index 5905a5959bb..e69de29bb2d 100644 --- a/src/app/home-page/home-page.component.scss +++ b/src/app/home-page/home-page.component.scss @@ -1,6 +0,0 @@ -@include media-breakpoint-down(md) { - ds-themed-configuration-search-page + .container { - width: 100%; - max-width: none; - } -} diff --git a/src/app/home-page/home-page.component.ts b/src/app/home-page/home-page.component.ts index f262581e595..4ba395a802c 100644 --- a/src/app/home-page/home-page.component.ts +++ b/src/app/home-page/home-page.component.ts @@ -18,17 +18,25 @@ import { import { Site } from '../core/shared/site.model'; import { SuggestionsPopupComponent } from '../notifications/suggestions/popup/suggestions-popup.component'; -import { ThemedConfigurationSearchPageComponent } from '../search-page/themed-configuration-search-page.component'; import { ThemedSearchFormComponent } from '../shared/search-form/themed-search-form.component'; import { HomeCoarComponent } from './home-coar/home-coar.component'; import { ThemedHomeNewsComponent } from './home-news/themed-home-news.component'; import { RecentItemListComponent } from './recent-item-list/recent-item-list.component'; import { ThemedTopLevelCommunityListComponent } from './top-level-community-list/themed-top-level-community-list.component'; +import { ThemedSearchComponent } from '../shared/search/themed-search.component'; +import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-configuration.service'; +import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; @Component({ selector: 'ds-base-home-page', styleUrls: ['./home-page.component.scss'], templateUrl: './home-page.component.html', + providers: [ + { + provide: SEARCH_CONFIG_SERVICE, + useClass: SearchConfigurationService, + }, + ], standalone: true, imports: [ AsyncPipe, @@ -36,11 +44,11 @@ import { ThemedTopLevelCommunityListComponent } from './top-level-community-list NgTemplateOutlet, RecentItemListComponent, SuggestionsPopupComponent, - ThemedConfigurationSearchPageComponent, ThemedHomeNewsComponent, ThemedSearchFormComponent, ThemedTopLevelCommunityListComponent, TranslateModule, + ThemedSearchComponent, ], }) export class HomePageComponent implements OnInit { diff --git a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html index 36340bebfa0..fa7db566d5e 100644 --- a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html +++ b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.html @@ -1,7 +1,7 @@ - - + diff --git a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts index 6771665362e..18d84e1a6f0 100644 --- a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts +++ b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts @@ -9,8 +9,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; import { Item } from '../../../../core/shared/item.model'; -import { ThemedConfigurationSearchPageComponent } from '../../../../search-page/themed-configuration-search-page.component'; import { RelatedEntitiesSearchComponent } from './related-entities-search.component'; +import { ThemedSearchComponent } from '../../../../shared/search/themed-search.component'; describe('RelatedEntitiesSearchComponent', () => { let comp: RelatedEntitiesSearchComponent; @@ -30,7 +30,9 @@ describe('RelatedEntitiesSearchComponent', () => { }) .overrideComponent(RelatedEntitiesSearchComponent, { remove: { - imports: [ThemedConfigurationSearchPageComponent], + imports: [ + ThemedSearchComponent, + ], }, }) .compileComponents(); diff --git a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts index 824b3849245..9c6e9540a08 100644 --- a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts +++ b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts @@ -5,16 +5,16 @@ import { } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; -import { ThemedConfigurationSearchPageComponent } from '../../../../search-page/themed-configuration-search-page.component'; import { isNotEmpty } from '../../../../shared/empty.util'; import { getFilterByRelation } from '../../../../shared/utils/relation-query.utils'; +import { ThemedSearchComponent } from '../../../../shared/search/themed-search.component'; @Component({ selector: 'ds-related-entities-search', templateUrl: './related-entities-search.component.html', standalone: true, imports: [ - ThemedConfigurationSearchPageComponent, + ThemedSearchComponent, ], }) /** diff --git a/src/app/search-page/configuration-search-page.component.spec.ts b/src/app/search-page/configuration-search-page.component.spec.ts deleted file mode 100644 index f3931a2016f..00000000000 --- a/src/app/search-page/configuration-search-page.component.spec.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { - Component, - ViewChild, -} from '@angular/core'; -import { - ComponentFixture, - TestBed, - waitForAsync, -} from '@angular/core/testing'; -import { Router } from '@angular/router'; -import { of } from 'rxjs'; - -import { RouteService } from '../core/services/route.service'; -import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; -import { configureSearchComponentTestingModule } from '../shared/search/search.component.spec'; -import { ConfigurationSearchPageComponent } from './configuration-search-page.component'; -import createSpy = jasmine.createSpy; - -const CONFIGURATION = 'test-configuration'; -const QUERY = 'test query'; - -@Component({ - template: ` - - - `, - imports: [ - ConfigurationSearchPageComponent, - ], - standalone: true, -}) -class HostComponent { - @ViewChild('configurationSearchPage') configurationSearchPage: ConfigurationSearchPageComponent; -} - -describe('ConfigurationSearchPageComponent', () => { - let comp: ConfigurationSearchPageComponent; - let fixture: ComponentFixture; - let searchConfigService: SearchConfigurationService; - let routeService: RouteService; - - beforeEach(waitForAsync(() => { - configureSearchComponentTestingModule(ConfigurationSearchPageComponent, [HostComponent]); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(HostComponent); - - // Set router url to a dummy value for SearchComponent#ngOnInit - spyOnProperty(TestBed.inject(Router), 'url', 'get').and.returnValue('some/url/here'); - - routeService = TestBed.inject(RouteService); - routeService.setParameter = createSpy('setParameter'); - routeService.getRouteParameterValue = createSpy('getRouteParameterValue').and.returnValue(of(CONFIGURATION)); - - fixture.detectChanges(); - - comp = fixture.componentInstance.configurationSearchPage; - searchConfigService = (comp as any).searchConfigService; - }); - - it('should set route parameters on init', () => { - expect(comp.configuration).toBe(CONFIGURATION); - expect(comp.fixedFilterQuery).toBe(QUERY); - - expect(routeService.setParameter).toHaveBeenCalledWith('configuration', CONFIGURATION); - expect(routeService.setParameter).toHaveBeenCalledWith('fixedFilterQuery', QUERY); - }); - -}); diff --git a/src/app/search-page/configuration-search-page.component.ts b/src/app/search-page/configuration-search-page.component.ts deleted file mode 100644 index 5458d9a1b4e..00000000000 --- a/src/app/search-page/configuration-search-page.component.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { - AsyncPipe, - NgTemplateOutlet, -} from '@angular/common'; -import { - ChangeDetectionStrategy, - Component, - Inject, - PLATFORM_ID, -} from '@angular/core'; -import { Router } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; - -import { - APP_CONFIG, - AppConfig, -} from '../../config/app-config.interface'; -import { RouteService } from '../core/services/route.service'; -import { SearchService } from '../core/shared/search/search.service'; -import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; -import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-configuration.service'; -import { pushInOut } from '../shared/animations/push'; -import { HostWindowService } from '../shared/host-window.service'; -import { SearchComponent } from '../shared/search/search.component'; -import { SearchLabelsComponent } from '../shared/search/search-labels/search-labels.component'; -import { ThemedSearchResultsComponent } from '../shared/search/search-results/themed-search-results.component'; -import { ThemedSearchSidebarComponent } from '../shared/search/search-sidebar/themed-search-sidebar.component'; -import { ThemedSearchFormComponent } from '../shared/search-form/themed-search-form.component'; -import { PageWithSidebarComponent } from '../shared/sidebar/page-with-sidebar.component'; -import { SidebarService } from '../shared/sidebar/sidebar.service'; -import { ViewModeSwitchComponent } from '../shared/view-mode-switch/view-mode-switch.component'; - -/** - * This component renders a search page using a configuration as input. - */ -@Component({ - selector: 'ds-base-configuration-search-page', - styleUrls: ['../shared/search/search.component.scss'], - templateUrl: '../shared/search/search.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - animations: [pushInOut], - providers: [ - { - provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService, - }, - ], - standalone: true, - imports: [ - AsyncPipe, - NgTemplateOutlet, - PageWithSidebarComponent, - SearchLabelsComponent, - ThemedSearchFormComponent, - ThemedSearchResultsComponent, - ThemedSearchSidebarComponent, - TranslateModule, - ViewModeSwitchComponent, - ], -}) - -export class ConfigurationSearchPageComponent extends SearchComponent { - constructor(protected service: SearchService, - protected sidebarService: SidebarService, - protected windowService: HostWindowService, - @Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService, - protected routeService: RouteService, - protected router: Router, - @Inject(APP_CONFIG) protected appConfig: AppConfig, - @Inject(PLATFORM_ID) public platformId: any, - ) { - super(service, sidebarService, windowService, searchConfigService, routeService, router, appConfig, platformId); - } -} diff --git a/src/app/search-page/configuration-search-page.guard.ts b/src/app/search-page/configuration-search-page.guard.ts deleted file mode 100644 index ec032bd04a4..00000000000 --- a/src/app/search-page/configuration-search-page.guard.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { - ActivatedRouteSnapshot, - CanActivateFn, - RouterStateSnapshot, -} from '@angular/router'; - -/** - * Assemble the correct i18n key for the configuration search page's title depending on the current route's configuration parameter. - * The format of the key will be "{configuration}.search.title" with: - * - configuration: The current configuration stored in route.params - */ -export const configurationSearchPageGuard: CanActivateFn = ( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot, -): boolean => { - const configuration = route.params.configuration; - - const newTitle = `${configuration}.search.title`; - - route.data = { title: newTitle }; - return true; -}; diff --git a/src/app/search-page/search-page-routes.ts b/src/app/search-page/search-page-routes.ts index 329c09d185a..756ec098cec 100644 --- a/src/app/search-page/search-page-routes.ts +++ b/src/app/search-page/search-page-routes.ts @@ -1,8 +1,6 @@ import { Route } from '@angular/router'; import { i18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { configurationSearchPageGuard } from './configuration-search-page.guard'; -import { ThemedConfigurationSearchPageComponent } from './themed-configuration-search-page.component'; import { ThemedSearchPageComponent } from './themed-search-page.component'; export const ROUTES: Route[] = [{ @@ -10,10 +8,5 @@ export const ROUTES: Route[] = [{ resolve: { breadcrumb: i18nBreadcrumbResolver }, data: { title: 'search.title', breadcrumbKey: 'search' }, children: [ { path: '', component: ThemedSearchPageComponent }, - { - path: ':configuration', - component: ThemedConfigurationSearchPageComponent, - canActivate: [configurationSearchPageGuard], - }, ], }]; diff --git a/src/app/search-page/themed-configuration-search-page.component.ts b/src/app/search-page/themed-configuration-search-page.component.ts deleted file mode 100644 index a455ddf5fe8..00000000000 --- a/src/app/search-page/themed-configuration-search-page.component.ts +++ /dev/null @@ -1,189 +0,0 @@ -import { - Component, - Input, -} from '@angular/core'; - -import { Context } from '../core/shared/context.model'; -import { ViewMode } from '../core/shared/view-mode.model'; -import { CollectionElementLinkType } from '../shared/object-collection/collection-element-link.type'; -import { SelectionConfig } from '../shared/search/search-results/search-results.component'; -import { SearchConfigurationOption } from '../shared/search/search-switch-configuration/search-configuration-option.model'; -import { ThemedComponent } from '../shared/theme-support/themed.component'; -import { ConfigurationSearchPageComponent } from './configuration-search-page.component'; - -/** - * Themed wrapper for ConfigurationSearchPageComponent - */ -@Component({ - selector: 'ds-configuration-search-page', - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true, - imports: [ - ConfigurationSearchPageComponent, - ], -}) -export class ThemedConfigurationSearchPageComponent extends ThemedComponent { - /** - * The list of available configuration options - */ - @Input() configurationList: SearchConfigurationOption[]; - - /** - * The current context - * If empty, 'search' is used - */ - @Input() context: Context; - - /** - * The configuration to use for the search options - * If empty, 'default' is used - */ - @Input() configuration: string; - - /** - * The actual query for the fixed filter. - * If empty, the query will be determined by the route parameter called 'filter' - */ - @Input() fixedFilterQuery: string; - - /** - * If this is true, the request will only be sent if there's - * no valid cached version. Defaults to true - */ - @Input() useCachedVersionIfAvailable: boolean; - - /** - * True when the search component should show results on the current page - */ - @Input() inPlaceSearch: boolean; - - /** - * The link type of the listed search results - */ - @Input() linkType: CollectionElementLinkType; - - /** - * The pagination id used in the search - */ - @Input() paginationId: string; - - /** - * Whether or not the search bar should be visible - */ - @Input() searchEnabled: boolean; - - /** - * The width of the sidebar (bootstrap columns) - */ - @Input() sideBarWidth: number; - - /** - * The placeholder of the search form input - */ - @Input() searchFormPlaceholder: string; - - /** - * A boolean representing if result entries are selectable - */ - @Input() selectable: boolean; - - /** - * The config option used for selection functionality - */ - @Input() selectionConfig: SelectionConfig; - - /** - * A boolean representing if show csv export button - */ - @Input() showCsvExport: boolean; - - /** - * A boolean representing if show search sidebar button - */ - @Input() showSidebar: boolean; - - /** - * Whether to show the thumbnail preview - */ - @Input() showThumbnails: boolean; - - /** - * Whether to show the view mode switch - */ - @Input() showViewModes: boolean; - - /** - * List of available view mode - */ - @Input() useUniquePageId: boolean; - - /** - * List of available view mode - */ - @Input() viewModeList: ViewMode[]; - - /** - * Defines whether or not to show the scope selector - */ - @Input() showScopeSelector: boolean; - - /** - * Whether or not to track search statistics by sending updates to the rest api - */ - @Input() trackStatistics: boolean; - - /** - * The default value for the search query when none is already defined in the {@link SearchConfigurationService} - */ - @Input() query: string; - - /** - * The fallback scope when no scope is defined in the url, if this is also undefined no scope will be set - */ - @Input() scope: string; - - /** - * Hides the scope in the url, this can be useful when you hardcode the scope in another way - */ - @Input() hideScopeInUrl: boolean; - - protected inAndOutputNames: (keyof ConfigurationSearchPageComponent & keyof this)[] = [ - 'configurationList', - 'context', - 'configuration', - 'fixedFilterQuery', - 'useCachedVersionIfAvailable', - 'inPlaceSearch', - 'linkType', - 'paginationId', - 'searchEnabled', - 'sideBarWidth', - 'searchFormPlaceholder', - 'selectable', - 'selectionConfig', - 'showCsvExport', - 'showSidebar', - 'showThumbnails', - 'showViewModes', - 'useUniquePageId', - 'viewModeList', - 'showScopeSelector', - 'trackStatistics', - 'query', - 'scope', - 'hideScopeInUrl', - ]; - - protected getComponentName(): string { - return 'ConfigurationSearchPageComponent'; - } - - protected importThemedComponent(themeName: string): Promise { - return import(`../../themes/${themeName}/app/search-page/configuration-search-page.component`); - } - - protected importUnthemedComponent(): Promise { - return import('./configuration-search-page.component'); - } - -} diff --git a/src/app/shared/search-form/search-form.component.ts b/src/app/shared/search-form/search-form.component.ts index 700e3eb691f..f85beded9ea 100644 --- a/src/app/shared/search-form/search-form.component.ts +++ b/src/app/shared/search-form/search-form.component.ts @@ -1,7 +1,7 @@ import { AsyncPipe } from '@angular/common'; import { Component, - EventEmitter, + EventEmitter, Inject, Input, OnChanges, Output, @@ -31,6 +31,7 @@ import { import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; import { currentPath } from '../utils/route.utils'; import { ScopeSelectorModalComponent } from './scope-selector-modal/scope-selector-modal.component'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; @Component({ selector: 'ds-base-search-form', @@ -104,7 +105,7 @@ export class SearchFormComponent implements OnChanges { protected searchService: SearchService, protected searchFilterService: SearchFilterService, protected paginationService: PaginationService, - protected searchConfig: SearchConfigurationService, + @Inject(SEARCH_CONFIG_SERVICE) protected searchConfig: SearchConfigurationService, protected modalService: NgbModal, protected dsoService: DSpaceObjectDataService, public dsoNameService: DSONameService, diff --git a/src/app/shared/search/models/discovery-configuration.model.ts b/src/app/shared/search/models/discovery-configuration.model.ts new file mode 100644 index 00000000000..5382a2a3d58 --- /dev/null +++ b/src/app/shared/search/models/discovery-configuration.model.ts @@ -0,0 +1,50 @@ +import { + autoserialize, + deserialize, +} from 'cerialize'; + +import { link, typedObject } from '../../../core/cache/builders/build-decorators'; +import { CacheableObject } from '../../../core/cache/cacheable-object.model'; +import { HALLink } from '../../../core/shared/hal-link.model'; +import { excludeFromEquals } from '../../../core/utilities/equals.decorators'; +import { DISCOVERY_CONFIGURATION } from './types/discovery-configuration.resource-type'; +import { ResourceType } from '../../../core/shared/resource-type'; +import { SEARCH_FILTER_CONFIG } from './types/search-filter-config.resource-type'; +import { Observable } from 'rxjs'; +import { RemoteData } from '../../../core/data/remote-data'; +import { PaginatedList } from '../../../core/data/paginated-list.model'; +import { SearchFilterConfig } from './search-filter-config.model'; +import { SEARCH_SORT_OPTION } from './types/search-sort-option.resource-type'; +import { SearchSortOption } from './search-sort-option.model'; + +/** + * Model representing a Discovery configuration from the REST API + */ +@typedObject +export class DiscoveryConfiguration implements CacheableObject { + static type = DISCOVERY_CONFIGURATION; + + @excludeFromEquals + @autoserialize + type: ResourceType; + + @autoserialize + id: string; + + @deserialize + _links: { + self: HALLink; + searchfilters?: HALLink; + sortoptions?: HALLink; + defaultsortoption?: HALLink; + }; + + @link(SEARCH_FILTER_CONFIG, true) + searchfilters?: Observable>>; + + @link(SEARCH_SORT_OPTION, true) + sortoptions?: Observable>>; + + @link(SEARCH_SORT_OPTION) + defaultsortoption?: Observable>; +} diff --git a/src/app/shared/search/models/facet.model.ts b/src/app/shared/search/models/facet.model.ts new file mode 100644 index 00000000000..9b6158041e9 --- /dev/null +++ b/src/app/shared/search/models/facet.model.ts @@ -0,0 +1,53 @@ +import { typedObject } from '../../../core/cache/builders/build-decorators'; +import { CacheableObject } from '../../../core/cache/cacheable-object.model'; +import { FACET } from './types/facet.resource-type'; +import { excludeFromEquals } from '../../../core/utilities/equals.decorators'; +import { autoserialize, autoserializeAs, deserialize } from 'cerialize'; +import { ResourceType } from '../../../core/shared/resource-type'; +import { FilterType } from './filter-type.model'; +import { HALLink } from '../../../core/shared/hal-link.model'; + +/** + * The configuration for a discovery facet + */ +@typedObject +export class Facet implements CacheableObject { + static type = FACET; + + @excludeFromEquals + @autoserialize + type: ResourceType; + + @autoserialize + name: string; + + @autoserialize + id: string; + + @autoserializeAs(String) + facetType: FilterType; + + @autoserialize + facetLimit: number; + + /** + * Minimum value possible for this facet in the repository + */ + @autoserialize + maxValue: string; + + /** + * Maximum value possible for this facet in the repository + */ + @autoserialize + minValue: string; + + @autoserializeAs(Boolean, 'openByDefault') + isOpenByDefault: boolean; + + @deserialize + _links: { + self: HALLink; + values: HALLink; + }; +} diff --git a/src/app/shared/search/models/search-filter-config.model.ts b/src/app/shared/search/models/search-filter-config.model.ts index 5ec6b0720fb..6ffd72c8e9e 100644 --- a/src/app/shared/search/models/search-filter-config.model.ts +++ b/src/app/shared/search/models/search-filter-config.model.ts @@ -10,6 +10,7 @@ import { HALLink } from '../../../core/shared/hal-link.model'; import { excludeFromEquals } from '../../../core/utilities/equals.decorators'; import { FilterType } from './filter-type.model'; import { SEARCH_FILTER_CONFIG } from './types/search-filter-config.resource-type'; +import { SearchFilterOperator } from './search-filter-operator.model'; /** * The configuration for a search filter @@ -18,68 +19,77 @@ import { SEARCH_FILTER_CONFIG } from './types/search-filter-config.resource-type export class SearchFilterConfig implements CacheableObject { static type = SEARCH_FILTER_CONFIG; - /** - * The object type, - * hardcoded because rest doesn't set one. - */ - @excludeFromEquals - type = SEARCH_FILTER_CONFIG; + /** + * The object type, + * hardcoded because rest doesn't set one. + */ + @excludeFromEquals + @autoserialize + type = SEARCH_FILTER_CONFIG; - /** - * The name of this filter - */ - @autoserialize - name: string; + /** + * The name of this filter + */ + @autoserializeAs(String, 'filter') + name: string; - /** - * The FilterType of this filter - */ - @autoserializeAs(String, 'facetType') - filterType: FilterType; + @autoserialize + filter: string; - /** - * True if the filter has facets - */ - @autoserialize - hasFacets: boolean; + /** + * The FilterType of this filter + */ + @autoserializeAs(String) + filterType: FilterType; - /** - * @type {number} The page size used for this facet - */ - @autoserializeAs(String, 'facetLimit') - pageSize = 5; + /** + * True if the filter has facets + */ + @autoserialize + hasFacets: boolean; - /** - * Defines if the item facet is collapsed by default or not on the search page - */ - @autoserializeAs(Boolean, 'openByDefault') - isOpenByDefault: boolean; + /** + * @type {number} The page size used for this facet + */ + @autoserialize + pageSize = 5; - /** - * Minimum value possible for this facet in the repository - */ - @autoserialize - maxValue: string; + @autoserialize + operators: SearchFilterOperator[]; - /** - * Maximum value possible for this facet in the repository - */ - @autoserialize - minValue: string; + /** + * Defines if the item facet is collapsed by default or not on the search page + */ + @autoserializeAs(Boolean, 'openByDefault') + isOpenByDefault: boolean; - /** - * The {@link HALLink}s for this SearchFilterConfig - */ - @deserialize - _links: { - self: HALLink; - }; + /** + * Minimum value possible for this facet in the repository + */ + // TODO: This was moved to the Facet response + @autoserialize + maxValue: string; - /** - * Name of this configuration that can be used in a url - * @returns Parameter name - */ - get paramName(): string { - return 'f.' + this.name; - } + /** + * Maximum value possible for this facet in the repository + */ + // TODO: This was moved to the Facet response + @autoserialize + minValue: string; + + /** + * The {@link HALLink}s for this SearchFilterConfig + */ + @deserialize + _links: { + self: HALLink; + }; + + /** + * Name of this configuration that can be used in a url + * @returns Parameter name + */ + get paramName(): string { + return 'f.' + this.filter; + } } diff --git a/src/app/shared/search/models/search-filter-operator.model.ts b/src/app/shared/search/models/search-filter-operator.model.ts new file mode 100644 index 00000000000..1205afa6d5f --- /dev/null +++ b/src/app/shared/search/models/search-filter-operator.model.ts @@ -0,0 +1,6 @@ +import { autoserialize } from 'cerialize'; + +export class SearchFilterOperator { + @autoserialize + operator: string; +} diff --git a/src/app/shared/search/models/search-sort-option.model.ts b/src/app/shared/search/models/search-sort-option.model.ts new file mode 100644 index 00000000000..690ef8e431d --- /dev/null +++ b/src/app/shared/search/models/search-sort-option.model.ts @@ -0,0 +1,20 @@ +import { typedObject } from '../../../core/cache/builders/build-decorators'; +import { SEARCH_SORT_OPTION } from './types/search-sort-option.resource-type'; +import { excludeFromEquals } from '../../../core/utilities/equals.decorators'; +import { autoserialize } from 'cerialize'; +import { ResourceType } from '../../../core/shared/resource-type'; + +@typedObject +export class SearchSortOption { + static type = SEARCH_SORT_OPTION; + + @excludeFromEquals + @autoserialize + type: ResourceType; + + @autoserialize + name: string; + + @autoserialize + sortOrder: string; +} diff --git a/src/app/shared/search/models/types/discovery-configuration.resource-type.ts b/src/app/shared/search/models/types/discovery-configuration.resource-type.ts new file mode 100644 index 00000000000..2364e31f4af --- /dev/null +++ b/src/app/shared/search/models/types/discovery-configuration.resource-type.ts @@ -0,0 +1,6 @@ +import { ResourceType } from '../../../../core/shared/resource-type'; + +/** + * The resource type for DiscoveryConfiguration + */ +export const DISCOVERY_CONFIGURATION = new ResourceType('discoveryconfiguration'); diff --git a/src/app/shared/search/models/types/facet.resource-type.ts b/src/app/shared/search/models/types/facet.resource-type.ts new file mode 100644 index 00000000000..851598743a6 --- /dev/null +++ b/src/app/shared/search/models/types/facet.resource-type.ts @@ -0,0 +1,9 @@ +import { ResourceType } from '../../../../core/shared/resource-type'; + +/** + * The resource type for Facet + * + * Needs to be in a separate file to prevent circular + * dependencies in webpack. + */ +export const FACET = new ResourceType('facet'); diff --git a/src/app/shared/search/models/types/search-filter-config.resource-type.ts b/src/app/shared/search/models/types/search-filter-config.resource-type.ts index eb7521b8dfc..6df9b0a7451 100644 --- a/src/app/shared/search/models/types/search-filter-config.resource-type.ts +++ b/src/app/shared/search/models/types/search-filter-config.resource-type.ts @@ -6,4 +6,4 @@ import { ResourceType } from '../../../../core/shared/resource-type'; * Needs to be in a separate file to prevent circular * dependencies in webpack. */ -export const SEARCH_FILTER_CONFIG = new ResourceType('discovery-filter'); +export const SEARCH_FILTER_CONFIG = new ResourceType('searchfilter'); diff --git a/src/app/shared/search/models/types/search-objects.resource-type.ts b/src/app/shared/search/models/types/search-objects.resource-type.ts index 650b02f0058..5a85a3abcc7 100644 --- a/src/app/shared/search/models/types/search-objects.resource-type.ts +++ b/src/app/shared/search/models/types/search-objects.resource-type.ts @@ -6,4 +6,4 @@ import { ResourceType } from '../../../../core/shared/resource-type'; * Needs to be in a separate file to prevent circular * dependencies in webpack. */ -export const SEARCH_OBJECTS = new ResourceType('discovery-objects'); +export const SEARCH_OBJECTS = new ResourceType('searchresult'); diff --git a/src/app/shared/search/models/types/search-sort-option.resource-type.ts b/src/app/shared/search/models/types/search-sort-option.resource-type.ts new file mode 100644 index 00000000000..1f38e9b21f0 --- /dev/null +++ b/src/app/shared/search/models/types/search-sort-option.resource-type.ts @@ -0,0 +1,9 @@ +import { ResourceType } from '../../../../core/shared/resource-type'; + +/** + * The resource type for Facet + * + * Needs to be in a separate file to prevent circular + * dependencies in webpack. + */ +export const SEARCH_SORT_OPTION = new ResourceType('sortoption'); diff --git a/src/app/shared/search/search-results/search-results.component.ts b/src/app/shared/search/search-results/search-results.component.ts index 421f361bc00..5c620b82d5f 100644 --- a/src/app/shared/search/search-results/search-results.component.ts +++ b/src/app/shared/search/search-results/search-results.component.ts @@ -1,7 +1,7 @@ import { AsyncPipe } from '@angular/common'; import { Component, - EventEmitter, + EventEmitter, Inject, Input, Output, } from '@angular/core'; @@ -39,6 +39,7 @@ import { SearchFilter } from '../models/search-filter.model'; import { SearchResult } from '../models/search-result.model'; import { SearchExportCsvComponent } from '../search-export-csv/search-export-csv.component'; import { SearchResultsSkeletonComponent } from './search-results-skeleton/search-results-skeleton.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; export interface SelectionConfig { repeatable: boolean; @@ -154,7 +155,7 @@ export class SearchResultsComponent { @Output() selectObject: EventEmitter = new EventEmitter(); constructor( - protected searchConfigService: SearchConfigurationService, + @Inject(SEARCH_CONFIG_SERVICE) protected searchConfigService: SearchConfigurationService, protected searchService: SearchService, ) { this.activeFilters$ = this.searchConfigService.getCurrentFilters(); 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 2aa69a14837..7dbebc3469c 100644 --- a/src/app/shared/search/search-sidebar/search-sidebar.component.ts +++ b/src/app/shared/search/search-sidebar/search-sidebar.component.ts @@ -31,6 +31,7 @@ import { ThemedSearchFiltersComponent } from '../search-filters/themed-search-fi import { ThemedSearchSettingsComponent } from '../search-settings/themed-search-settings.component'; import { SearchConfigurationOption } from '../search-switch-configuration/search-configuration-option.model'; import { SearchSwitchConfigurationComponent } from '../search-switch-configuration/search-switch-configuration.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; /** * This component renders a simple item page. @@ -138,7 +139,7 @@ export class SearchSidebarComponent implements OnInit { constructor( @Inject(APP_CONFIG) protected appConfig: AppConfig, - protected searchConfigurationService: SearchConfigurationService, + @Inject(SEARCH_CONFIG_SERVICE) protected searchConfigurationService: SearchConfigurationService, ) { } diff --git a/src/app/shared/search/services/discovery-configuration.data.service.ts b/src/app/shared/search/services/discovery-configuration.data.service.ts new file mode 100644 index 00000000000..08c092aeae5 --- /dev/null +++ b/src/app/shared/search/services/discovery-configuration.data.service.ts @@ -0,0 +1,31 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +import { Injectable } from '@angular/core'; +import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service'; +import { ObjectCacheService } from '../../../core/cache/object-cache.service'; +import { IdentifiableDataService } from '../../../core/data/base/identifiable-data.service'; +import { RequestService } from '../../../core/data/request.service'; +import { HALEndpointService } from '../../../core/shared/hal-endpoint.service'; +import { DiscoveryConfiguration } from '../models/discovery-configuration.model'; + +/** + * Data service for retrieving Discovery configurations from the REST API. + */ +@Injectable({ providedIn: 'root' }) +export class DiscoveryConfigurationDataService extends IdentifiableDataService { + + constructor( + protected requestService: RequestService, + protected rdbService: RemoteDataBuildService, + protected objectCache: ObjectCacheService, + protected halService: HALEndpointService, + ) { + super('discoveryconfigurations', requestService, rdbService, objectCache, halService); + } + +} diff --git a/src/app/shared/search/services/search-facet.data.service.ts b/src/app/shared/search/services/search-facet.data.service.ts new file mode 100644 index 00000000000..9934b6ea877 --- /dev/null +++ b/src/app/shared/search/services/search-facet.data.service.ts @@ -0,0 +1,43 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +import { Injectable } from '@angular/core'; +import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service'; +import { ObjectCacheService } from '../../../core/cache/object-cache.service'; +import { FindAllData, FindAllDataImpl } from '../../../core/data/base/find-all-data'; +import { IdentifiableDataService } from '../../../core/data/base/identifiable-data.service'; +import { RequestService } from '../../../core/data/request.service'; +import { HALEndpointService } from '../../../core/shared/hal-endpoint.service'; +import { Facet } from '../models/facet.model'; +import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { Observable } from 'rxjs'; +import { RemoteData } from '../../../core/data/remote-data'; +import { PaginatedList } from '../../../core/data/paginated-list.model'; + +/** + * Data service for retrieving search facets and facet values from the REST API. + */ +@Injectable({ providedIn: 'root' }) +export class SearchFacetDataService extends IdentifiableDataService implements FindAllData { + private findAllData: FindAllDataImpl; + + constructor( + protected requestService: RequestService, + protected rdbService: RemoteDataBuildService, + protected objectCache: ObjectCacheService, + protected halService: HALEndpointService, + ) { + super('facets', requestService, rdbService, objectCache, halService); + + this.findAllData = new FindAllDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, this.responseMsToLive); + } + + findAll(options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow): Observable>> { + return this.findAllData.findAll(options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + } + +} diff --git a/src/app/shared/search/services/search-results.data.service.ts b/src/app/shared/search/services/search-results.data.service.ts new file mode 100644 index 00000000000..21ed8b1ce10 --- /dev/null +++ b/src/app/shared/search/services/search-results.data.service.ts @@ -0,0 +1,81 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +import { Injectable } from '@angular/core'; +import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service'; +import { ObjectCacheService } from '../../../core/cache/object-cache.service'; +import { RequestService } from '../../../core/data/request.service'; +import { BaseDataService } from '../../../core/data/base/base-data.service'; +import { HALEndpointService } from '../../../core/shared/hal-endpoint.service'; +import { DSpaceObject } from '../../../core/shared/dspace-object.model'; +import { SearchResult } from '../models/search-result.model'; +import { SearchDataImpl } from '../../../core/data/base/search-data'; +import { Observable, of } from 'rxjs'; +import { RemoteData } from '../../../core/data/remote-data'; +import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { SearchObjects } from '../models/search-objects.model'; +import { hasValue, isNotEmpty, isNotEmptyOperator } from '../../empty.util'; +import { take } from 'rxjs/operators'; +import { GetRequest } from '../../../core/data/request.models'; +import { GenericConstructor } from '../../../core/shared/generic-constructor'; +import { ResponseParsingService } from '../../../core/data/parsing.service'; +import { SearchResponseParsingService } from '../../../core/data/search-response-parsing.service'; + +class SearchResultsSearchDataImpl extends SearchDataImpl> { + private parser: GenericConstructor = SearchResponseParsingService; + + protected createAndSendGetRequest(href$: string | Observable, useCachedVersionIfAvailable = true): void { + if (isNotEmpty(href$)) { + if (typeof href$ === 'string') { + href$ = of(href$); + } + + href$.pipe( + isNotEmptyOperator(), + take(1), + ).subscribe((href: string) => { + const requestId = this.requestService.generateRequestId(); + const getResponseParserFn: () => GenericConstructor = () => { + return this.parser; + }; + + const request: GetRequest = Object.assign(new GetRequest(requestId, href), { + getResponseParser: getResponseParserFn, + }); + + if (hasValue(this.responseMsToLive)) { + request.responseMsToLive = this.responseMsToLive; + } + this.requestService.send(request, useCachedVersionIfAvailable); + }); + } + } +} + +/** + * Data service for retrieving search results from the REST API. + */ +@Injectable({ providedIn: 'root' }) +export class SearchResultsDataService extends BaseDataService> { + private searchData: SearchDataImpl>; + + constructor( + protected requestService: RequestService, + protected rdbService: RemoteDataBuildService, + protected objectCache: ObjectCacheService, + protected halService: HALEndpointService, + ) { + super('searchresults', requestService, rdbService, objectCache, halService); + + this.searchData = new SearchResultsSearchDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, this.responseMsToLive); + } + + searchObjects(options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow): Observable>> { + return this.searchData.searchBy('objects', options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow) as Observable>>; + } + +} diff --git a/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts b/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts index b844c41c641..4584a4fd368 100644 --- a/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts +++ b/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { AdminSearchPageComponent as BaseComponent } from '../../../../../app/admin/admin-search-page/admin-search-page.component'; -import { ThemedConfigurationSearchPageComponent } from '../../../../../app/search-page/themed-configuration-search-page.component'; +import { ThemedSearchComponent } from '../../../../../app/shared/search/themed-search.component'; @Component({ selector: 'ds-themed-admin-search-page', @@ -11,7 +11,7 @@ import { ThemedConfigurationSearchPageComponent } from '../../../../../app/searc templateUrl: '../../../../../app/admin/admin-search-page/admin-search-page.component.html', standalone: true, imports: [ - ThemedConfigurationSearchPageComponent, + ThemedSearchComponent, ], }) export class AdminSearchPageComponent extends BaseComponent { diff --git a/src/themes/custom/app/admin/admin-workflow-page/admin-workflow-page.component.ts b/src/themes/custom/app/admin/admin-workflow-page/admin-workflow-page.component.ts index b337d8dbb4a..35d740e7575 100644 --- a/src/themes/custom/app/admin/admin-workflow-page/admin-workflow-page.component.ts +++ b/src/themes/custom/app/admin/admin-workflow-page/admin-workflow-page.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { AdminWorkflowPageComponent as BaseComponent } from '../../../../../app/admin/admin-workflow-page/admin-workflow-page.component'; -import { ThemedConfigurationSearchPageComponent } from '../../../../../app/search-page/themed-configuration-search-page.component'; +import { ThemedSearchComponent } from '../../../../../app/shared/search/themed-search.component'; @Component({ selector: 'ds-themed-admin-workflow-page', @@ -11,7 +11,7 @@ import { ThemedConfigurationSearchPageComponent } from '../../../../../app/searc templateUrl: '../../../../../app/admin/admin-workflow-page/admin-workflow-page.component.html', standalone: true, imports: [ - ThemedConfigurationSearchPageComponent, + ThemedSearchComponent, ], }) export class AdminWorkflowPageComponent extends BaseComponent { diff --git a/src/themes/custom/app/home-page/home-page.component.ts b/src/themes/custom/app/home-page/home-page.component.ts index 754f6feb276..78e12e4fbf0 100644 --- a/src/themes/custom/app/home-page/home-page.component.ts +++ b/src/themes/custom/app/home-page/home-page.component.ts @@ -11,8 +11,10 @@ import { HomePageComponent as BaseComponent } from '../../../../app/home-page/ho import { RecentItemListComponent } from '../../../../app/home-page/recent-item-list/recent-item-list.component'; import { ThemedTopLevelCommunityListComponent } from '../../../../app/home-page/top-level-community-list/themed-top-level-community-list.component'; import { SuggestionsPopupComponent } from '../../../../app/notifications/suggestions/popup/suggestions-popup.component'; -import { ThemedConfigurationSearchPageComponent } from '../../../../app/search-page/themed-configuration-search-page.component'; import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/themed-search-form.component'; +import { ThemedSearchComponent } from '../../../../app/shared/search/themed-search.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../app/my-dspace-page/my-dspace-configuration.service'; +import { SearchConfigurationService } from '../../../../app/core/shared/search/search-configuration.service'; @Component({ selector: 'ds-themed-home-page', @@ -20,6 +22,12 @@ import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/th styleUrls: ['../../../../app/home-page/home-page.component.scss'], // templateUrl: './home-page.component.html' templateUrl: '../../../../app/home-page/home-page.component.html', + providers: [ + { + provide: SEARCH_CONFIG_SERVICE, + useClass: SearchConfigurationService, + }, + ], standalone: true, imports: [ AsyncPipe, @@ -27,11 +35,11 @@ import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/th NgTemplateOutlet, RecentItemListComponent, SuggestionsPopupComponent, - ThemedConfigurationSearchPageComponent, ThemedHomeNewsComponent, ThemedSearchFormComponent, ThemedTopLevelCommunityListComponent, TranslateModule, + ThemedSearchComponent, ], }) export class HomePageComponent extends BaseComponent { diff --git a/src/themes/custom/app/search-page/configuration-search-page.component.html b/src/themes/custom/app/search-page/configuration-search-page.component.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/themes/custom/app/search-page/configuration-search-page.component.scss b/src/themes/custom/app/search-page/configuration-search-page.component.scss deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/themes/custom/app/search-page/configuration-search-page.component.ts b/src/themes/custom/app/search-page/configuration-search-page.component.ts deleted file mode 100644 index 5470c56c0cf..00000000000 --- a/src/themes/custom/app/search-page/configuration-search-page.component.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { - AsyncPipe, - NgTemplateOutlet, -} from '@angular/common'; -import { - ChangeDetectionStrategy, - Component, -} from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; - -import { SearchConfigurationService } from '../../../../app/core/shared/search/search-configuration.service'; -import { SEARCH_CONFIG_SERVICE } from '../../../../app/my-dspace-page/my-dspace-configuration.service'; -import { ConfigurationSearchPageComponent as BaseComponent } from '../../../../app/search-page/configuration-search-page.component'; -import { pushInOut } from '../../../../app/shared/animations/push'; -import { SearchLabelsComponent } from '../../../../app/shared/search/search-labels/search-labels.component'; -import { ThemedSearchResultsComponent } from '../../../../app/shared/search/search-results/themed-search-results.component'; -import { ThemedSearchSidebarComponent } from '../../../../app/shared/search/search-sidebar/themed-search-sidebar.component'; -import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/themed-search-form.component'; -import { PageWithSidebarComponent } from '../../../../app/shared/sidebar/page-with-sidebar.component'; -import { ViewModeSwitchComponent } from '../../../../app/shared/view-mode-switch/view-mode-switch.component'; - -@Component({ - selector: 'ds-themed-configuration-search-page', - // styleUrls: ['./configuration-search-page.component.scss'], - styleUrls: ['../../../../app/shared/search/search.component.scss'], - // templateUrl: './configuration-search-page.component.html' - templateUrl: '../../../../app/shared/search/search.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - animations: [pushInOut], - providers: [ - { - provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService, - }, - ], - standalone: true, - imports: [ - AsyncPipe, - NgTemplateOutlet, - PageWithSidebarComponent, - SearchLabelsComponent, - ThemedSearchFormComponent, - ThemedSearchResultsComponent, - ThemedSearchSidebarComponent, - TranslateModule, - ViewModeSwitchComponent, - ], -}) -export class ConfigurationSearchPageComponent extends BaseComponent { -} diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index bc8e9ed07c7..ba06d6f67cb 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -68,7 +68,6 @@ import { DenyRequestCopyComponent } from './app/request-copy/deny-request-copy/d import { EmailRequestCopyComponent } from './app/request-copy/email-request-copy/email-request-copy.component'; import { GrantRequestCopyComponent } from './app/request-copy/grant-request-copy/grant-request-copy.component'; import { RootComponent } from './app/root/root.component'; -import { ConfigurationSearchPageComponent } from './app/search-page/configuration-search-page.component'; import { SearchPageComponent } from './app/search-page/search-page.component'; import { AuthNavMenuComponent } from './app/shared/auth-nav-menu/auth-nav-menu.component'; import { UserMenuComponent } from './app/shared/auth-nav-menu/user-menu/user-menu.component'; @@ -118,7 +117,6 @@ const DECLARATIONS = [ RootComponent, CommunityListPageComponent, SearchPageComponent, - ConfigurationSearchPageComponent, SearchFormComponent, EndUserAgreementComponent, PageNotFoundComponent,