diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts index 38cb9465c1..5766660399 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts @@ -27,7 +27,7 @@ import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-r styleUrls: ['./item-admin-search-result-grid-element.component.scss'], templateUrl: './item-admin-search-result-grid-element.component.html', standalone: true, - imports: [ItemAdminSearchResultActionsComponent] + imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective] }) /** * The component for displaying a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts index 76f3e33b48..92aa584816 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts @@ -20,9 +20,6 @@ import { import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; -import { -ListableObjectDirective -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.directive'; import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; @@ -64,14 +61,12 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => { TestBed.configureTestingModule( { imports: [ - ListableObjectDirective, WorkflowItemSearchResultAdminWorkflowGridElementComponent, ItemGridElementComponent, DynamicComponentLoaderDirective, NoopAnimationsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - ListableObjectDirective, ListableModule, WorkflowItemSearchResultAdminWorkflowGridElementComponent ], diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts index 572f6ab3a6..ed47aa395f 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts @@ -38,7 +38,7 @@ import { NgIf } from '@angular/common'; styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'], templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html', standalone: true, - imports: [NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule] + imports: [NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective] }) /** * The component for displaying a grid element for an workflow item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts index 65dd805a69..b2f89647f3 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts @@ -22,9 +22,6 @@ import { import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; -import { - ListableObjectDirective -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.directive'; import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; @@ -84,7 +81,6 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => { TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ListableModule, - ListableObjectDirective, WorkspaceItemSearchResultAdminWorkflowGridElementComponent ], providers: [ diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts index 6dff988261..1a0728b05b 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts @@ -1,4 +1,4 @@ -import { Component, ComponentFactoryResolver, ElementRef, OnInit, ViewChild, OnDestroy, ComponentRef } from '@angular/core'; +import { Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { BehaviorSubject, Observable } from 'rxjs'; import { map, mergeMap, take, tap } from 'rxjs/operators'; @@ -16,7 +16,9 @@ import { import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { GenericConstructor } from '../../../../../core/shared/generic-constructor'; -import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { + DynamicComponentLoaderDirective +} from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; @@ -38,7 +40,9 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service import { hasValue } from '../../../../../shared/empty.util'; import { TranslateModule } from '@ngx-translate/core'; import { AsyncPipe } from '@angular/common'; -import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/workspace-item/workspace-item-admin-workflow-actions.component'; +import { + WorkspaceItemAdminWorkflowActionsComponent +} from '../../actions/workspace-item/workspace-item-admin-workflow-actions.component'; @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.GridElement, Context.AdminWorkflowSearch) @Component({ @@ -46,7 +50,7 @@ import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/worksp styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'], templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html', standalone: true, - imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule] + imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective] }) /** * The component for displaying a grid element for an workflow item on the admin workflow search page diff --git a/src/app/browse-by/browse-by-date/browse-by-date.component.ts b/src/app/browse-by/browse-by-date/browse-by-date.component.ts index d6202145e7..d89be1de2b 100644 --- a/src/app/browse-by/browse-by-date/browse-by-date.component.ts +++ b/src/app/browse-by/browse-by-date/browse-by-date.component.ts @@ -34,8 +34,6 @@ import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; import { TranslateModule } from '@ngx-translate/core'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component'; -import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; -import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; import { StartsWithType } from '../../shared/starts-with/starts-with-type'; @Component({ @@ -64,7 +62,6 @@ import { StartsWithType } from '../../shared/starts-with/starts-with-type'; * A metadata definition (a.k.a. browse id) is a short term used to describe one or multiple metadata fields. * An example would be 'dateissued' for 'dc.date.issued' */ -@rendersBrowseBy(BrowseByDataType.Date) export class BrowseByDateComponent extends BrowseByMetadataComponent implements OnInit { /** diff --git a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts index 0df408d947..4c7ee1e80f 100644 --- a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts +++ b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts @@ -2,10 +2,10 @@ import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, - Subscription, - of as observableOf + of as observableOf, + Subscription } from 'rxjs'; -import { Component, Inject, OnInit, OnDestroy, Input, OnChanges } from '@angular/core'; +import { Component, Inject, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { RemoteData } from '../../core/data/remote-data'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; @@ -38,7 +38,6 @@ import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; import { TranslateModule } from '@ngx-translate/core'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component'; -import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; import { Context } from '../../core/shared/context.model'; import { StartsWithType } from '../../shared/starts-with/starts-with-type'; @@ -72,7 +71,6 @@ export const BBM_PAGINATION_ID = 'bbm'; * or multiple metadata fields. An example would be 'author' for * 'dc.contributor.*' */ -@rendersBrowseBy(BrowseByDataType.Metadata) export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy { /** diff --git a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts index 7549a62f19..b739a810dd 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts @@ -5,7 +5,9 @@ import { AbstractComponentLoaderComponent } from '../../shared/abstract-componen import { BrowseByDataType } from './browse-by-data-type'; import { Context } from '../../core/shared/context.model'; import { AsyncPipe, NgComponentOutlet } from '@angular/common'; -import { DynamicComponentLoaderDirective } from './dynamic-component-loader.directive'; +import { + DynamicComponentLoaderDirective +} from '../../shared/abstract-component-loader/dynamic-component-loader.directive'; @Component({ selector: 'ds-browse-by-switcher', diff --git a/src/app/browse-by/browse-by-switcher/dynamic-component-loader.directive.ts b/src/app/browse-by/browse-by-switcher/dynamic-component-loader.directive.ts deleted file mode 100644 index 49e7d4d698..0000000000 --- a/src/app/browse-by/browse-by-switcher/dynamic-component-loader.directive.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Directive, ViewContainerRef } from '@angular/core'; - -/** - * Directive used as a hook to know where to inject the dynamic loaded component - */ -@Directive({ - selector: '[dsDynamicComponentLoader]', - standalone: true -}) -export class DynamicComponentLoaderDirective { - - constructor( - public viewContainerRef: ViewContainerRef, - ) { - } - -} diff --git a/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts b/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts index 3f91136aea..357049fba5 100644 --- a/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts +++ b/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts @@ -4,7 +4,6 @@ import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models import { ActivatedRoute, Params, RouterLink } from '@angular/router'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { BrowseDefinition } from '../../core/shared/browse-definition.model'; -import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { map } from 'rxjs/operators'; import { HierarchicalBrowseDefinition } from '../../core/shared/hierarchical-browse-definition.model'; import { VocabularyTreeviewComponent } from '../../shared/form/vocabulary-treeview/vocabulary-treeview.component'; @@ -54,7 +53,6 @@ import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by /** * Component for browsing items by metadata in a hierarchical controlled vocabulary */ -@rendersBrowseBy(BrowseByDataType.Hierarchy) export class BrowseByTaxonomyComponent implements OnInit, OnChanges, OnDestroy { /** diff --git a/src/app/browse-by/browse-by-title/browse-by-title.component.ts b/src/app/browse-by/browse-by-title/browse-by-title.component.ts index ac732b6c2f..27d03017e2 100644 --- a/src/app/browse-by/browse-by-title/browse-by-title.component.ts +++ b/src/app/browse-by/browse-by-title/browse-by-title.component.ts @@ -3,13 +3,12 @@ import { Component, OnInit } from '@angular/core'; import { Params } from '@angular/router'; import { BrowseByMetadataComponent, - browseParamsToOptions, getBrowseSearchOptions + browseParamsToOptions, + getBrowseSearchOptions } from '../browse-by-metadata/browse-by-metadata.component'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; import { map } from 'rxjs/operators'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; -import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; import { VarDirective } from '../../shared/utils/var.directive'; import { AsyncPipe, NgIf } from '@angular/common'; import { ComcolPageHeaderComponent } from '../../shared/comcol/comcol-page-header/comcol-page-header.component'; @@ -51,7 +50,6 @@ import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by /** * Component for browsing items by title (dc.title) */ -@rendersBrowseBy(BrowseByDataType.Title) export class BrowseByTitleComponent extends BrowseByMetadataComponent implements OnInit { ngOnInit(): void { diff --git a/src/app/core/notifications/suggestions-data.service.ts b/src/app/core/notifications/suggestions-data.service.ts index 17b1482578..7acdc8b9eb 100644 --- a/src/app/core/notifications/suggestions-data.service.ts +++ b/src/app/core/notifications/suggestions-data.service.ts @@ -65,7 +65,7 @@ export class SuggestionDataServiceImpl extends UpdateDataServiceImpl /** * The service handling all Suggestion Target REST requests. */ -@Injectable() +@Injectable({ providedIn: 'root' }) @dataService(SUGGESTION) export class SuggestionsDataService { protected searchFindBySourceMethod = 'findBySource'; diff --git a/src/app/core/notifications/target/suggestion-target-data.service.ts b/src/app/core/notifications/target/suggestion-target-data.service.ts index a2f1507b10..b251be98d5 100644 --- a/src/app/core/notifications/target/suggestion-target-data.service.ts +++ b/src/app/core/notifications/target/suggestion-target-data.service.ts @@ -22,7 +22,7 @@ import { SearchData, SearchDataImpl } from '../../data/base/search-data'; import { DefaultChangeAnalyzer } from '../../data/default-change-analyzer.service'; import { SUGGESTION_TARGET } from '../models/suggestion-target-object.resource-type'; -@Injectable() +@Injectable({ providedIn: 'root' }) @dataService(SUGGESTION_TARGET) export class SuggestionTargetDataService extends IdentifiableDataService { diff --git a/src/app/notifications/suggestion-targets/suggestion-targets.state.service.ts b/src/app/notifications/suggestion-targets/suggestion-targets.state.service.ts index 1ca01b10f2..b99f38f76b 100644 --- a/src/app/notifications/suggestion-targets/suggestion-targets.state.service.ts +++ b/src/app/notifications/suggestion-targets/suggestion-targets.state.service.ts @@ -25,7 +25,7 @@ import { /** * The service handling the Suggestion targets State. */ -@Injectable() +@Injectable({providedIn: 'root'}) export class SuggestionTargetsStateService { /** diff --git a/src/app/notifications/suggestions.service.ts b/src/app/notifications/suggestions.service.ts index 2fa85a5671..98bf2d4f85 100644 --- a/src/app/notifications/suggestions.service.ts +++ b/src/app/notifications/suggestions.service.ts @@ -40,7 +40,7 @@ export interface SuggestionBulkResult { /** * The service handling all Suggestion Target requests to the REST service. */ -@Injectable() +@Injectable({providedIn: 'root'}) export class SuggestionsService { /** diff --git a/src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts b/src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts index 8c77df1cdb..c4bc228027 100644 --- a/src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts +++ b/src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts @@ -4,6 +4,7 @@ import { Directive, ViewContainerRef } from '@angular/core'; * Directive used as a hook to know where to inject the dynamic loaded component */ @Directive({ + standalone: true, selector: '[dsDynamicComponentLoader]' }) export class DynamicComponentLoaderDirective { diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts index 3cdf09dcfd..62b36e5873 100644 --- a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts +++ b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts @@ -50,7 +50,6 @@ describe('ListableObjectComponentLoaderComponent', () => { imports: [ TranslateModule.forRoot(), ListableObjectComponentLoaderComponent, - ListableObjectDirective, ListableModule, ItemListElementComponent, DynamicComponentLoaderDirective diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts index ed0a819575..38350a25c1 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts @@ -3,9 +3,18 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AdvancedWorkflowActionsLoaderComponent } from './advanced-workflow-actions-loader.component'; import { Router } from '@angular/router'; import { RouterStub } from '../../../shared/testing/router.stub'; -import { ChangeDetectionStrategy, Component, ComponentFactoryResolver, Directive, Injector, NO_ERRORS_SCHEMA, ViewContainerRef } from '@angular/core'; -import { AdvancedWorkflowActionsDirective } from './advanced-workflow-actions.directive'; -import { DynamicComponentLoaderDirective } from '../../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { + ChangeDetectionStrategy, + Component, + ComponentFactoryResolver, + Directive, + Injector, + NO_ERRORS_SCHEMA, + ViewContainerRef +} from '@angular/core'; +import { + DynamicComponentLoaderDirective +} from '../../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { rendersAdvancedWorkflowTaskOption } from '../../../shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator'; @@ -38,7 +47,6 @@ describe('AdvancedWorkflowActionsLoaderComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - AdvancedWorkflowActionsDirective, RouterTestingModule, DynamicComponentLoaderDirective, AdvancedWorkflowActionsLoaderComponent, diff --git a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts index b7a7e16f49..f658dc05c2 100644 --- a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { ThemedHeaderComponent } from '../../../../app/header/themed-header.component'; -import { AsyncPipe, NgClass } from '@angular/common'; +import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.component'; import { HeaderNavbarWrapperComponent as BaseComponent } from '../../../../app/header-nav-wrapper/header-navbar-wrapper.component'; import { slideMobileNav } from '../../../../app/shared/animations/slide'; @@ -14,7 +14,7 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['header-navbar-wrapper.component.scss'], templateUrl: 'header-navbar-wrapper.component.html', standalone: true, - imports: [NgClass, ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe, TranslateModule], + imports: [NgClass, ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe, TranslateModule, NgIf], animations: [slideMobileNav], }) export class HeaderNavbarWrapperComponent extends BaseComponent {