From 4a236906eb6f487a9a475d70b808698dadb145f9 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Mon, 6 May 2024 16:19:03 -0700 Subject: [PATCH 01/51] 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 02/51] 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 66e1a2488b14c84b41486fabc77350f17d722b0d Mon Sep 17 00:00:00 2001 From: Andrea Barbasso <´andrea.barbasso@4science.com´> Date: Fri, 7 Jun 2024 14:58:50 +0200 Subject: [PATCH 03/51] [DURACOM-273] fix markdown rendering applying before mathjax rendering --- src/app/core/shared/client-math.service.ts | 4 +-- src/app/core/shared/math.service.spec.ts | 4 +-- src/app/core/shared/math.service.ts | 2 +- src/app/core/shared/server-math.service.ts | 2 +- src/app/shared/utils/markdown.directive.ts | 42 +++++++++++++--------- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/app/core/shared/client-math.service.ts b/src/app/core/shared/client-math.service.ts index 2fde521ba9..0630ec3246 100644 --- a/src/app/core/shared/client-math.service.ts +++ b/src/app/core/shared/client-math.service.ts @@ -31,7 +31,7 @@ export class ClientMathService extends MathService { protected mathJaxOptions = { tex: { - inlineMath: [['$', '$'], ['\\(', '\\)']], + inlineMath: [['$', '$'], ['$$', '$$'], ['\\(', '\\)']], }, svg: { fontCache: 'global', @@ -108,7 +108,7 @@ export class ClientMathService extends MathService { */ render(element: HTMLElement) { if (environment.markdown.mathjax) { - this._window.nativeWindow.MathJax.typesetPromise([element]); + return (window as any).MathJax.typesetPromise([element]) as Promise; } } } diff --git a/src/app/core/shared/math.service.spec.ts b/src/app/core/shared/math.service.spec.ts index cc0b2814f2..75d8bf1024 100644 --- a/src/app/core/shared/math.service.spec.ts +++ b/src/app/core/shared/math.service.spec.ts @@ -22,8 +22,8 @@ export class MockMathService extends MathService { return of(true); } - render(element: HTMLElement): void { - return; + render(element: HTMLElement): Promise { + return Promise.resolve(); } } diff --git a/src/app/core/shared/math.service.ts b/src/app/core/shared/math.service.ts index c06ce06220..909e039564 100644 --- a/src/app/core/shared/math.service.ts +++ b/src/app/core/shared/math.service.ts @@ -15,5 +15,5 @@ export abstract class MathService { protected abstract registerMathJaxAsync(config: MathJaxConfig): Promise; abstract ready(): Observable; - abstract render(element: HTMLElement): void; + abstract render(element: HTMLElement): Promise; } diff --git a/src/app/core/shared/server-math.service.ts b/src/app/core/shared/server-math.service.ts index 75fa775fee..62070dbafc 100644 --- a/src/app/core/shared/server-math.service.ts +++ b/src/app/core/shared/server-math.service.ts @@ -47,6 +47,6 @@ export class ServerMathService extends MathService { } render(element: HTMLElement) { - return; + return Promise.resolve(); } } diff --git a/src/app/shared/utils/markdown.directive.ts b/src/app/shared/utils/markdown.directive.ts index a38b079ffd..0540e25cc5 100644 --- a/src/app/shared/utils/markdown.directive.ts +++ b/src/app/shared/utils/markdown.directive.ts @@ -55,30 +55,40 @@ export class MarkdownDirective implements OnInit, OnDestroy { async render(value: string, forcePreview = false): Promise { if (isEmpty(value) || (!environment.markdown.enabled && !forcePreview)) { - return value; + this.el.innerHTML = value; + return; + } else { + if (environment.markdown.mathjax) { + this.renderMathjaxThenMarkdown(value); + } else { + this.renderMarkdown(value); + } } + } + + private renderMathjaxThenMarkdown(value: string) { + const sanitized = this.sanitizer.sanitize(SecurityContext.HTML, value); + this.el.innerHTML = sanitized; + this.mathService.ready().pipe( + filter((ready) => ready), + take(1), + takeUntil(this.alive$), + ).subscribe(() => { + this.mathService.render(this.el)?.then(_ => { + this.renderMarkdown(this.el.innerHTML, true); + }); + }); + } + + private async renderMarkdown(value: string, alreadySanitized = false) { const MarkdownIt = await this.markdownIt; const md = new MarkdownIt({ html: true, linkify: true, }); - const html = this.sanitizer.sanitize(SecurityContext.HTML, md.render(value)); + const html = alreadySanitized ? md.render(value) : this.sanitizer.sanitize(SecurityContext.HTML, md.render(value)); this.el.innerHTML = html; - - if (environment.markdown.mathjax) { - this.renderMathjax(); - } - } - - private renderMathjax() { - this.mathService.ready().pipe( - filter((ready) => ready), - take(1), - takeUntil(this.alive$), - ).subscribe(() => { - this.mathService.render(this.el); - }); } ngOnDestroy() { From cc975bb0b517cd73adcc7a4eb5cd362ece936903 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Thu, 13 Jun 2024 13:07:51 +0200 Subject: [PATCH 04/51] add lint rule (use-lifecycle-interface) --- .eslintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.json b/.eslintrc.json index 4cc8c6dbc5..dc76a7dea3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -165,6 +165,7 @@ "@angular-eslint/no-output-native": "warn", "@angular-eslint/no-output-on-prefix": "warn", "@angular-eslint/no-conflicting-lifecycle": "warn", + "@angular-eslint/use-lifecycle-interface": "error" "@typescript-eslint/no-inferrable-types":[ "error", From 3cedeffec93b41fce27ea432552b335b37a30894 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Thu, 13 Jun 2024 13:12:35 +0200 Subject: [PATCH 05/51] add missing comma --- .eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index dc76a7dea3..5fb4c12171 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -165,7 +165,7 @@ "@angular-eslint/no-output-native": "warn", "@angular-eslint/no-output-on-prefix": "warn", "@angular-eslint/no-conflicting-lifecycle": "warn", - "@angular-eslint/use-lifecycle-interface": "error" + "@angular-eslint/use-lifecycle-interface": "error", "@typescript-eslint/no-inferrable-types":[ "error", From 2d9ad8e5cf6f04805dc27e147708ae9367864935 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Thu, 13 Jun 2024 13:46:57 +0200 Subject: [PATCH 06/51] add missing imports of Angular lifecycle interfaces --- .../metadata-registry/metadata-registry.component.ts | 7 +++++-- .../filtered-collections.component.ts | 3 ++- .../filtered-items/filtered-items.component.ts | 5 +++-- .../core/submission/submission-duplicate-data.service.ts | 8 ++++++-- .../person/person-search-result-list-element.component.ts | 3 ++- .../recent-item-list/recent-item-list.component.ts | 3 ++- .../edit-item-page/item-status/item-status.component.ts | 3 ++- .../orcid-page/orcid-queue/orcid-queue.component.ts | 3 ++- .../project-entry-import-modal.component.ts | 3 ++- .../qa/source/quality-assurance-source.component.ts | 4 +++- .../publication-claim/publication-claim.component.ts | 3 ++- .../profile-page-security-form.component.ts | 3 ++- .../ds-dynamic-form-control-container.component.ts | 5 ++++- .../models/onebox/dynamic-onebox.component.ts | 3 ++- .../shared/form/number-picker/number-picker.component.ts | 3 ++- .../item/item-search-result-list-element.component.ts | 7 +++++-- .../collection/submission-form-collection.component.ts | 3 ++- .../submission-upload-files.component.ts | 3 ++- .../sections/duplicates/section-duplicates.component.ts | 3 ++- 19 files changed, 52 insertions(+), 23 deletions(-) diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts index a148559bd2..be989d49e2 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts @@ -4,7 +4,10 @@ import { NgForOf, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnDestroy, +} from '@angular/core'; import { Router, RouterLink, @@ -60,7 +63,7 @@ import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-sch * A component used for managing all existing metadata schemas within the repository. * The admin can create, edit or delete metadata schemas here. */ -export class MetadataRegistryComponent { +export class MetadataRegistryComponent implements OnDestroy { /** * A list of all the current metadata schemas within the repository diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts index b4bebfc924..e1f54bd8d3 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts @@ -4,6 +4,7 @@ import { } from '@angular/common'; import { Component, + OnInit, ViewChild, } from '@angular/core'; import { @@ -40,7 +41,7 @@ import { FilteredCollections } from './filtered-collections.model'; ], standalone: true, }) -export class FilteredCollectionsComponent { +export class FilteredCollectionsComponent implements OnInit { queryForm: FormGroup; results: FilteredCollections = new FilteredCollections(); diff --git a/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts b/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts index 9fd4643573..4cb93aa9be 100644 --- a/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts +++ b/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts @@ -5,6 +5,7 @@ import { } from '@angular/common'; import { Component, + OnInit, ViewChild, } from '@angular/core'; import { @@ -66,7 +67,7 @@ import { QueryPredicate } from './query-predicate.model'; ], standalone: true, }) -export class FilteredItemsComponent { +export class FilteredItemsComponent implements OnInit { collections: OptionVO[]; presetQueries: PresetQuery[]; @@ -90,7 +91,7 @@ export class FilteredItemsComponent { private formBuilder: FormBuilder, private restService: DspaceRestService) {} - ngOnInit() { + ngOnInit(): void { this.loadCollections(); this.loadPresetQueries(); this.loadMetadataFields(); diff --git a/src/app/core/submission/submission-duplicate-data.service.ts b/src/app/core/submission/submission-duplicate-data.service.ts index 755fec05c2..b327342469 100644 --- a/src/app/core/submission/submission-duplicate-data.service.ts +++ b/src/app/core/submission/submission-duplicate-data.service.ts @@ -1,5 +1,8 @@ /* eslint-disable max-classes-per-file */ -import { Injectable } from '@angular/core'; +import { + Injectable, + OnDestroy, +} from '@angular/core'; import { Observable } from 'rxjs'; import { Duplicate } from '../../shared/object-list/duplicate-data/duplicate.model'; @@ -33,7 +36,8 @@ import { HALEndpointService } from '../shared/hal-endpoint.service'; * */ @Injectable({ providedIn: 'root' }) -export class SubmissionDuplicateDataService extends BaseDataService implements SearchData { +export class SubmissionDuplicateDataService extends BaseDataService + implements SearchData, OnDestroy { /** * The ResponseParsingService constructor name diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index ac8bac2f13..86ead8b825 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -7,6 +7,7 @@ import { import { Component, Inject, + OnInit, } from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -36,7 +37,7 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn /** * The component for displaying a list element for an item search result of the type Person */ -export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent { +export class PersonSearchResultListElementComponent extends ItemSearchResultListElementComponent implements OnInit { public constructor( protected truncatableService: TruncatableService, diff --git a/src/app/home-page/recent-item-list/recent-item-list.component.ts b/src/app/home-page/recent-item-list/recent-item-list.component.ts index 351677fce4..65c1998b7a 100644 --- a/src/app/home-page/recent-item-list/recent-item-list.component.ts +++ b/src/app/home-page/recent-item-list/recent-item-list.component.ts @@ -10,6 +10,7 @@ import { Component, ElementRef, Inject, + OnDestroy, OnInit, PLATFORM_ID, } from '@angular/core'; @@ -62,7 +63,7 @@ import { VarDirective } from '../../shared/utils/var.directive'; standalone: true, imports: [VarDirective, NgIf, NgClass, NgFor, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) -export class RecentItemListComponent implements OnInit { +export class RecentItemListComponent implements OnInit, OnDestroy { itemRD$: Observable>>; paginationConfig: PaginationComponentOptions; sortConfig: SortOptions; diff --git a/src/app/item-page/edit-item-page/item-status/item-status.component.ts b/src/app/item-page/edit-item-page/item-status/item-status.component.ts index bbd7b99a97..1bb17dc77c 100644 --- a/src/app/item-page/edit-item-page/item-status/item-status.component.ts +++ b/src/app/item-page/edit-item-page/item-status/item-status.component.ts @@ -7,6 +7,7 @@ import { import { ChangeDetectionStrategy, Component, + OnDestroy, OnInit, } from '@angular/core'; import { @@ -79,7 +80,7 @@ import { ItemOperation } from '../item-operation/itemOperation.model'; /** * Component for displaying an item's status */ -export class ItemStatusComponent implements OnInit { +export class ItemStatusComponent implements OnInit, OnDestroy { /** * The item to display the status for diff --git a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts index 0f02d7083c..dfc7fac526 100644 --- a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts +++ b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts @@ -2,6 +2,7 @@ import { CommonModule } from '@angular/common'; import { Component, Input, + OnChanges, OnDestroy, OnInit, SimpleChanges, @@ -56,7 +57,7 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio ], standalone: true, }) -export class OrcidQueueComponent implements OnInit, OnDestroy { +export class OrcidQueueComponent implements OnInit, OnDestroy, OnChanges { /** * The item for which showing the orcid settings diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts index 4b31e2316a..b2d45916d2 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts @@ -6,6 +6,7 @@ import { Component, EventEmitter, Input, + OnDestroy, OnInit, } from '@angular/core'; import { FormsModule } from '@angular/forms'; @@ -110,7 +111,7 @@ export interface QualityAssuranceEventData { * Component to display a modal window for linking a project to an Quality Assurance event * Shows information about the selected project and a selectable list. */ -export class ProjectEntryImportModalComponent implements OnInit { +export class ProjectEntryImportModalComponent implements OnInit, OnDestroy { /** * The external source entry */ diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.ts b/src/app/notifications/qa/source/quality-assurance-source.component.ts index a918b8c3b6..c7457c5d2b 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.component.ts @@ -5,7 +5,9 @@ import { NgIf, } from '@angular/common'; import { + AfterViewInit, Component, + OnDestroy, OnInit, } from '@angular/core'; import { RouterLink } from '@angular/router'; @@ -40,7 +42,7 @@ import { NotificationsStateService } from '../../notifications-state.service'; standalone: true, imports: [AlertComponent, NgIf, ThemedLoadingComponent, PaginationComponent, NgFor, RouterLink, AsyncPipe, TranslateModule, DatePipe], }) -export class QualityAssuranceSourceComponent implements OnInit { +export class QualityAssuranceSourceComponent implements OnDestroy, OnInit, AfterViewInit { /** * The pagination system configuration for HTML listing. diff --git a/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts b/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts index 136466b4ac..952bf9c75b 100644 --- a/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts +++ b/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts @@ -6,6 +6,7 @@ import { import { Component, Input, + OnDestroy, OnInit, } from '@angular/core'; import { @@ -50,7 +51,7 @@ import { SuggestionTargetsStateService } from '../suggestion-targets.state.servi ], standalone: true, }) -export class PublicationClaimComponent implements OnInit { +export class PublicationClaimComponent implements OnDestroy, OnInit { /** * The source for which to list targets diff --git a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts index 7c0bf9ea2d..0fdee2080b 100644 --- a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts +++ b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts @@ -3,6 +3,7 @@ import { Component, EventEmitter, Input, + OnDestroy, OnInit, Output, } from '@angular/core'; @@ -44,7 +45,7 @@ import { NotificationsService } from '../../shared/notifications/notifications.s * Component for a user to edit their security information * Displays a form containing a password field and a confirmation of the password */ -export class ProfilePageSecurityFormComponent implements OnInit { +export class ProfilePageSecurityFormComponent implements OnDestroy, OnInit { /** * Emits the validity of the password diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts index 595a1304a0..a373c53984 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts @@ -6,11 +6,13 @@ import { NgTemplateOutlet, } from '@angular/common'; import { + AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, ContentChildren, + DoCheck, EventEmitter, Inject, Input, @@ -143,7 +145,8 @@ import { DsDynamicLookupRelationModalComponent } from './relation-lookup-modal/d ], standalone: true, }) -export class DsDynamicFormControlContainerComponent extends DynamicFormControlContainerComponent implements OnInit, OnChanges, OnDestroy { +export class DsDynamicFormControlContainerComponent extends DynamicFormControlContainerComponent + implements OnInit, OnChanges, OnDestroy, AfterViewInit, DoCheck { @ContentChildren(DynamicTemplateDirective) contentTemplateList: QueryList; // eslint-disable-next-line @angular-eslint/no-input-rename @Input('templates') inputTemplateList: QueryList; diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts index 23cec6b502..22f8dce244 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts @@ -9,6 +9,7 @@ import { Component, EventEmitter, Input, + OnDestroy, OnInit, Output, ViewChild, @@ -92,7 +93,7 @@ import { DynamicOneboxModel } from './dynamic-onebox.model'; ], standalone: true, }) -export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent implements OnInit { +export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent implements OnDestroy, OnInit { @Input() group: UntypedFormGroup; @Input() model: DynamicOneboxModel; diff --git a/src/app/shared/form/number-picker/number-picker.component.ts b/src/app/shared/form/number-picker/number-picker.component.ts index e268919101..b097236659 100644 --- a/src/app/shared/form/number-picker/number-picker.component.ts +++ b/src/app/shared/form/number-picker/number-picker.component.ts @@ -4,6 +4,7 @@ import { Component, EventEmitter, Input, + OnChanges, OnInit, Output, SimpleChanges, @@ -36,7 +37,7 @@ import { isEmpty } from '../../empty.util'; standalone: true, }) -export class NumberPickerComponent implements OnInit, ControlValueAccessor { +export class NumberPickerComponent implements OnChanges, OnInit, ControlValueAccessor { @Input() id: string; @Input() step: number; @Input() min: number; diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index 8afafa2b86..26a1d7e655 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -4,7 +4,10 @@ import { NgFor, NgIf, } from '@angular/common'; -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { Item } from '../../../../../../core/shared/item.model'; @@ -30,7 +33,7 @@ import { SearchResultListElementComponent } from '../../../search-result-list-el /** * The component for displaying a list element for an item search result of the type Publication */ -export class ItemSearchResultListElementComponent extends SearchResultListElementComponent { +export class ItemSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { /** * Route to the item's page */ diff --git a/src/app/submission/form/collection/submission-form-collection.component.ts b/src/app/submission/form/collection/submission-form-collection.component.ts index dcbcfd9cb3..2aec1c9e30 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.ts @@ -5,6 +5,7 @@ import { EventEmitter, Input, OnChanges, + OnDestroy, OnInit, Output, SimpleChanges, @@ -58,7 +59,7 @@ import { SubmissionService } from '../../submission.service'; ThemedCollectionDropdownComponent, ], }) -export class SubmissionFormCollectionComponent implements OnChanges, OnInit { +export class SubmissionFormCollectionComponent implements OnDestroy, OnChanges, OnInit { /** * The current collection id this submission belonging to diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts index e694a868ca..3632ec6760 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts @@ -3,6 +3,7 @@ import { Component, Input, OnChanges, + OnDestroy, } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { @@ -43,7 +44,7 @@ import parseSectionErrors from '../../utils/parseSectionErrors'; ], standalone: true, }) -export class SubmissionUploadFilesComponent implements OnChanges { +export class SubmissionUploadFilesComponent implements OnChanges, OnDestroy { /** * The collection id this submission belonging to diff --git a/src/app/submission/sections/duplicates/section-duplicates.component.ts b/src/app/submission/sections/duplicates/section-duplicates.component.ts index d90a0ca85a..885511ca52 100644 --- a/src/app/submission/sections/duplicates/section-duplicates.component.ts +++ b/src/app/submission/sections/duplicates/section-duplicates.component.ts @@ -7,6 +7,7 @@ import { ChangeDetectionStrategy, Component, Inject, + OnInit, } from '@angular/core'; import { TranslateModule, @@ -48,7 +49,7 @@ import { SectionsService } from '../sections.service'; standalone: true, }) -export class SubmissionSectionDuplicatesComponent extends SectionModelComponent { +export class SubmissionSectionDuplicatesComponent extends SectionModelComponent implements OnInit { protected readonly Metadata = Metadata; /** * The Alert categories. From ecacd14410b9ba2441c3b05caf26487d4a5c282b Mon Sep 17 00:00:00 2001 From: Emmanuel Pastor Date: Sun, 7 Jul 2024 16:04:14 +0200 Subject: [PATCH 07/51] Fix a french translation for consistency --- src/assets/i18n/fr.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/i18n/fr.json5 b/src/assets/i18n/fr.json5 index 8dc8c95a39..35179a459e 100644 --- a/src/assets/i18n/fr.json5 +++ b/src/assets/i18n/fr.json5 @@ -6389,7 +6389,7 @@ "submission.workspace.generic.view": "Voir", // "submission.workspace.generic.view-help": "Select this option to view the item's metadata.", - "submission.workspace.generic.view-help": "Sélectionner cette option pour voir les métadonnées de l'item.", + "submission.workspace.generic.view-help": "Sélectionner cette option pour afficher les métadonnées de l'item.", // "thumbnail.default.alt": "Thumbnail Image", "thumbnail.default.alt": "Vignette d'image", From eec1071f0652a3ad1056e6665da388b761361218 Mon Sep 17 00:00:00 2001 From: Emmanuel Pastor Date: Sun, 7 Jul 2024 16:05:44 +0200 Subject: [PATCH 08/51] Rephrase one instruction sentence to make it clearer --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b381944c98..af2705ec61 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -16,7 +16,7 @@ List of changes in this PR: **Include guidance for how to test or review your PR.** This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes. ## Checklist -_This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). +_This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome). However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!_ - [ ] My PR is **small in size** (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible. From 8eec2cdccb15a6cb91532f4e97bd9dfd9ef17597 Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Fri, 12 Jul 2024 19:37:47 +0200 Subject: [PATCH 09/51] Fix a french translation for consistency --- src/assets/i18n/fr.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/i18n/fr.json5 b/src/assets/i18n/fr.json5 index 35179a459e..399363f017 100644 --- a/src/assets/i18n/fr.json5 +++ b/src/assets/i18n/fr.json5 @@ -6386,7 +6386,7 @@ "submission.workflow.tasks.pool.show-detail": "Afficher le détail", // "submission.workspace.generic.view": "View", - "submission.workspace.generic.view": "Voir", + "submission.workspace.generic.view": "Afficher", // "submission.workspace.generic.view-help": "Select this option to view the item's metadata.", "submission.workspace.generic.view-help": "Sélectionner cette option pour afficher les métadonnées de l'item.", From f4fe2b8632ea277a86bc29f764aca13a4e921e1c Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Wed, 17 Jul 2024 15:42:48 +0200 Subject: [PATCH 10/51] fix FromAsCasing warning --- Dockerfile.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.dist b/Dockerfile.dist index e4b467ae26..4c47b0cb40 100644 --- a/Dockerfile.dist +++ b/Dockerfile.dist @@ -4,7 +4,7 @@ # Test build: # docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist . -FROM node:18-alpine as build +FROM node:18-alpine AS build # Ensure Python and other build tools are available # These are needed to install some node modules, especially on linux/arm64 From 351abaa5c2071c3bc56c72abf2bdc8cfb22062a9 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 25 Jul 2024 10:44:00 -0300 Subject: [PATCH 11/51] Removing position-fixed bootstrap class so that navbar links are available again --- .../file-dropzone-no-uploader.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html index babfa91f0b..dcd1fdfef7 100644 --- a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html +++ b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html @@ -1,12 +1,12 @@
+ class="ds-document-drop-zone-inner h-100 w-100 p-2">

{{ dropMessageLabel | translate}}

From 2c259f5ae937a26f37b0dd00ea46b70f4fef7e0d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 30 Jul 2024 17:20:47 -0300 Subject: [PATCH 12/51] A new approach so that the elements of the ds-file-dropzone-no-uploader component don't overlap the navbar and make it inaccessible --- .../file-dropzone-no-uploader.component.html | 4 ++-- .../file-dropzone-no-uploader.scss | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html index dcd1fdfef7..babfa91f0b 100644 --- a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html +++ b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html @@ -1,12 +1,12 @@
+ class="ds-document-drop-zone-inner position-fixed h-100 w-100 p-2">

{{ dropMessageLabel | translate}}

diff --git a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.scss b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.scss index 5d06cd5718..91eb2ae868 100644 --- a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.scss +++ b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.scss @@ -6,10 +6,16 @@ top: 0; left: 0; z-index: -1; + display: block; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease, visibility 0.3s ease; } .ds-document-drop-zone-active { z-index: var(--ds-drop-zone-area-z-index) !important; + opacity: 1; + visibility: visible; } .ds-document-drop-zone-inner { From ce2abfe584b3cabb71730882025c6baf8bd7bd4b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Aug 2024 13:04:17 -0300 Subject: [PATCH 13/51] Improving the file browser for importing metadata --- .../file-dropzone-no-uploader.component.html | 4 ++-- .../file-dropzone-no-uploader.component.ts | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html index babfa91f0b..38c2af97fc 100644 --- a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html +++ b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.html @@ -19,9 +19,9 @@ {{ ((fileObject === null || fileObject === undefined) ? dropMessageLabel : dropMessageLabelReplacement) | translate}} {{'uploader.or' | translate}}

diff --git a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts index 8c04bd264b..e937b1ea0f 100644 --- a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts +++ b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts @@ -54,7 +54,7 @@ export class FileDropzoneNoUploaderComponent implements OnInit { /** * The function to call when file is added */ - @Output() onFileAdded: EventEmitter = new EventEmitter(); + @Output() onFileAdded: EventEmitter = new EventEmitter(); /** * The uploader configuration options @@ -83,15 +83,17 @@ export class FileDropzoneNoUploaderComponent implements OnInit { } @HostListener('window:drop', ['$event']) - onDrop(event: any) { + onDrop(event: DragEvent) { event.preventDefault(); + event.stopPropagation(); } @HostListener('window:dragover', ['$event']) - onDragOver(event: any) { + onDragOver(event: DragEvent) { // Show drop area on the page event.preventDefault(); - if ((event.target as any).tagName !== 'HTML') { + event.stopPropagation(); + if ((event.target as HTMLElement).tagName !== 'HTML') { this.isOverDocumentDropZone = observableOf(true); } } @@ -105,11 +107,18 @@ export class FileDropzoneNoUploaderComponent implements OnInit { } } + public handleFileInput(event: Event) { + const input = event.target as HTMLInputElement; + if (input.files && input.files.length > 0) { + this.setFile(input.files); + } + } + /** * Set file * @param files */ - setFile(files) { + public setFile(files: FileList) { this.fileObject = files.length > 0 ? files[0] : undefined; this.onFileAdded.emit(this.fileObject); } From bfd61b2f19ceb4f078bead11b5daed9bd22acba3 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 6 Aug 2024 15:40:16 +0200 Subject: [PATCH 14/51] Fix typos discovered by codespell --- README.md | 2 +- config/config.example.yml | 2 +- cypress/e2e/homepage-statistics.cy.ts | 2 +- cypress/e2e/login-modal.cy.ts | 2 +- cypress/e2e/pagenotfound.cy.ts | 2 +- cypress/e2e/submission.cy.ts | 4 ++-- docs/Configuration.md | 2 +- scripts/merge-i18n-files.ts | 2 +- server.ts | 4 ++-- .../ldn-services-model/ldn-service-status.model.ts | 2 +- .../bitstream-formats.component.spec.ts | 4 ++-- .../bitstream-formats/bitstream-formats.component.ts | 2 +- .../format-form/format-form.component.ts | 8 ++++---- .../browse-by-taxonomy.component.ts | 2 +- .../collection-metadata.component.ts | 2 +- src/app/core/cache/object-cache.reducer.ts | 2 +- src/app/core/data/access-status-data.service.spec.ts | 8 ++++---- src/app/core/data/bitstream-data.service.spec.ts | 12 ++++++------ src/app/core/data/bitstream-data.service.ts | 2 +- src/app/core/data/collection-data.service.spec.ts | 12 ++++++------ src/app/core/services/link-head.service.ts | 2 +- src/app/core/services/server-xhr.service.ts | 2 +- src/app/core/shared/metadata-config.model.ts | 2 +- src/app/core/shared/search/search.service.ts | 2 +- .../submission/submission-object-data.service.ts | 2 +- .../dso-edit-metadata/dso-edit-metadata.component.ts | 2 +- .../item-pages/org-unit/org-unit.component.html | 2 +- .../item-pages/org-unit/org-unit.component.spec.ts | 2 +- src/app/init.service.ts | 4 ++-- .../bitstream-request-a-copy-page.component.ts | 2 +- .../edit-relationship-list.component.spec.ts | 2 +- .../metadata-uri-values.component.ts | 2 +- .../metadata-values/metadata-values.component.ts | 2 +- .../media-viewer-image.component.ts | 2 +- .../item-page-cc-license-field.component.ts | 4 ++-- .../my-dspace-new-submission-dropdown.component.ts | 2 +- .../my-dspace-new-submission.component.ts | 2 +- .../qa/events/quality-assurance-events.component.ts | 4 ++-- .../project-entry-import-modal.component.ts | 2 +- .../qa/source/quality-assurance-source.component.ts | 2 +- .../qa/topics/quality-assurance-topics.component.ts | 6 +++--- .../publication-claim/publication-claim.component.ts | 2 +- src/app/search-navbar/search-navbar.component.ts | 2 +- .../dso-edit-menu-section.component.ts | 2 +- .../dso-withdrawn-reinstate-modal.service.ts | 2 +- .../entity-dropdown/entity-dropdown.component.ts | 2 +- .../vocabulary-treeview-modal.component.spec.ts | 2 +- src/app/shared/menu/menu-id.model.ts | 2 +- .../dspace-rest/endpoint-mocking-rest.service.ts | 2 +- .../object-list/duplicate-data/duplicate.model.ts | 2 +- ...owse-link-metadata-list-element.component.spec.ts | 2 +- .../collection-select/collection-select.component.ts | 2 +- .../item-select/item-select.component.ts | 2 +- src/app/shared/rss-feed/rss.component.ts | 2 +- src/app/shared/search/models/search-options.model.ts | 2 +- .../search-facet-range-option.component.spec.ts | 2 +- .../search-range-filter.component.ts | 2 +- .../subscription-view.component.spec.ts | 2 +- .../section-coar-notify.component.ts | 2 +- src/app/submission/sections/sections.service.ts | 2 +- .../metadata-information.component.ts | 2 +- .../publisher-policy/publisher-policy.component.ts | 2 +- .../section-sherpa-policies.component.ts | 2 +- .../system-wide-alert-form.component.spec.ts | 8 ++++---- src/modules/app/server-init.service.ts | 2 +- src/typings.d.ts | 2 +- 66 files changed, 93 insertions(+), 93 deletions(-) diff --git a/README.md b/README.md index ebc24f8b91..39ad9d7dde 100644 --- a/README.md +++ b/README.md @@ -527,7 +527,7 @@ Frequently asked questions - What are the naming conventions for Angular? - See [the official angular style guide](https://angular.io/styleguide) - Why is the size of my app larger in development? - - The production build uses a whole host of techniques (ahead-of-time compilation, rollup to remove unreachable code, minification, etc.) to reduce the size, that aren't used during development in the intrest of build speed. + - The production build uses a whole host of techniques (ahead-of-time compilation, rollup to remove unreachable code, minification, etc.) to reduce the size, that aren't used during development in the interest of build speed. - node-pre-gyp ERR in yarn install (Windows) - install Python x86 version between 2.5 and 3.0 on windows. See [this issue](https://github.com/AngularClass/angular2-webpack-starter/issues/626) - How do I handle merge conflicts in yarn.lock? diff --git a/config/config.example.yml b/config/config.example.yml index 93386274e6..86f608e5a3 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -59,7 +59,7 @@ cache: # Set to true to see all cache hits/misses/refreshes in your console logs. Useful for debugging SSR caching issues. debug: false # When enabled (i.e. max > 0), known bots will be sent pages from a server side cache specific for bots. - # (Keep in mind, bot detection cannot be guarranteed. It is possible some bots will bypass this cache.) + # (Keep in mind, bot detection cannot be guaranteed. It is possible some bots will bypass this cache.) botCache: # Maximum number of pages to cache for known bots. Set to zero (0) to disable server side caching for bots. # Default is 1000, which means the 1000 most recently accessed public pages will be cached. diff --git a/cypress/e2e/homepage-statistics.cy.ts b/cypress/e2e/homepage-statistics.cy.ts index f9642c0c83..0e0fca3c5b 100644 --- a/cypress/e2e/homepage-statistics.cy.ts +++ b/cypress/e2e/homepage-statistics.cy.ts @@ -17,7 +17,7 @@ describe('Site Statistics Page', () => { cy.visit('/statistics'); - // tag must be visable + // tag must be visible cy.get('ds-site-statistics-page').should('be.visible'); // Verify / wait until "Total Visits" table's *last* label is non-empty diff --git a/cypress/e2e/login-modal.cy.ts b/cypress/e2e/login-modal.cy.ts index 3d978dfaca..ec218e80af 100644 --- a/cypress/e2e/login-modal.cy.ts +++ b/cypress/e2e/login-modal.cy.ts @@ -142,7 +142,7 @@ describe('Login Modal', () => { page.submitLoginAndPasswordByPressingButton(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); cy.get('ds-log-in').should('not.exist'); - // Open user menu, verify user menu accesibility + // Open user menu, verify user menu accessibility page.openUserMenu(); cy.get('ds-user-menu').should('be.visible'); testA11y('ds-user-menu'); diff --git a/cypress/e2e/pagenotfound.cy.ts b/cypress/e2e/pagenotfound.cy.ts index 968ae2747b..5f84a22df9 100644 --- a/cypress/e2e/pagenotfound.cy.ts +++ b/cypress/e2e/pagenotfound.cy.ts @@ -1,7 +1,7 @@ import { testA11y } from 'cypress/support/utils'; describe('PageNotFound', () => { - it('should contain element ds-pagenotfound when navigating to page that doesnt exist', () => { + it('should contain element ds-pagenotfound when navigating to page that does not exist', () => { // request an invalid page (UUIDs at root path aren't valid) cy.visit('/e9019a69-d4f1-4773-b6a3-bd362caa46f2', { failOnStatusCode: false }); cy.get('ds-pagenotfound').should('be.visible'); diff --git a/cypress/e2e/submission.cy.ts b/cypress/e2e/submission.cy.ts index 0ac7003a8b..ebdabbde2e 100644 --- a/cypress/e2e/submission.cy.ts +++ b/cypress/e2e/submission.cy.ts @@ -34,7 +34,7 @@ describe('New Submission page', () => { // Author & Subject fields have invalid "aria-multiline" attrs. // See https://github.com/DSpace/dspace-angular/issues/1272 'aria-allowed-attr': { enabled: false }, - // All panels are accordians & fail "aria-required-children" and "nested-interactive". + // All panels are accordions & fail "aria-required-children" and "nested-interactive". // Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216 'aria-required-children': { enabled: false }, 'nested-interactive': { enabled: false }, @@ -192,7 +192,7 @@ describe('New Submission page', () => { testA11y('ds-submission-edit', { rules: { - // All panels are accordians & fail "aria-required-children" and "nested-interactive". + // All panels are accordions & fail "aria-required-children" and "nested-interactive". // Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216 'aria-required-children': { enabled: false }, 'nested-interactive': { enabled: false }, diff --git a/docs/Configuration.md b/docs/Configuration.md index 01fd83c94d..aa6be0f682 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -15,7 +15,7 @@ DSPACE_APP_CONFIG_PATH=/usr/local/dspace/config/config.yml Configuration options can be overridden by setting environment variables. ## Nodejs server -When you start dspace-angular on node, it spins up an http server on which it listens for incoming connections. You can define the ip address and port the server should bind itsself to, and if ssl should be enabled not. By default it listens on `localhost:4000`. If you want it to listen on all your network connections, configure it to bind itself to `0.0.0.0`. +When you start dspace-angular on node, it spins up an http server on which it listens for incoming connections. You can define the ip address and port the server should bind itself to, and if ssl should be enabled not. By default it listens on `localhost:4000`. If you want it to listen on all your network connections, configure it to bind itself to `0.0.0.0`. To change this configuration, change the options `ui.host`, `ui.port` and `ui.ssl` in the appropriate configuration file (see above): diff --git a/scripts/merge-i18n-files.ts b/scripts/merge-i18n-files.ts index e790828c0d..64442f5788 100644 --- a/scripts/merge-i18n-files.ts +++ b/scripts/merge-i18n-files.ts @@ -38,7 +38,7 @@ parseCliInput(); function parseCliInput() { program .option('-d, --output-dir ', 'output dir when running script on all language files', projectRoot(LANGUAGE_FILES_LOCATION)) - .option('-s, --source-dir ', 'source dir of transalations to be merged') + .option('-s, --source-dir ', 'source dir of translations to be merged') .usage('(-s [-d ])') .parse(process.argv); diff --git a/server.ts b/server.ts index 22f3423287..d0c17166ad 100644 --- a/server.ts +++ b/server.ts @@ -99,7 +99,7 @@ export function app() { * If production mode is enabled in the environment file: * - Enable Angular's production mode * - Initialize caching of SSR rendered pages (if enabled in config.yml) - * - Enable compression for SSR reponses. See [compression](https://github.com/expressjs/compression) + * - Enable compression for SSR responses. See [compression](https://github.com/expressjs/compression) */ if (environment.production) { enableProdMode(); @@ -428,7 +428,7 @@ function checkCacheForRequest(cacheName: string, cache: LRU, req, r if (environment.cache.serverSide.debug) { console.log(`CACHE EXPIRED FOR ${key} in ${cacheName} cache. Re-rendering...`); } // Update cached copy by rerendering server-side // NOTE: In this scenario the currently cached copy will be returned to the current user. - // This re-render is peformed behind the scenes to update cached copy for next user. + // This re-render is performed behind the scenes to update cached copy for next user. serverSideRender(req, res, next, false); } } else { diff --git a/src/app/admin/admin-ldn-services/ldn-services-model/ldn-service-status.model.ts b/src/app/admin/admin-ldn-services/ldn-services-model/ldn-service-status.model.ts index 040e4d37b8..e872bf9a0b 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-model/ldn-service-status.model.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-model/ldn-service-status.model.ts @@ -2,7 +2,7 @@ * List of services statuses */ export enum LdnServiceStatus { - UNKOWN, + UNKNOWN, DISABLED, ENABLED, } diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts index 248e60ca4b..8f692ecad6 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts @@ -190,12 +190,12 @@ describe('BitstreamFormatsComponent', () => { describe('isSelected', () => { beforeEach(waitForAsync(initAsync)); beforeEach(initBeforeEach); - it('should return an observable of true if the provided bistream is in the list returned by the service', () => { + it('should return an observable of true if the provided bitstream is in the list returned by the service', () => { const result = comp.isSelected(bitstreamFormat1); expect(result).toBeObservable(cold('b', { b: true })); }); - it('should return an observable of false if the provided bistream is not in the list returned by the service', () => { + it('should return an observable of false if the provided bitstream is not in the list returned by the service', () => { const format = new BitstreamFormat(); format.uuid = 'new'; diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts index 72da2fadfd..deff75262e 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts @@ -118,7 +118,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy { } /** - * Deselects all selecetd bitstream formats + * Deselects all selected bitstream formats */ deselectAll() { this.bitstreamFormatService.deselectAllBitstreamFormats(); diff --git a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts index 08889ce28b..37ae0d1dc0 100644 --- a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts @@ -154,12 +154,12 @@ export class FormatFormComponent implements OnInit { (fieldModel: DynamicFormControlModel) => { if (fieldModel.name === 'extensions') { if (hasValue(this.bitstreamFormat.extensions)) { - const extenstions = this.bitstreamFormat.extensions; + const extensions = this.bitstreamFormat.extensions; const formArray = (fieldModel as DynamicFormArrayModel); - for (let i = 0; i < extenstions.length; i++) { + for (let i = 0; i < extensions.length; i++) { formArray.insertGroup(i).group[0] = new DynamicInputModel({ id: `extension-${i}`, - value: extenstions[i], + value: extensions[i], }, this.arrayInputElementLayout); } } @@ -172,7 +172,7 @@ export class FormatFormComponent implements OnInit { } /** - * Creates an updated bistream format based on the current values in the form + * Creates an updated bitstream format based on the current values in the form * Emits the updated bitstream format trouhg the updatedFormat emitter */ onSubmit() { 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 ca6efa16b9..2372c7d0c7 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 @@ -154,7 +154,7 @@ export class BrowseByTaxonomyComponent implements OnInit, OnChanges, OnDestroy { this.facetType = browseDefinition.facetType; this.vocabularyName = browseDefinition.vocabulary; this.vocabularyOptions = { name: this.vocabularyName, closed: true }; - this.description = this.translate.instant(`browse.metadata.${this.vocabularyName}.tree.descrption`); + this.description = this.translate.instant(`browse.metadata.${this.vocabularyName}.tree.description`); })); this.subs.push(this.scope$.subscribe(() => { this.updateQueryParams(); diff --git a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts index 98127d891c..df35199755 100644 --- a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts @@ -84,7 +84,7 @@ export class CollectionMetadataComponent extends ComcolMetadataComponent { /** * Create an AccessStatusDataService used for testing - * @param reponse$ Supply a RemoteData to be returned by the REST API (optional) + * @param response$ Supply a RemoteData to be returned by the REST API (optional) */ - function createService(reponse$?: Observable>) { + function createService(response$?: Observable>) { requestService = getMockRequestService(); - let buildResponse$ = reponse$; - if (hasNoValue(reponse$)) { + let buildResponse$ = response$; + if (hasNoValue(response$)) { buildResponse$ = createSuccessfulRemoteDataObject$({}); } rdbService = jasmine.createSpyObj('rdbService', { diff --git a/src/app/core/data/bitstream-data.service.spec.ts b/src/app/core/data/bitstream-data.service.spec.ts index 95fe5f593f..91b5132ce0 100644 --- a/src/app/core/data/bitstream-data.service.spec.ts +++ b/src/app/core/data/bitstream-data.service.spec.ts @@ -138,27 +138,27 @@ describe('BitstreamDataService', () => { describe('findPrimaryBitstreamByItemAndName', () => { it('should return primary bitstream', () => { - const exprected$ = cold('(a|)', { a: bitstream1 } ); + const expected$ = cold('(a|)', { a: bitstream1 } ); const bundle = Object.assign(new Bundle(), { primaryBitstream: observableOf(createSuccessfulRemoteDataObject(bitstream1)), }); spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createSuccessfulRemoteDataObject(bundle))); - expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(exprected$); + expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(expected$); }); it('should return null if primary bitstream has not be succeeded ', () => { - const exprected$ = cold('(a|)', { a: null } ); + const expected$ = cold('(a|)', { a: null } ); const bundle = Object.assign(new Bundle(), { primaryBitstream: observableOf(createFailedRemoteDataObject()), }); spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createSuccessfulRemoteDataObject(bundle))); - expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(exprected$); + expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(expected$); }); it('should return EMPTY if nothing where found', () => { - const exprected$ = cold('(|)', {} ); + const expected$ = cold('(|)', {} ); spyOn(bundleDataService, 'findByItemAndName').and.returnValue(observableOf(createFailedRemoteDataObject())); - expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(exprected$); + expect(service.findPrimaryBitstreamByItemAndName(ItemMock, 'ORIGINAL')).toBeObservable(expected$); }); }); diff --git a/src/app/core/data/bitstream-data.service.ts b/src/app/core/data/bitstream-data.service.ts index 81d1d74535..b8776d2530 100644 --- a/src/app/core/data/bitstream-data.service.ts +++ b/src/app/core/data/bitstream-data.service.ts @@ -242,7 +242,7 @@ export class BitstreamDataService extends IdentifiableDataService imp * @param reRequestOnStale Whether or not the request should automatically be re- * requested after the response becomes stale * @return {Observable} - * Return an observable that constains primary bitstream information or null + * Return an observable that contains primary bitstream information or null */ public findPrimaryBitstreamByItemAndName(item: Item, bundleName: string, useCachedVersionIfAvailable = true, reRequestOnStale = true): Observable { return this.bundleService.findByItemAndName(item, bundleName, useCachedVersionIfAvailable, reRequestOnStale, followLink('primaryBitstream')).pipe( diff --git a/src/app/core/data/collection-data.service.spec.ts b/src/app/core/data/collection-data.service.spec.ts index 431fe941bb..f27695c326 100644 --- a/src/app/core/data/collection-data.service.spec.ts +++ b/src/app/core/data/collection-data.service.spec.ts @@ -151,7 +151,7 @@ describe('CollectionDataService', () => { expect(service.getAuthorizedCollection).toHaveBeenCalledWith(queryString); }); - it('should return a RemoteData> for the getAuthorizedCollection', () => { + it('should return a RemoteData> for the getAuthorizedCollection', () => { const result = service.getAuthorizedCollection(queryString); const expected = cold('a|', { a: paginatedListRD, @@ -166,7 +166,7 @@ describe('CollectionDataService', () => { expect(service.getAuthorizedCollectionByCommunity).toHaveBeenCalledWith(communityId, queryString); }); - it('should return a RemoteData> for the getAuthorizedCollectionByCommunity', () => { + it('should return a RemoteData> for the getAuthorizedCollectionByCommunity', () => { const result = service.getAuthorizedCollectionByCommunity(communityId, queryString); const expected = cold('a|', { a: paginatedListRD, @@ -206,12 +206,12 @@ describe('CollectionDataService', () => { /** * Create a CollectionDataService used for testing - * @param reponse$ Supply a RemoteData to be returned by the REST API (optional) + * @param response$ Supply a RemoteData to be returned by the REST API (optional) */ - function createService(reponse$?: Observable>) { + function createService(response$?: Observable>) { requestService = getMockRequestService(); - let buildResponse$ = reponse$; - if (hasNoValue(reponse$)) { + let buildResponse$ = response$; + if (hasNoValue(response$)) { buildResponse$ = createSuccessfulRemoteDataObject$({}); } rdbService = jasmine.createSpyObj('rdbService', { diff --git a/src/app/core/services/link-head.service.ts b/src/app/core/services/link-head.service.ts index 78eddf31c5..723f647108 100644 --- a/src/app/core/services/link-head.service.ts +++ b/src/app/core/services/link-head.service.ts @@ -20,7 +20,7 @@ export class LinkHeadService { /** * Method to create a Link tag in the HEAD of the html. - * @param tag LinkDefition is the paramaters to define a link tag. + * @param tag LinkDefition is the parameters to define a link tag. * @returns Link tag that was created */ addTag(tag: LinkDefinition) { diff --git a/src/app/core/services/server-xhr.service.ts b/src/app/core/services/server-xhr.service.ts index e4c50c24ea..4b58c6b127 100644 --- a/src/app/core/services/server-xhr.service.ts +++ b/src/app/core/services/server-xhr.service.ts @@ -33,7 +33,7 @@ const httpAgent = new HttpAgent(agentOptions); const httpsAgent = new HttpsAgent(agentOptions); /** - * Contructs the XMLHttpRequest instances used for all HttpClient requests. + * Constructs the XMLHttpRequest instances used for all HttpClient requests. * Emulated by https://github.com/pwnall/node-xhr2 on the server. * This class overrides the built-in Angular implementation to set additional configuration. * diff --git a/src/app/core/shared/metadata-config.model.ts b/src/app/core/shared/metadata-config.model.ts index 861d04586e..645d9c1dc8 100644 --- a/src/app/core/shared/metadata-config.model.ts +++ b/src/app/core/shared/metadata-config.model.ts @@ -3,7 +3,7 @@ */ export class MetadataConfig { /** - * A unique indentifier + * A unique identifier */ id: string; diff --git a/src/app/core/shared/search/search.service.ts b/src/app/core/shared/search/search.service.ts index fc23be1a22..60a2da6af1 100644 --- a/src/app/core/shared/search/search.service.ts +++ b/src/app/core/shared/search/search.service.ts @@ -57,7 +57,7 @@ import { SearchConfigurationService } from './search-configuration.service'; * - Overrides {@link BaseDataService.addEmbedParams} in order to make it public * * Doesn't use any of the service's dependencies, they are initialized as undefined - * Therefore, equest/response handling methods won't work even though they're defined + * Therefore, request/response handling methods won't work even though they're defined */ class SearchDataService extends BaseDataService { constructor() { diff --git a/src/app/core/submission/submission-object-data.service.ts b/src/app/core/submission/submission-object-data.service.ts index 4cf45fa84b..c044cb8129 100644 --- a/src/app/core/submission/submission-object-data.service.ts +++ b/src/app/core/submission/submission-object-data.service.ts @@ -68,7 +68,7 @@ export class SubmissionObjectDataService { environment.cache.msToLive.default, now, RequestEntryState.Error, - 'The request couldn\'t be sent. Unable to determine the type of submission object', + 'The request could not be sent. Unable to determine the type of submission object', undefined, 400, )); diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts index 677a601b9d..234a8539c4 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts @@ -244,7 +244,7 @@ export class DsoEditMetadataComponent implements OnInit, OnDestroy { /** * Submit the current changes to the form by retrieving json PATCH operations from the form and sending it to the * DSpaceObject's data-service - * Display notificiations and reset the form afterwards if successful + * Display notifications and reset the form afterwards if successful */ submit(): void { this.saving$.next(true); diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index 126845e36f..21acce9f09 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -23,7 +23,7 @@ [label]="'orgunit.page.city'"> { - describe('changes managment for add buttons', () => { + describe('changes management for add buttons', () => { it('should show enabled add buttons', () => { const element = de.query(By.css('.btn-success')); diff --git a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts b/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts index 76c7defe35..944c70f49a 100644 --- a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts +++ b/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts @@ -45,7 +45,7 @@ export class MetadataUriValuesComponent extends MetadataValuesComponent { @Input() mdValues: MetadataValue[]; /** - * The seperator used to split the metadata values (can contain HTML) + * The separator used to split the metadata values (can contain HTML) */ @Input() separator: string; diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts index 1a73d692eb..c6ff454737 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts @@ -51,7 +51,7 @@ export class MetadataValuesComponent implements OnChanges { @Input() mdValues: MetadataValue[]; /** - * The seperator used to split the metadata values (can contain HTML) + * The separator used to split the metadata values (can contain HTML) */ @Input() separator: string; diff --git a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts index f2191f074d..3acb14d3ee 100644 --- a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts @@ -17,7 +17,7 @@ import { AuthService } from '../../../core/auth/auth.service'; import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model'; /** - * This componenet render an image gallery for the image viewer + * This component render an image gallery for the image viewer */ @Component({ selector: 'ds-base-media-viewer-image', diff --git a/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts b/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts index 5d19fe4b4e..e06d0c25b5 100644 --- a/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts @@ -34,13 +34,13 @@ export class ItemPageCcLicenseFieldComponent implements OnInit { @Input() variant?: 'small' | 'full' = 'small'; /** - * Filed name containing the CC license URI, as configured in the back-end, in the 'dspace.cfg' file, propertie + * Filed name containing the CC license URI, as configured in the back-end, in the 'dspace.cfg' file, property * 'cc.license.uri' */ @Input() ccLicenseUriField? = 'dc.rights.uri'; /** - * Filed name containing the CC license name, as configured in the back-end, in the 'dspace.cfg' file, propertie + * Filed name containing the CC license name, as configured in the back-end, in the 'dspace.cfg' file, property * 'cc.license.name' */ @Input() ccLicenseNameField? = 'dc.rights'; diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts index 8604c3322c..02c714b4fb 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts @@ -120,7 +120,7 @@ export class MyDSpaceNewSubmissionDropdownComponent implements OnInit, OnDestroy } /** - * Method called on clicking the button "New Submition", It opens a dialog for + * Method called on clicking the button "New Submission", It opens a dialog for * select a collection. */ openDialog(entity: ItemType) { diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts index 8b4ddf10f6..cf7cb7ab72 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts @@ -140,7 +140,7 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit { } else { const modalRef = this.modalService.open(CollectionSelectorComponent); // When the dialog are closes its takes the collection selected and - // uploads choosed file after adds owningCollection parameter + // uploads chosen file after adds owningCollection parameter modalRef.result.then( (result) => { uploader.onBuildItemForm = (fileItem: any, form: any) => { form.append('owningCollection', result.uuid); diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.ts b/src/app/notifications/qa/events/quality-assurance-events.component.ts index 6276226c69..df6d36d226 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.ts @@ -335,7 +335,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { } /** - * Performs the choosen action calling the REST service. + * Performs the chosen action calling the REST service. * * @param {string} action * the action (can be: ACCEPTED, REJECTED, DISCARDED, PENDING) @@ -454,7 +454,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { } /** - * Dispatch the Quality Assurance events retrival. + * Dispatch the Quality Assurance events retrieval. */ public getQualityAssuranceEvents(): Observable { return this.paginationService.getFindListOptions(this.paginationConfig.id, this.defaultConfig).pipe( diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts index 4b31e2316a..0be7b783a2 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts @@ -200,7 +200,7 @@ export class ProjectEntryImportModalComponent implements OnInit { private selectService: SelectableListService) { } /** - * Component intitialization. + * Component initialization. */ public ngOnInit(): void { this.pagination = Object.assign(new PaginationComponentOptions(), { id: 'notifications-project-bound', pageSize: this.pageSize }); diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.ts b/src/app/notifications/qa/source/quality-assurance-source.component.ts index a918b8c3b6..5ee32434be 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.component.ts @@ -123,7 +123,7 @@ export class QualityAssuranceSourceComponent implements OnInit { } /** - * Dispatch the Quality Assurance source retrival. + * Dispatch the Quality Assurance source retrieval. */ public getQualityAssuranceSource(): void { this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig).pipe( diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.component.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts index 0fcaa93805..176dba95ac 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.component.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts @@ -86,13 +86,13 @@ export class QualityAssuranceTopicsComponent implements OnInit, OnDestroy, After protected subs: Subscription[] = []; /** - * This property represents a sourceId which is used to retrive a topic + * This property represents a sourceId which is used to retrieve a topic * @type {string} */ public sourceId: string; /** - * This property represents a targetId (item-id) which is used to retrive a topic + * This property represents a targetId (item-id) which is used to retrieve a topic * @type {string} */ public targetId: string; @@ -171,7 +171,7 @@ export class QualityAssuranceTopicsComponent implements OnInit, OnDestroy, After } /** - * Dispatch the Quality Assurance topics retrival. + * Dispatch the Quality Assurance topics retrieval. */ public getQualityAssuranceTopics(source: string, target?: string): void { this.subs.push(this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig).pipe( diff --git a/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts b/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts index d03bf9d653..ede5c398f9 100644 --- a/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts +++ b/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts @@ -157,7 +157,7 @@ export class PublicationClaimComponent implements OnInit { } /** - * Dispatch the Suggestion Targets retrival. + * Dispatch the Suggestion Targets retrieval. */ public getSuggestionTargets(): void { this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig).pipe( diff --git a/src/app/search-navbar/search-navbar.component.ts b/src/app/search-navbar/search-navbar.component.ts index 28971a2644..3aca706ade 100644 --- a/src/app/search-navbar/search-navbar.component.ts +++ b/src/app/search-navbar/search-navbar.component.ts @@ -31,7 +31,7 @@ export class SearchNavbarComponent { // The search form searchForm; - // Whether or not the search bar is expanded, boolean for html ngIf, string fo AngularAnimation state change + // Whether or not the search bar is expanded, boolean for html ngIf, string for AngularAnimation state change searchExpanded = false; isExpanded = 'collapsed'; diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts index 2e2397f860..5c8a1b65d6 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts @@ -48,7 +48,7 @@ export class DsoEditMenuSectionComponent extends MenuSectionComponent implements } /** - * Activate the section's model funtion + * Activate the section's model function */ public activate(event: any) { event.preventDefault(); diff --git a/src/app/shared/dso-page/dso-withdrawn-reinstate-service/dso-withdrawn-reinstate-modal.service.ts b/src/app/shared/dso-page/dso-withdrawn-reinstate-service/dso-withdrawn-reinstate-modal.service.ts index bc2cfba481..70dc48c68d 100644 --- a/src/app/shared/dso-page/dso-withdrawn-reinstate-service/dso-withdrawn-reinstate-modal.service.ts +++ b/src/app/shared/dso-page/dso-withdrawn-reinstate-service/dso-withdrawn-reinstate-modal.service.ts @@ -61,7 +61,7 @@ export class DsoWithdrawnReinstateModalService { * @param correctionType - The type of correction. * @param reason - The reason for the request. * Reloads the current page in order to update the withdrawn/reinstate button. - * and desplay a notification box. + * and display a notification box. */ sendQARequest(target: string, correctionType: 'request-reinstate' | 'request-withdrawn', reason: string): void { this.qaEventDataService.postData(target, correctionType, '', reason) diff --git a/src/app/shared/entity-dropdown/entity-dropdown.component.ts b/src/app/shared/entity-dropdown/entity-dropdown.component.ts index a02c6d8221..61bfd853ca 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.ts @@ -146,7 +146,7 @@ export class EntityDropdownComponent implements OnInit, OnDestroy { } /** - * Method used from infitity scroll for retrive more data on scroll down + * Method used from infitity scroll for retrieve more data on scroll down */ public onScrollDown() { if ( this.hasNextPage ) { diff --git a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts index fea81d1d9a..99ec27dd7d 100644 --- a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts +++ b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts @@ -43,7 +43,7 @@ describe('VocabularyTreeviewModalComponent', () => { expect(component).toBeTruthy(); }); - it('should init descrption message', () => { + it('should init description message', () => { expect((component as any).setDescription).toHaveBeenCalled(); }); }); diff --git a/src/app/shared/menu/menu-id.model.ts b/src/app/shared/menu/menu-id.model.ts index 4e7d31f467..547071aa04 100644 --- a/src/app/shared/menu/menu-id.model.ts +++ b/src/app/shared/menu/menu-id.model.ts @@ -1,5 +1,5 @@ /** - * Availavle Menu IDs + * Available Menu IDs */ export enum MenuID { ADMIN = 'admin-sidebar', diff --git a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts index ad867e0cf0..bfdbe4d6d7 100644 --- a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts +++ b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts @@ -106,7 +106,7 @@ export class EndpointMockingRestService extends DspaceRestService { * Get the mock response associated with this URL from this.mockResponseMap * * @param urlStr - * the URL to fetch a mock reponse for + * the URL to fetch a mock response for * @return any * the mock response if there is one, undefined otherwise */ diff --git a/src/app/shared/object-list/duplicate-data/duplicate.model.ts b/src/app/shared/object-list/duplicate-data/duplicate.model.ts index 646adc00ff..4524418343 100644 --- a/src/app/shared/object-list/duplicate-data/duplicate.model.ts +++ b/src/app/shared/object-list/duplicate-data/duplicate.model.ts @@ -28,7 +28,7 @@ export class Duplicate implements CacheableObject { @autoserialize uuid: string; /** - * The workfow item ID, if any + * The workflow item ID, if any */ @autoserialize workflowItemId: number; diff --git a/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts b/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts index 60f3a1566e..89048db936 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts @@ -68,7 +68,7 @@ describe('BrowseLinkMetadataListElementComponent', () => { }); }); - describe('with metadata wit an url', () => { + describe('with metadata with an url', () => { beforeEach(() => { comp.mdRepresentation = mockMetadataRepresentationWithUrl; spyOnProperty(comp.mdRepresentation, 'representationType', 'get').and.returnValue(MetadataRepresentationType.BrowseLink); diff --git a/src/app/shared/object-select/collection-select/collection-select.component.ts b/src/app/shared/object-select/collection-select/collection-select.component.ts index 267d8a2a60..a4fa227e6b 100644 --- a/src/app/shared/object-select/collection-select/collection-select.component.ts +++ b/src/app/shared/object-select/collection-select/collection-select.component.ts @@ -46,7 +46,7 @@ export class CollectionSelectComponent extends ObjectSelectComponent /** * Collection of all the data that is used to display the {@link Collection} in the HTML. - * By collecting this data here it doesn't need to be recalculated on evey change detection. + * By collecting this data here it doesn't need to be recalculated on every change detection. */ selectCollections$: Observable[]>; diff --git a/src/app/shared/object-select/item-select/item-select.component.ts b/src/app/shared/object-select/item-select/item-select.component.ts index 973b4aff87..285a790c2a 100644 --- a/src/app/shared/object-select/item-select/item-select.component.ts +++ b/src/app/shared/object-select/item-select/item-select.component.ts @@ -50,7 +50,7 @@ export class ItemSelectComponent extends ObjectSelectComponent implements /** * Collection of all the data that is used to display the {@link Item} in the HTML. - * By collecting this data here it doesn't need to be recalculated on evey change detection. + * By collecting this data here it doesn't need to be recalculated on every change detection. */ selectItems$: Observable[]>; diff --git a/src/app/shared/rss-feed/rss.component.ts b/src/app/shared/rss-feed/rss.component.ts index 9865c1dd06..e089525a72 100644 --- a/src/app/shared/rss-feed/rss.component.ts +++ b/src/app/shared/rss-feed/rss.component.ts @@ -33,7 +33,7 @@ import { PaginatedSearchOptions } from '../search/models/paginated-search-option /** - * The Rss feed button componenet. + * The Rss feed button component. */ @Component({ exportAs: 'rssComponent', diff --git a/src/app/shared/search/models/search-options.model.ts b/src/app/shared/search/models/search-options.model.ts index 88866e7ef2..531d525493 100644 --- a/src/app/shared/search/models/search-options.model.ts +++ b/src/app/shared/search/models/search-options.model.ts @@ -73,7 +73,7 @@ export class SearchOptions { get encodedFixedFilter(): string { // expected format: 'arg=value' - // -> split the query agument into (arg=)(value) and only encode 'value' + // -> split the query argument into (arg=)(value) and only encode 'value' const match = this.fixedFilter.match(/^([^=]+=)(.+)$/); if (hasValue(match)) { diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts index 9c1ef496c9..3797aaf2eb 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts @@ -118,7 +118,7 @@ describe('SearchFacetRangeOptionComponent', () => { fixture.detectChanges(); }); - describe('when the updateChangeParams method is called wih a value', () => { + describe('when the updateChangeParams method is called with a value', () => { it('should update the changeQueryParams with the new parameter values', () => { comp.changeQueryParams = {}; comp.filterValue = { diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts index 1ddac22dd3..4c184aec83 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts @@ -93,7 +93,7 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple /** * Whether the sider is being controlled by the keyboard. - * Supresses any changes until the key is released. + * Suppresses any changes until the key is released. */ keyboardControl: boolean; diff --git a/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts b/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts index f922d39784..ddd81830a4 100644 --- a/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts +++ b/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts @@ -115,7 +115,7 @@ describe('SubscriptionViewComponent', () => { expect(de.query(By.css('.subscription-type'))).toBeTruthy(); }); - it('should have subscription paramenter info', () => { + it('should have subscription parameter info', () => { expect(de.query(By.css('.subscription-parameters > span'))).toBeTruthy(); }); diff --git a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts index fc501c3cd9..c47e4c644d 100644 --- a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts +++ b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts @@ -135,7 +135,7 @@ export class SubmissionSectionCoarNotifyComponent extends SectionModelComponent /** * Method called when section is initialized - * Retriev available NotifyConfigs + * Retrieve available NotifyConfigs */ setCoarNotifyConfig() { this.subs.push( diff --git a/src/app/submission/sections/sections.service.ts b/src/app/submission/sections/sections.service.ts index 8d86ee84b5..6cc064283e 100644 --- a/src/app/submission/sections/sections.service.ts +++ b/src/app/submission/sections/sections.service.ts @@ -124,7 +124,7 @@ export class SectionsService { }); }); - // Itereate over the previous error list + // Iterate over the previous error list prevErrors.forEach((error: SubmissionSectionError) => { const errorPaths: SectionErrorPath[] = parseSectionErrorPaths(error.path); diff --git a/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts b/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts index 3c30038a9a..4eb9567abb 100644 --- a/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts +++ b/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts @@ -11,7 +11,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { Metadata } from '../../../../core/submission/models/sherpa-policies-details.model'; /** - * This component represents a section that contains the matadata informations. + * This component represents a section that contains the metadata information. */ @Component({ selector: 'ds-metadata-information', diff --git a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts index 6852a32473..8cbe2f6904 100644 --- a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts +++ b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts @@ -14,7 +14,7 @@ import { AlertType } from '../../../../shared/alert/alert-type'; import { ContentAccordionComponent } from '../content-accordion/content-accordion.component'; /** - * This component represents a section that contains the publisher policy informations. + * This component represents a section that contains the publisher policy information. */ @Component({ selector: 'ds-publisher-policy', diff --git a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts index dd614abef6..86d55ce8d0 100644 --- a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts +++ b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts @@ -35,7 +35,7 @@ import { PublicationInformationComponent } from './publication-information/publi import { PublisherPolicyComponent } from './publisher-policy/publisher-policy.component'; /** - * This component represents a section for the sherpa policy informations structure. + * This component represents a section for the sherpa policy information structure. */ @Component({ selector: 'ds-section-sherpa-policies', diff --git a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts index 2616b2accf..8e0462d084 100644 --- a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts +++ b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts @@ -170,7 +170,7 @@ describe('SystemWideAlertFormComponent', () => { }); describe('save', () => { - it('should update the exising alert with the form values and show a success notification on success and navigate back', () => { + it('should update the existing alert with the form values and show a success notification on success and navigate back', () => { spyOn(comp, 'back'); comp.currentAlert = systemWideAlert; @@ -193,7 +193,7 @@ describe('SystemWideAlertFormComponent', () => { expect(requestService.setStaleByHrefSubstring).toHaveBeenCalledWith('systemwidealerts'); expect(comp.back).toHaveBeenCalled(); }); - it('should update the exising alert with the form values and show a success notification on success and not navigate back when false is provided to the save method', () => { + it('should update the existing alert with the form values and show a success notification on success and not navigate back when false is provided to the save method', () => { spyOn(comp, 'back'); comp.currentAlert = systemWideAlert; @@ -216,7 +216,7 @@ describe('SystemWideAlertFormComponent', () => { expect(requestService.setStaleByHrefSubstring).toHaveBeenCalledWith('systemwidealerts'); expect(comp.back).not.toHaveBeenCalled(); }); - it('should update the exising alert with the form values but add an empty countdown date when disabled and show a success notification on success', () => { + it('should update the existing alert with the form values but add an empty countdown date when disabled and show a success notification on success', () => { spyOn(comp, 'back'); comp.currentAlert = systemWideAlert; @@ -239,7 +239,7 @@ describe('SystemWideAlertFormComponent', () => { expect(requestService.setStaleByHrefSubstring).toHaveBeenCalledWith('systemwidealerts'); expect(comp.back).toHaveBeenCalled(); }); - it('should update the exising alert with the form values and show a error notification on error', () => { + it('should update the existing alert with the form values and show a error notification on error', () => { spyOn(comp, 'back'); (systemWideAlertDataService.put as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$()); comp.currentAlert = systemWideAlert; diff --git a/src/modules/app/server-init.service.ts b/src/modules/app/server-init.service.ts index e22feec09a..c4aa4ffba3 100644 --- a/src/modules/app/server-init.service.ts +++ b/src/modules/app/server-init.service.ts @@ -85,7 +85,7 @@ export class ServerInitService extends InitService { // Server-only initialization steps /** - * Set the {@link NGRX_STATE} key when state is serialized to be transfered + * Set the {@link NGRX_STATE} key when state is serialized to be transferred * @private */ private saveAppState() { diff --git a/src/typings.d.ts b/src/typings.d.ts index c1c86511f8..9615cf5f67 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -9,7 +9,7 @@ declare module "my-module" { export function doesSomething(value: string): string; } * - * If you're prototying and you will fix the types later you can also declare it as type any + * If you're prototyping and you will fix the types later you can also declare it as type any * declare var assert: any; * From 6c2d541b89ef99cdfe07ad66b7c1040a11cae575 Mon Sep 17 00:00:00 2001 From: Simone Ramundi Date: Wed, 7 Aug 2024 14:30:24 +0200 Subject: [PATCH 15/51] [CST-15589] Updated slider implementation in SearchRangeFilterComponent --- .../search-range-filter.component.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts index 1ddac22dd3..ac524739d4 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts @@ -91,6 +91,11 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple */ range: [number | undefined, number | undefined]; + /** + * The range currently selected by the slider + */ + sliderRange: [number | undefined, number | undefined]; + /** * Whether the sider is being controlled by the keyboard. * Supresses any changes until the key is released. @@ -145,6 +150,15 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple }; } + /** + * Updates the sliderRange property with the current slider range. + * This method is called whenever the slider value changes, but it does not immediately apply the changes. + * @param range - The current range selected by the slider + */ + onSliderChange(range: [number | undefined, number | undefined]): void { + this.sliderRange = range; + } + /** * Submits new custom range values to the range filter from the widget */ @@ -182,5 +196,4 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple shouldShowSlider(): boolean { return isPlatformBrowser(this.platformId); } - } From 56ba23fc3d6b51ed078ffa587f25503b457c97e5 Mon Sep 17 00:00:00 2001 From: Simone Ramundi Date: Wed, 7 Aug 2024 14:30:44 +0200 Subject: [PATCH 16/51] [CST-15589] Updated slider implementation in template --- .../search-range-filter.component.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.html b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.html index 672bd0be4e..6f1f95738c 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.html +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.html @@ -8,7 +8,7 @@ {{'search.filters.filter.' + filterConfig.name + '.min.label' | translate}} @@ -20,7 +20,7 @@ {{'search.filters.filter.' + filterConfig.name + '.max.label' | translate}} @@ -33,7 +33,8 @@ @@ -43,5 +44,8 @@
+
From cddceadea145069b62d306a2d4150e61877b86a2 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Wed, 7 Aug 2024 16:05:17 +0200 Subject: [PATCH 17/51] remove duplicated delete route --- .../workspaceitems-edit-page-routes.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/app/workspaceitems-edit-page/workspaceitems-edit-page-routes.ts b/src/app/workspaceitems-edit-page/workspaceitems-edit-page-routes.ts index 8f07c24edc..35cf2521c7 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-edit-page-routes.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-edit-page-routes.ts @@ -50,16 +50,6 @@ export const ROUTES: Route[] = [ }, data: { title: 'workspace-item.delete', breadcrumbKey: 'workspace-item.delete' }, }, - { - canActivate: [authenticatedGuard], - path: 'delete', - component: ThemedWorkspaceItemsDeletePageComponent, - resolve: { - dso: itemFromWorkspaceResolver, - breadcrumb: i18nBreadcrumbResolver, - }, - data: { title: 'workspace-item.delete', breadcrumbKey: 'workspace-item.delete' }, - }, ], }, ]; From 45c018f5f62fd85aae296e22fd4c0c606eaf3d96 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Wed, 7 Aug 2024 16:50:17 +0200 Subject: [PATCH 18/51] added missing translations in de.json5 (prefix workspace-item) --- src/assets/i18n/de.json5 | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/assets/i18n/de.json5 b/src/assets/i18n/de.json5 index 7f2485ab29..0749271ab0 100644 --- a/src/assets/i18n/de.json5 +++ b/src/assets/i18n/de.json5 @@ -5881,7 +5881,7 @@ "workflow-item.delete.notification.success.title": "Gelöscht", // "workflow-item.delete.notification.success.content": "This workflow item was successfully deleted", - "workflow-item.delete.notification.success.content": "Dieses Workflow-Item wurde gelöscht.", + "workflow-item.delete.notification.success.content": "Dieses Workflow-Item wurde erfolgreich gelöscht.", // "workflow-item.delete.notification.error.title": "Something went wrong", "workflow-item.delete.notification.error.title": "Das hat leider nicht funktioniert.", @@ -5926,4 +5926,37 @@ // "workflow-item.send-back.button.confirm": "Send back" "workflow-item.send-back.button.confirm": "Zurücksenden", + // "workflow-item.view.breadcrumbs": "Workflow View", + "workflow-item.view.breadcrumbs": "Workflow-Ansicht", + + // "workspace-item.view.breadcrumbs": "Workspace View", + "workspace-item.view.breadcrumbs": "Workspace-Ansicht", + + // "workspace-item.view.title": "Workspace View", + "workspace-item.view.title": "Workspace-Ansicht", + + // "workspace-item.delete.breadcrumbs": "Workspace Delete", + "workspace-item.delete.breadcrumbs": "Workspace-Item löschen", + + // "workspace-item.delete.header": "Delete workspace item", + "workspace-item.delete.header": "Workspace-Item löschen", + + // "workspace-item.delete.button.confirm": "Delete", + "workspace-item.delete.button.confirm": "Löschen", + + // "workspace-item.delete.button.cancel": "Cancel", + "workspace-item.delete.button.cancel": "Abbrechen", + + // "workspace-item.delete.notification.success.title": "Deleted", + "workspace-item.delete.notification.success.title": "Gelöscht", + + // "workspace-item.delete.title": "This workspace item was successfully deleted", + "workspace-item.delete.title": "Dieses Workspace-Item wurde erfolgreich gelöscht.", + + // "workspace-item.delete.notification.error.title": "Something went wrong", + "workspace-item.delete.notification.error.title": "Das hat leider nicht funktioniert.", + + // "workspace-item.delete.notification.error.content": "The workspace item could not be deleted", + "workspace-item.delete.notification.error.content": "Das Workspace-Item konnte nicht gelöscht werden.", + } From 92dcffcba1c9c58250f467d6d8812326b51bb919 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Wed, 7 Aug 2024 16:57:02 +0200 Subject: [PATCH 19/51] fix space issue --- src/assets/i18n/de.json5 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/assets/i18n/de.json5 b/src/assets/i18n/de.json5 index 0749271ab0..285bbfa43d 100644 --- a/src/assets/i18n/de.json5 +++ b/src/assets/i18n/de.json5 @@ -5948,7 +5948,7 @@ "workspace-item.delete.button.cancel": "Abbrechen", // "workspace-item.delete.notification.success.title": "Deleted", - "workspace-item.delete.notification.success.title": "Gelöscht", + "workspace-item.delete.notification.success.title": "Gelöscht", // "workspace-item.delete.title": "This workspace item was successfully deleted", "workspace-item.delete.title": "Dieses Workspace-Item wurde erfolgreich gelöscht.", @@ -5958,5 +5958,4 @@ // "workspace-item.delete.notification.error.content": "The workspace item could not be deleted", "workspace-item.delete.notification.error.content": "Das Workspace-Item konnte nicht gelöscht werden.", - } From ad6a9438de13f861a9096768e6efdacccbfdeaf4 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 8 Aug 2024 16:49:20 -0500 Subject: [PATCH 20/51] Fix lint error regarding missing interface --- .../publication-claim/publication-claim.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts b/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts index 5128c88468..a111fcd704 100644 --- a/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts +++ b/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts @@ -4,6 +4,7 @@ import { NgIf, } from '@angular/common'; import { + AfterViewInit, Component, Input, OnDestroy, @@ -51,7 +52,7 @@ import { SuggestionTargetsStateService } from '../suggestion-targets.state.servi ], standalone: true, }) -export class PublicationClaimComponent implements OnDestroy, OnInit { +export class PublicationClaimComponent implements AfterViewInit, OnDestroy, OnInit { /** * The source for which to list targets From a0515c412140184c23cface4febb5d48f0d430eb Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 13 Aug 2024 11:43:36 +0200 Subject: [PATCH 21/51] 110615: Fixed related entities ay11 tab issue & removed potential duplicate ID issue by removing the unused #browseDropdown ID --- .../tabbed-related-entities-search.component.html | 8 +++++--- .../expandable-navbar-section.component.html | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.html b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.html index 223d4a6ed0..3ce96b2ce3 100644 --- a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.html +++ b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.html @@ -1,7 +1,9 @@ -