From be6dbdec66e6caf000c966a2e1e30f3acf199458 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Mon, 2 Oct 2023 13:31:25 +0200 Subject: [PATCH 001/285] 107155: Allow caching null objects --- src/app/core/cache/object-cache.reducer.ts | 31 +++++++++++-------- src/app/core/cache/object-cache.service.ts | 16 +++++++--- .../dspace-rest-response-parsing.service.ts | 7 +++-- src/app/core/index/index.effects.ts | 4 +-- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/app/core/cache/object-cache.reducer.ts b/src/app/core/cache/object-cache.reducer.ts index dc3f50db68..7f389344fb 100644 --- a/src/app/core/cache/object-cache.reducer.ts +++ b/src/app/core/cache/object-cache.reducer.ts @@ -166,20 +166,25 @@ export function objectCacheReducer(state = initialState, action: ObjectCacheActi * the new state, with the object added, or overwritten. */ function addToObjectCache(state: ObjectCacheState, action: AddToObjectCacheAction): ObjectCacheState { - const existing = state[action.payload.objectToCache._links.self.href] || {} as any; + const cacheLink = hasValue(action.payload.objectToCache) ? action.payload.objectToCache._links.self.href : action.payload.alternativeLink; + const existing = state[cacheLink] || {} as any; const newAltLinks = hasValue(action.payload.alternativeLink) ? [action.payload.alternativeLink] : []; - return Object.assign({}, state, { - [action.payload.objectToCache._links.self.href]: { - data: action.payload.objectToCache, - timeCompleted: action.payload.timeCompleted, - msToLive: action.payload.msToLive, - requestUUIDs: [action.payload.requestUUID, ...(existing.requestUUIDs || [])], - dependentRequestUUIDs: existing.dependentRequestUUIDs || [], - isDirty: isNotEmpty(existing.patches), - patches: existing.patches || [], - alternativeLinks: [...(existing.alternativeLinks || []), ...newAltLinks] - } as ObjectCacheEntry - }); + if (hasValue(cacheLink)) { + return Object.assign({}, state, { + [cacheLink]: { + data: action.payload.objectToCache, + timeCompleted: action.payload.timeCompleted, + msToLive: action.payload.msToLive, + requestUUIDs: [action.payload.requestUUID, ...(existing.requestUUIDs || [])], + dependentRequestUUIDs: existing.dependentRequestUUIDs || [], + isDirty: isNotEmpty(existing.patches), + patches: existing.patches || [], + alternativeLinks: [...(existing.alternativeLinks || []), ...newAltLinks] + } as ObjectCacheEntry + }); + } else { + return state; + } } /** diff --git a/src/app/core/cache/object-cache.service.ts b/src/app/core/cache/object-cache.service.ts index 9ca0216210..0330a03f02 100644 --- a/src/app/core/cache/object-cache.service.ts +++ b/src/app/core/cache/object-cache.service.ts @@ -63,7 +63,9 @@ export class ObjectCacheService { * An optional alternative link to this object */ add(object: CacheableObject, msToLive: number, requestUUID: string, alternativeLink?: string): void { - object = this.linkService.removeResolvedLinks(object); // Ensure the object we're storing has no resolved links + if (hasValue(object)) { + object = this.linkService.removeResolvedLinks(object); // Ensure the object we're storing has no resolved links + } this.store.dispatch(new AddToObjectCacheAction(object, new Date().getTime(), msToLive, requestUUID, alternativeLink)); } @@ -139,11 +141,15 @@ export class ObjectCacheService { } ), map((entry: ObjectCacheEntry) => { - const type: GenericConstructor = getClassForType((entry.data as any).type); - if (typeof type !== 'function') { - throw new Error(`${type} is not a valid constructor for ${JSON.stringify(entry.data)}`); + if (hasValue(entry.data)) { + const type: GenericConstructor = getClassForType((entry.data as any).type); + if (typeof type !== 'function') { + throw new Error(`${type} is not a valid constructor for ${JSON.stringify(entry.data)}`); + } + return Object.assign(new type(), entry.data) as T; + } else { + return null; } - return Object.assign(new type(), entry.data) as T; }) ); } diff --git a/src/app/core/data/dspace-rest-response-parsing.service.ts b/src/app/core/data/dspace-rest-response-parsing.service.ts index 500afc4aff..2f79edd129 100644 --- a/src/app/core/data/dspace-rest-response-parsing.service.ts +++ b/src/app/core/data/dspace-rest-response-parsing.service.ts @@ -109,6 +109,9 @@ export class DspaceRestResponseParsingService implements ResponseParsingService if (hasValue(match)) { embedAltUrl = new URLCombiner(embedAltUrl, `?size=${match.size}`).toString(); } + if (data._embedded[property] == null) { + this.addToObjectCache(null, request, data, embedAltUrl); + } this.process(data._embedded[property], request, embedAltUrl); }); } @@ -226,7 +229,7 @@ export class DspaceRestResponseParsingService implements ResponseParsingService * @param alternativeURL an alternative url that can be used to retrieve the object */ addToObjectCache(co: CacheableObject, request: RestRequest, data: any, alternativeURL?: string): void { - if (!isCacheableObject(co)) { + if (hasValue(co) && !isCacheableObject(co)) { const type = hasValue(data) && hasValue(data.type) ? data.type : 'object'; let dataJSON: string; if (hasValue(data._embedded)) { @@ -240,7 +243,7 @@ export class DspaceRestResponseParsingService implements ResponseParsingService return; } - if (alternativeURL === co._links.self.href) { + if (hasValue(co) && alternativeURL === co._links.self.href) { alternativeURL = undefined; } diff --git a/src/app/core/index/index.effects.ts b/src/app/core/index/index.effects.ts index 18d639023f..9ec013813d 100644 --- a/src/app/core/index/index.effects.ts +++ b/src/app/core/index/index.effects.ts @@ -27,7 +27,7 @@ export class UUIDIndexEffects { addObject$ = createEffect(() => this.actions$ .pipe( ofType(ObjectCacheActionTypes.ADD), - filter((action: AddToObjectCacheAction) => hasValue(action.payload.objectToCache.uuid)), + filter((action: AddToObjectCacheAction) => hasValue(action.payload.objectToCache) && hasValue(action.payload.objectToCache.uuid)), map((action: AddToObjectCacheAction) => { return new AddToIndexAction( IndexName.OBJECT, @@ -46,7 +46,7 @@ export class UUIDIndexEffects { ofType(ObjectCacheActionTypes.ADD), map((action: AddToObjectCacheAction) => { const alternativeLink = action.payload.alternativeLink; - const selfLink = action.payload.objectToCache._links.self.href; + const selfLink = hasValue(action.payload.objectToCache) ? action.payload.objectToCache._links.self.href : alternativeLink; if (hasValue(alternativeLink) && alternativeLink !== selfLink) { return new AddToIndexAction( IndexName.ALTERNATIVE_OBJECT_LINK, From 984c9bfc2a2271e65190e02902ea0589dcfe6c4f Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Thu, 26 Oct 2023 16:33:14 +0200 Subject: [PATCH 002/285] 107155: Allow caching of embedded objects without selflink --- src/app/core/cache/object-cache.reducer.ts | 2 +- src/app/core/data/dspace-rest-response-parsing.service.ts | 4 ++++ src/app/core/index/index.effects.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/core/cache/object-cache.reducer.ts b/src/app/core/cache/object-cache.reducer.ts index 7f389344fb..21dc729f1b 100644 --- a/src/app/core/cache/object-cache.reducer.ts +++ b/src/app/core/cache/object-cache.reducer.ts @@ -166,7 +166,7 @@ export function objectCacheReducer(state = initialState, action: ObjectCacheActi * the new state, with the object added, or overwritten. */ function addToObjectCache(state: ObjectCacheState, action: AddToObjectCacheAction): ObjectCacheState { - const cacheLink = hasValue(action.payload.objectToCache) ? action.payload.objectToCache._links.self.href : action.payload.alternativeLink; + const cacheLink = hasValue(action.payload.objectToCache?._links?.self) ? action.payload.objectToCache._links.self.href : action.payload.alternativeLink; const existing = state[cacheLink] || {} as any; const newAltLinks = hasValue(action.payload.alternativeLink) ? [action.payload.alternativeLink] : []; if (hasValue(cacheLink)) { diff --git a/src/app/core/data/dspace-rest-response-parsing.service.ts b/src/app/core/data/dspace-rest-response-parsing.service.ts index 2f79edd129..c0e1c70cae 100644 --- a/src/app/core/data/dspace-rest-response-parsing.service.ts +++ b/src/app/core/data/dspace-rest-response-parsing.service.ts @@ -110,7 +110,11 @@ export class DspaceRestResponseParsingService implements ResponseParsingService embedAltUrl = new URLCombiner(embedAltUrl, `?size=${match.size}`).toString(); } if (data._embedded[property] == null) { + // Embedded object is null, meaning it exists (not undefined), but had an empty response (204) -> cache it as null this.addToObjectCache(null, request, data, embedAltUrl); + } else if (!isCacheableObject(data._embedded[property])) { + // Embedded object exists, but doesn't contain a self link -> cache it using the alternative link instead + this.objectCache.add(data._embedded[property], hasValue(request.responseMsToLive) ? request.responseMsToLive : environment.cache.msToLive.default, request.uuid, embedAltUrl); } this.process(data._embedded[property], request, embedAltUrl); }); diff --git a/src/app/core/index/index.effects.ts b/src/app/core/index/index.effects.ts index 9ec013813d..65aa45e571 100644 --- a/src/app/core/index/index.effects.ts +++ b/src/app/core/index/index.effects.ts @@ -46,7 +46,7 @@ export class UUIDIndexEffects { ofType(ObjectCacheActionTypes.ADD), map((action: AddToObjectCacheAction) => { const alternativeLink = action.payload.alternativeLink; - const selfLink = hasValue(action.payload.objectToCache) ? action.payload.objectToCache._links.self.href : alternativeLink; + const selfLink = hasValue(action.payload.objectToCache?._links?.self) ? action.payload.objectToCache._links.self.href : alternativeLink; if (hasValue(alternativeLink) && alternativeLink !== selfLink) { return new AddToIndexAction( IndexName.ALTERNATIVE_OBJECT_LINK, From 4a236906eb6f487a9a475d70b808698dadb145f9 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Mon, 6 May 2024 16:19:03 -0700 Subject: [PATCH 003/285] Updated browser init to update cache after external auth. --- src/modules/app/browser-init.service.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/app/browser-init.service.ts b/src/modules/app/browser-init.service.ts index 014a8f5daa..8cd869e15f 100644 --- a/src/modules/app/browser-init.service.ts +++ b/src/modules/app/browser-init.service.ts @@ -32,9 +32,11 @@ import { AppState } from '../../app/app.reducer'; import { BreadcrumbsService } from '../../app/breadcrumbs/breadcrumbs.service'; import { AuthService } from '../../app/core/auth/auth.service'; import { coreSelector } from '../../app/core/core.selectors'; +import { RequestService } from '../../app/core/data/request.service'; import { RootDataService } from '../../app/core/data/root-data.service'; import { LocaleService } from '../../app/core/locale/locale.service'; import { HeadTagService } from '../../app/core/metadata/head-tag.service'; +import { HALEndpointService } from '../../app/core/shared/hal-endpoint.service'; import { CorrelationIdService } from '../../app/correlation-id/correlation-id.service'; import { InitService } from '../../app/init.service'; import { KlaroService } from '../../app/shared/cookies/klaro.service'; @@ -81,6 +83,9 @@ export class BrowserInitService extends InitService { protected menuService: MenuService, private rootDataService: RootDataService, protected router: Router, + private requestService: RequestService, + private halService: HALEndpointService, + ) { super( store, @@ -169,17 +174,15 @@ export class BrowserInitService extends InitService { } /** - * During an external authentication flow invalidate the SSR transferState + * During an external authentication flow invalidate the * data in the cache. This allows the app to fetch fresh content. * @private */ private externalAuthCheck() { - this.sub = this.authService.isExternalAuthentication().pipe( filter((externalAuth: boolean) => externalAuth), ).subscribe(() => { - // Clear the transferState data. - this.rootDataService.invalidateRootCache(); + this.requestService.setStaleByHrefSubstring(this.halService.getRootHref()); this.authService.setExternalAuthStatus(false); }, ); From 96748b9bacd8540af53bf7cf6e067b066c43128c Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Wed, 20 Mar 2024 11:39:17 +0100 Subject: [PATCH 004/285] added missing interfaces --- ...lection-admin-search-result-grid-element.component.ts | 9 ++++++--- ...mmunity-admin-search-result-grid-element.component.ts | 9 ++++++--- ...lection-admin-search-result-list-element.component.ts | 9 ++++++--- ...mmunity-admin-search-result-list-element.component.ts | 9 ++++++--- .../collection-curate/collection-curate.component.ts | 7 +++++-- .../collection-source-controls.component.ts | 2 +- .../forgot-password-form.component.ts | 7 +++++-- .../item-register-doi/item-register-doi.component.ts | 7 +++++-- .../item-version-history.component.ts | 7 +++++-- .../simple/related-items/related-items-component.ts | 3 ++- .../date-value-input/date-value-input.component.ts | 5 +++-- .../string-value-input/string-value-input.component.ts | 5 +++-- .../process-parameters/process-parameters.component.ts | 5 +++-- .../dso-edit-menu-expandable-section.component.ts | 3 ++- src/app/shared/error/error.component.ts | 8 +++++--- .../dynamic-lookup-relation-selection-tab.component.ts | 5 +++-- .../access-status-badge/access-status-badge.component.ts | 4 +++- ...rkflow-item-search-result-detail-element.component.ts | 9 ++++++--- ...kspace-item-search-result-detail-element.component.ts | 9 ++++++--- .../item/item-search-result-grid-element.component.ts | 7 +++++-- .../identifier-data/identifier-data.component.ts | 3 ++- ...imed-approved-search-result-list-element.component.ts | 5 +++-- ...imed-declined-search-result-list-element.component.ts | 5 +++-- ...workflow-item-search-result-list-element.component.ts | 5 +++-- ...orkspace-item-search-result-list-element.component.ts | 5 +++-- .../collection-search-result-list-element.component.ts | 7 +++++-- .../community-search-result-list-element.component.ts | 8 +++++--- .../sidebar-search-list-element.component.ts | 7 +++++-- .../abstract-paginated-drag-and-drop-list.component.ts | 5 +++-- src/app/shared/upload/uploader/uploader.component.ts | 8 +++++--- .../identifiers/section-identifiers.component.ts | 6 +++--- 31 files changed, 126 insertions(+), 67 deletions(-) diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts index 172226dd07..38352e7816 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts @@ -1,4 +1,7 @@ -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; @@ -21,10 +24,10 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g /** * The component for displaying a list element for a collection search result on the admin search page */ -export class CollectionAdminSearchResultGridElementComponent extends SearchResultGridElementComponent { +export class CollectionAdminSearchResultGridElementComponent extends SearchResultGridElementComponent implements OnInit { editPath: string; - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.editPath = getCollectionEditRoute(this.dso.uuid); } diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts index 50be35229d..509c1e9266 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts @@ -1,4 +1,7 @@ -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; @@ -21,10 +24,10 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g /** * The component for displaying a list element for a community search result on the admin search page */ -export class CommunityAdminSearchResultGridElementComponent extends SearchResultGridElementComponent { +export class CommunityAdminSearchResultGridElementComponent extends SearchResultGridElementComponent implements OnInit { editPath: string; - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.editPath = getCommunityEditRoute(this.dso.uuid); } diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts index 37afbf14fe..0924379ea5 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts @@ -1,4 +1,7 @@ -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -22,10 +25,10 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l /** * The component for displaying a list element for a collection search result on the admin search page */ -export class CollectionAdminSearchResultListElementComponent extends SearchResultListElementComponent { +export class CollectionAdminSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { editPath: string; - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.editPath = getCollectionEditRoute(this.dso.uuid); } diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts index 5861f15c1f..c4146dbd60 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts @@ -1,4 +1,7 @@ -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -22,10 +25,10 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l /** * The component for displaying a list element for a community search result on the admin search page */ -export class CommunityAdminSearchResultListElementComponent extends SearchResultListElementComponent { +export class CommunityAdminSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { editPath: string; - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.editPath = getCommunityEditRoute(this.dso.uuid); } diff --git a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts index 14ba01421b..370506e473 100644 --- a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts @@ -1,5 +1,8 @@ import { AsyncPipe } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; @@ -28,7 +31,7 @@ import { hasValue } from '../../../shared/empty.util'; ], standalone: true, }) -export class CollectionCurateComponent { +export class CollectionCurateComponent implements OnInit { dsoRD$: Observable>; collectionName$: Observable; diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts index 3b51a8e9d9..fdd65a43c7 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts @@ -95,7 +95,7 @@ export class CollectionSourceControlsComponent implements OnInit, OnDestroy { ) { } - ngOnInit() { + ngOnInit(): void { // ensure the contentSource gets updated after being set to stale this.contentSource$ = this.collectionService.findByHref(this.collection._links.self.href, false).pipe( getAllSucceededRemoteDataPayload(), diff --git a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts index 442e4bf9fa..7b2b1beedd 100644 --- a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts +++ b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts @@ -2,7 +2,10 @@ import { AsyncPipe, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { ActivatedRoute, Router, @@ -45,7 +48,7 @@ import { BrowserOnlyPipe } from '../../shared/utils/browser-only.pipe'; /** * Component for a user to enter a new password for a forgot token. */ -export class ForgotPasswordFormComponent { +export class ForgotPasswordFormComponent implements OnInit { registration$: Observable; diff --git a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts index 9acc12e95d..d9e0283267 100644 --- a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts +++ b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts @@ -3,7 +3,10 @@ import { NgForOf, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { ActivatedRoute, Router, @@ -47,7 +50,7 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac /** * Component responsible for rendering the Item Register DOI page */ -export class ItemRegisterDoiComponent extends AbstractSimpleItemActionComponent { +export class ItemRegisterDoiComponent extends AbstractSimpleItemActionComponent implements OnInit { protected messageKey = 'register-doi'; doiToUpdateMessage = 'item.edit.' + this.messageKey + '.to-update'; diff --git a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts index 9c61231164..a414af0ce4 100644 --- a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts +++ b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts @@ -2,7 +2,10 @@ import { AsyncPipe, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -28,7 +31,7 @@ import { ItemVersionsComponent } from '../../versions/item-versions.component'; /** * Component for listing and managing an item's version history */ -export class ItemVersionHistoryComponent { +export class ItemVersionHistoryComponent implements OnInit { /** * The item to display the version history for */ diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index b65f903a5d..434093ba2a 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -10,6 +10,7 @@ import { ElementRef, Inject, Input, + OnInit, PLATFORM_ID, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; @@ -43,7 +44,7 @@ import { AbstractIncrementalListComponent } from '../abstract-incremental-list/a * This component is used for displaying relations between items * It expects a parent item and relationship type, as well as a label to display on top */ -export class RelatedItemsComponent extends AbstractIncrementalListComponent>>> { +export class RelatedItemsComponent extends AbstractIncrementalListComponent>>> implements OnInit { /** * The parent of the list of related items to display diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts index 29b2a85d57..74ee21471c 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts @@ -2,6 +2,7 @@ import { NgIf } from '@angular/common'; import { Component, Input, + OnInit, Optional, } from '@angular/core'; import { @@ -27,7 +28,7 @@ import { ValueInputComponent } from '../value-input.component'; standalone: true, imports: [FormsModule, NgIf, TranslateModule], }) -export class DateValueInputComponent extends ValueInputComponent { +export class DateValueInputComponent extends ValueInputComponent implements OnInit { /** * The current value of the date string */ @@ -38,7 +39,7 @@ export class DateValueInputComponent extends ValueInputComponent { */ @Input() initialValue; - ngOnInit() { + ngOnInit(): void { this.value = this.initialValue; } diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts index d19e149311..d7fa528544 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts @@ -2,6 +2,7 @@ import { NgIf } from '@angular/common'; import { Component, Input, + OnInit, Optional, } from '@angular/core'; import { @@ -27,7 +28,7 @@ import { ValueInputComponent } from '../value-input.component'; standalone: true, imports: [FormsModule, NgIf, TranslateModule], }) -export class StringValueInputComponent extends ValueInputComponent { +export class StringValueInputComponent extends ValueInputComponent implements OnInit { /** * The current value of the string */ @@ -38,7 +39,7 @@ export class StringValueInputComponent extends ValueInputComponent { */ @Input() initialValue; - ngOnInit() { + ngOnInit(): void { this.value = this.initialValue; } diff --git a/src/app/process-page/form/process-parameters/process-parameters.component.ts b/src/app/process-page/form/process-parameters/process-parameters.component.ts index 0b72b086c1..ac174e338b 100644 --- a/src/app/process-page/form/process-parameters/process-parameters.component.ts +++ b/src/app/process-page/form/process-parameters/process-parameters.component.ts @@ -7,6 +7,7 @@ import { EventEmitter, Input, OnChanges, + OnInit, Optional, Output, SimpleChanges, @@ -39,7 +40,7 @@ import { ParameterSelectComponent } from './parameter-select/parameter-select.co standalone: true, imports: [NgIf, NgFor, ParameterSelectComponent, TranslateModule], }) -export class ProcessParametersComponent implements OnChanges { +export class ProcessParametersComponent implements OnChanges, OnInit { /** * The currently selected script */ @@ -59,7 +60,7 @@ export class ProcessParametersComponent implements OnChanges { */ parameterValues: ProcessParameter[]; - ngOnInit() { + ngOnInit(): void { if (hasValue(this.initialParams)) { this.parameterValues = this.initialParams; } diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts index 8f458d4e56..94d0ddd260 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts @@ -8,6 +8,7 @@ import { Component, Inject, Injector, + OnInit, } from '@angular/core'; import { Router } from '@angular/router'; import { @@ -34,7 +35,7 @@ import { MenuService } from '../../../menu/menu.service'; standalone: true, imports: [NgbDropdownModule, NgbTooltipModule, NgFor, NgIf, NgComponentOutlet, TranslateModule, AsyncPipe], }) -export class DsoEditMenuExpandableSectionComponent extends MenuSectionComponent { +export class DsoEditMenuExpandableSectionComponent extends MenuSectionComponent implements OnInit { menuID: MenuID = MenuID.DSO_EDIT; itemModel; diff --git a/src/app/shared/error/error.component.ts b/src/app/shared/error/error.component.ts index 900ea67887..168415c0b1 100644 --- a/src/app/shared/error/error.component.ts +++ b/src/app/shared/error/error.component.ts @@ -1,6 +1,8 @@ import { Component, Input, + OnDestroy, + OnInit, } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; @@ -15,7 +17,7 @@ import { AlertType } from '../alert/alert-type'; standalone: true, imports: [AlertComponent], }) -export class ErrorComponent { +export class ErrorComponent implements OnDestroy, OnInit { @Input() message = 'Error...'; @@ -31,7 +33,7 @@ export class ErrorComponent { } - ngOnInit() { + ngOnInit(): void { if (this.message === undefined) { this.subscription = this.translate.get('error.default').subscribe((message: string) => { this.message = message; @@ -39,7 +41,7 @@ export class ErrorComponent { } } - ngOnDestroy() { + ngOnDestroy(): void { if (this.subscription !== undefined) { this.subscription.unsubscribe(); } diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts index d1e516513b..51229be599 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts @@ -6,6 +6,7 @@ import { Component, EventEmitter, Input, + OnInit, Output, } from '@angular/core'; import { Router } from '@angular/router'; @@ -57,7 +58,7 @@ import { PaginatedSearchOptions } from '../../../../../search/models/paginated-s /** * Tab for inside the lookup model that represents the currently selected relationships */ -export class DsDynamicLookupRelationSelectionTabComponent { +export class DsDynamicLookupRelationSelectionTabComponent implements OnInit { /** * A string that describes the type of relationship */ @@ -120,7 +121,7 @@ export class DsDynamicLookupRelationSelectionTabComponent { /** * Set up the selection and pagination on load */ - ngOnInit() { + ngOnInit(): void { this.resetRoute(); this.selectionRD$ = this.searchConfigService.paginatedSearchOptions .pipe( diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts index 5b69a7e72a..0b86b782f6 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts @@ -5,6 +5,8 @@ import { import { Component, Input, + OnDestroy, + OnInit, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { @@ -35,7 +37,7 @@ import { AccessStatusObject } from './access-status.model'; /** * Component rendering the access status of an item as a badge */ -export class AccessStatusBadgeComponent { +export class AccessStatusBadgeComponent implements OnDestroy, OnInit { @Input() object: DSpaceObject; accessStatus$: Observable; diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts index cd28223013..1453d9246e 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts @@ -1,4 +1,7 @@ -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { Observable } from 'rxjs'; import { find } from 'rxjs/operators'; import { Context } from 'src/app/core/shared/context.model'; @@ -29,7 +32,7 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem }) @listableObjectComponent(WorkflowItemSearchResult, ViewMode.DetailedListElement) -export class WorkflowItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent { +export class WorkflowItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent implements OnInit { /** * The item object that belonging to the result object @@ -51,7 +54,7 @@ export class WorkflowItemSearchResultDetailElementComponent extends SearchResult /** * Initialize all instance variables */ - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.linkService.resolveLink(this.dso, followLink('item')); this.initItem(this.dso.item as Observable>); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts index 5c51e3464f..b88cef64b5 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts @@ -1,4 +1,7 @@ -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { Observable } from 'rxjs'; import { find } from 'rxjs/operators'; @@ -29,7 +32,7 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem }) @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.DetailedListElement) -export class WorkspaceItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent { +export class WorkspaceItemSearchResultDetailElementComponent extends SearchResultDetailElementComponent implements OnInit { /** * The item object that belonging to the result object @@ -51,7 +54,7 @@ export class WorkspaceItemSearchResultDetailElementComponent extends SearchResul /** * Initialize all instance variables */ - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.linkService.resolveLink(this.dso, followLink('item')); this.initItem(this.dso.item as Observable>); diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts index c9c56daff1..a0c8ec84ce 100644 --- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts @@ -3,7 +3,10 @@ import { NgFor, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -35,7 +38,7 @@ import { SearchResultGridElementComponent } from '../../search-result-grid-eleme /** * The component for displaying a grid element for an item search result of the type Publication */ -export class ItemSearchResultGridElementComponent extends SearchResultGridElementComponent { +export class ItemSearchResultGridElementComponent extends SearchResultGridElementComponent implements OnInit { /** * Route to the item's page */ diff --git a/src/app/shared/object-list/identifier-data/identifier-data.component.ts b/src/app/shared/object-list/identifier-data/identifier-data.component.ts index ecc0bd1ca3..af658c6cf2 100644 --- a/src/app/shared/object-list/identifier-data/identifier-data.component.ts +++ b/src/app/shared/object-list/identifier-data/identifier-data.component.ts @@ -5,6 +5,7 @@ import { import { Component, Input, + OnInit, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; @@ -28,7 +29,7 @@ import { IdentifierData } from './identifier-data.model'; /** * Component rendering an identifier, eg. DOI or handle */ -export class IdentifierDataComponent { +export class IdentifierDataComponent implements OnInit { @Input() item: Item; identifiers$: Observable; diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts index fc024944e8..f94effe2a4 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts @@ -5,6 +5,7 @@ import { import { Component, Inject, + OnInit, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; @@ -40,7 +41,7 @@ import { ThemedItemListPreviewComponent } from '../../item-list-preview/themed-i imports: [NgIf, ThemedItemListPreviewComponent, AsyncPipe, TranslateModule, VarDirective], }) @listableObjectComponent(ClaimedApprovedTaskSearchResult, ViewMode.ListElement) -export class ClaimedApprovedSearchResultListElementComponent extends SearchResultListElementComponent { +export class ClaimedApprovedSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { /** * A boolean representing if to show submitter information @@ -69,7 +70,7 @@ export class ClaimedApprovedSearchResultListElementComponent extends SearchResul /** * Initialize all instance variables */ - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.linkService.resolveLinks(this.dso, followLink('workflowitem', diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts index fa5f7a3a04..d69b9ecda0 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts @@ -5,6 +5,7 @@ import { import { Component, Inject, + OnInit, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; @@ -40,7 +41,7 @@ import { ThemedItemListPreviewComponent } from '../../item-list-preview/themed-i imports: [NgIf, ThemedItemListPreviewComponent, AsyncPipe, TranslateModule, VarDirective], }) @listableObjectComponent(ClaimedDeclinedTaskSearchResult, ViewMode.ListElement) -export class ClaimedDeclinedSearchResultListElementComponent extends SearchResultListElementComponent { +export class ClaimedDeclinedSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { /** * A boolean representing if to show submitter information @@ -69,7 +70,7 @@ export class ClaimedDeclinedSearchResultListElementComponent extends SearchResul /** * Initialize all instance variables */ - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.linkService.resolveLinks(this.dso, followLink('workflowitem', diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts index 7c88dcc36d..d7f735e1ad 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts @@ -6,6 +6,7 @@ import { import { Component, Inject, + OnInit, } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; @@ -43,7 +44,7 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme }) @listableObjectComponent(WorkflowItemSearchResult, ViewMode.ListElement) -export class WorkflowItemSearchResultListElementComponent extends SearchResultListElementComponent { +export class WorkflowItemSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { LinkTypes = CollectionElementLinkType; ViewModes = ViewMode; @@ -75,7 +76,7 @@ export class WorkflowItemSearchResultListElementComponent extends SearchResultLi /** * Initialize all instance variables */ - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.deriveSearchResult(); this.showThumbnails = this.appConfig.browseBy.showThumbnails; diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts index 8938064da6..4a8863d22f 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts @@ -6,6 +6,7 @@ import { import { Component, Inject, + OnInit, } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; @@ -43,7 +44,7 @@ import { SearchResultListElementComponent } from '../../search-result-list-eleme }) @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.ListElement) -export class WorkspaceItemSearchResultListElementComponent extends SearchResultListElementComponent { +export class WorkspaceItemSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { LinkTypes = CollectionElementLinkType; ViewModes = ViewMode; @@ -75,7 +76,7 @@ export class WorkspaceItemSearchResultListElementComponent extends SearchResult /** * Initialize all instance variables */ - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); this.deriveSearchResult(); this.showThumbnails = this.appConfig.browseBy.showThumbnails; diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts index 58cd875ce2..2641792b02 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts @@ -2,7 +2,10 @@ import { NgClass, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { Collection } from '../../../../core/shared/collection.model'; @@ -23,7 +26,7 @@ import { SearchResultListElementComponent } from '../search-result-list-element. * Component representing a collection search result in list view */ @listableObjectComponent(CollectionSearchResult, ViewMode.ListElement) -export class CollectionSearchResultListElementComponent extends SearchResultListElementComponent { +export class CollectionSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { /** * Display thumbnails if required by configuration diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts index 52d7ad6e6b..e8e3c57959 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts @@ -2,7 +2,10 @@ import { NgClass, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { Community } from '../../../../core/shared/community.model'; @@ -23,13 +26,12 @@ import { SearchResultListElementComponent } from '../search-result-list-element. * Component representing a community search result in list view */ @listableObjectComponent(CommunitySearchResult, ViewMode.ListElement) -export class CommunitySearchResultListElementComponent extends SearchResultListElementComponent { +export class CommunitySearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { /** * Display thumbnails if required by configuration */ showThumbnails: boolean; - ngOnInit(): void { super.ngOnInit(); this.showThumbnails = this.showThumbnails ?? this.appConfig.browseBy.showThumbnails; diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts index c262dee259..e65883cd3e 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts @@ -3,7 +3,10 @@ import { NgClass, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { Observable, @@ -41,7 +44,7 @@ import { SearchResultListElementComponent } from '../search-result-list-element/ * It displays the name of the parent, title and description of the object. All of which are customizable in the child * component by overriding the relevant methods of this component */ -export class SidebarSearchListElementComponent, K extends DSpaceObject> extends SearchResultListElementComponent { +export class SidebarSearchListElementComponent, K extends DSpaceObject> extends SearchResultListElementComponent implements OnInit { /** * Observable for the title of the parent object (displayed above the object's title) */ diff --git a/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts b/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts index 1ebf626484..444e7bc14c 100644 --- a/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts +++ b/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts @@ -7,6 +7,7 @@ import { ElementRef, EventEmitter, OnDestroy, + OnInit, Output, ViewChild, } from '@angular/core'; @@ -65,7 +66,7 @@ export const compareArraysUsingFieldUuids = () => selector: 'ds-paginated-drag-drop-abstract', template: '', }) -export abstract class AbstractPaginatedDragAndDropListComponent implements OnDestroy { +export abstract class AbstractPaginatedDragAndDropListComponent implements OnInit, OnDestroy { /** * A view on the child pagination component */ @@ -142,7 +143,7 @@ export abstract class AbstractPaginatedDragAndDropListComponent { this.onFileSelected.emit(items); }); diff --git a/src/app/submission/sections/identifiers/section-identifiers.component.ts b/src/app/submission/sections/identifiers/section-identifiers.component.ts index 1483ea47b7..e297c795df 100644 --- a/src/app/submission/sections/identifiers/section-identifiers.component.ts +++ b/src/app/submission/sections/identifiers/section-identifiers.component.ts @@ -7,6 +7,7 @@ import { ChangeDetectionStrategy, Component, Inject, + OnInit, } from '@angular/core'; import { TranslateModule, @@ -47,7 +48,7 @@ import { SectionsService } from '../sections.service'; standalone: true, }) -export class SubmissionSectionIdentifiersComponent extends SectionModelComponent { +export class SubmissionSectionIdentifiersComponent extends SectionModelComponent implements OnInit { /** * The Alert categories. * @type {AlertType} @@ -76,7 +77,6 @@ export class SubmissionSectionIdentifiersComponent extends SectionModelComponent /** * Initialize instance variables. * - * @param {PaginationService} paginationService * @param {TranslateService} translate * @param {SectionsService} sectionService * @param {SubmissionService} submissionService @@ -93,7 +93,7 @@ export class SubmissionSectionIdentifiersComponent extends SectionModelComponent super(injectedCollectionId, injectedSectionData, injectedSubmissionId); } - ngOnInit() { + ngOnInit(): void { super.ngOnInit(); } From 99384a70605b2eccaaae249103673c3735da8c85 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 21 May 2024 12:02:15 +0200 Subject: [PATCH 005/285] 115051: Created ThemedAdminSearchPageComponent --- src/app/admin/admin-routing.module.ts | 4 +-- .../admin-search-page/admin-search.module.ts | 2 ++ .../themed-admin-search-page.component.ts | 26 +++++++++++++++++++ .../admin-search-page.component.html | 0 .../admin-search-page.component.scss | 0 .../admin-search-page.component.ts | 12 +++++++++ src/themes/custom/lazy-theme.module.ts | 4 +-- 7 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 src/app/admin/admin-search-page/themed-admin-search-page.component.ts create mode 100644 src/themes/custom/app/admin/admin-search-page/admin-search-page.component.html create mode 100644 src/themes/custom/app/admin/admin-search-page/admin-search-page.component.scss create mode 100644 src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts diff --git a/src/app/admin/admin-routing.module.ts b/src/app/admin/admin-routing.module.ts index 1ea20bc9a0..3e3a8924ac 100644 --- a/src/app/admin/admin-routing.module.ts +++ b/src/app/admin/admin-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component'; -import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component'; +import { ThemedAdminSearchPageComponent } from './admin-search-page/themed-admin-search-page.component'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component'; import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; @@ -20,7 +20,7 @@ import { BatchImportPageComponent } from './admin-import-batch-page/batch-import { path: 'search', resolve: { breadcrumb: I18nBreadcrumbResolver }, - component: AdminSearchPageComponent, + component: ThemedAdminSearchPageComponent, data: { title: 'admin.search.title', breadcrumbKey: 'admin.search' } }, { diff --git a/src/app/admin/admin-search-page/admin-search.module.ts b/src/app/admin/admin-search-page/admin-search.module.ts index 353d6dd498..b45eca15c4 100644 --- a/src/app/admin/admin-search-page/admin-search.module.ts +++ b/src/app/admin/admin-search-page/admin-search.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../../shared/shared.module'; +import { ThemedAdminSearchPageComponent } from './themed-admin-search-page.component'; import { AdminSearchPageComponent } from './admin-search-page.component'; import { ItemAdminSearchResultListElementComponent } from './admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component'; import { CommunityAdminSearchResultListElementComponent } from './admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component'; @@ -31,6 +32,7 @@ const ENTRY_COMPONENTS = [ ResearchEntitiesModule.withEntryComponents() ], declarations: [ + ThemedAdminSearchPageComponent, AdminSearchPageComponent, ...ENTRY_COMPONENTS ] diff --git a/src/app/admin/admin-search-page/themed-admin-search-page.component.ts b/src/app/admin/admin-search-page/themed-admin-search-page.component.ts new file mode 100644 index 0000000000..741a3b04f9 --- /dev/null +++ b/src/app/admin/admin-search-page/themed-admin-search-page.component.ts @@ -0,0 +1,26 @@ +import { Component } from '@angular/core'; +import { ThemedComponent } from '../../shared/theme-support/themed.component'; +import { AdminSearchPageComponent } from './admin-search-page.component'; + +/** + * Themed wrapper for {@link AdminSearchPageComponent} + */ +@Component({ + selector: 'ds-themed-admin-search-page', + templateUrl: '../../shared/theme-support/themed.component.html', +}) +export class ThemedAdminSearchPageComponent extends ThemedComponent { + + protected getComponentName(): string { + return 'AdminSearchPageComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../themes/${themeName}/app/admin/admin-search-page/admin-search-page.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./admin-search-page.component'); + } + +} diff --git a/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.html b/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.scss b/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.scss new file mode 100644 index 0000000000..e69de29bb2 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 new file mode 100644 index 0000000000..358f11f0d1 --- /dev/null +++ b/src/themes/custom/app/admin/admin-search-page/admin-search-page.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; +import { AdminSearchPageComponent as BaseComponent } from '../../../../../app/admin/admin-search-page/admin-search-page.component'; + +@Component({ + selector: 'ds-admin-search-page', + // styleUrls: ['./admin-search-page.component.scss'], + styleUrls: ['../../../../../app/admin/admin-search-page/admin-search-page.component.scss'], + // templateUrl: './admin-search-page.component.html', + templateUrl: '../../../../../app/admin/admin-search-page/admin-search-page.component.html', +}) +export class AdminSearchPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index d2ac0ae787..4f35854e5e 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -114,6 +114,7 @@ import { ObjectListComponent } from './app/shared/object-list/object-list.compon import { BrowseByMetadataPageComponent } from './app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component'; import { BrowseByDatePageComponent } from './app/browse-by/browse-by-date-page/browse-by-date-page.component'; import { BrowseByTitlePageComponent } from './app/browse-by/browse-by-title-page/browse-by-title-page.component'; +import { AdminSearchPageComponent } from './app/admin/admin-search-page/admin-search-page.component'; const DECLARATIONS = [ FileSectionComponent, @@ -168,8 +169,7 @@ const DECLARATIONS = [ BrowseByMetadataPageComponent, BrowseByDatePageComponent, BrowseByTitlePageComponent, - - + AdminSearchPageComponent, ]; @NgModule({ From 61e52cd2abb8ec5dea4b17170e93fe190b086dc9 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 21 May 2024 13:26:19 +0200 Subject: [PATCH 006/285] Fixed navbar overflowing over breadcrumbs in mobile mode in custom theme --- src/app/navbar/navbar.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index 90cf07caa4..f2f87a8bb6 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -1,6 +1,6 @@