From 728bde4bf0eb7f49b9c30b21bfd41596cebbf30b Mon Sep 17 00:00:00 2001 From: nsemets Date: Sun, 28 Sep 2025 21:30:36 +0300 Subject: [PATCH 1/3] fix(contributors): pagination bug --- .../add-contributor-dialog.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.ts b/src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.ts index 6c497e4b8..b535c92c8 100644 --- a/src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.ts +++ b/src/app/shared/components/contributors/add-contributor-dialog/add-contributor-dialog.component.ts @@ -97,7 +97,11 @@ export class AddContributorDialogComponent implements OnInit, OnDestroy { filter((searchTerm) => !!searchTerm && searchTerm.trim().length > 0), debounceTime(500), distinctUntilChanged(), - switchMap((searchTerm) => this.actions.searchUsers(searchTerm, this.currentPage())), + switchMap((searchTerm) => { + this.currentPage.set(1); + this.first.set(0); + return this.actions.searchUsers(searchTerm, this.currentPage()); + }), takeUntilDestroyed(this.destroyRef) ) .subscribe(() => { From f153ec00b92dcf13084ddb80a96243d33ea384c4 Mon Sep 17 00:00:00 2001 From: nsemets Date: Sun, 28 Sep 2025 21:31:11 +0300 Subject: [PATCH 2/3] fix(preprints): fixed navigation after edit preprint --- .../review-step/review-step.component.ts | 20 +++++++++---------- .../update-preprint-stepper.component.ts | 19 ++++++++---------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/app/features/preprints/components/stepper/review-step/review-step.component.ts b/src/app/features/preprints/components/stepper/review-step/review-step.component.ts index 5640ab6e3..b0e69aa0d 100644 --- a/src/app/features/preprints/components/stepper/review-step/review-step.component.ts +++ b/src/app/features/preprints/components/stepper/review-step/review-step.component.ts @@ -11,7 +11,7 @@ import { DatePipe, TitleCasePipe } from '@angular/common'; import { ChangeDetectionStrategy, Component, computed, inject, input, OnInit } from '@angular/core'; import { Router, RouterLink } from '@angular/router'; -import { ApplicabilityStatus, PreregLinkInfo, ReviewsState } from '@osf/features/preprints/enums'; +import { ApplicabilityStatus, PreregLinkInfo } from '@osf/features/preprints/enums'; import { PreprintProviderDetails } from '@osf/features/preprints/models'; import { FetchLicenses, @@ -59,7 +59,9 @@ export class ReviewStepComponent implements OnInit { submitPreprint: SubmitPreprint, fetchResourceInstitutions: FetchResourceInstitutions, }); + provider = input.required(); + preprint = select(PreprintStepperSelectors.getPreprint); isPreprintSubmitting = select(PreprintStepperSelectors.isPreprintSubmitting); @@ -83,16 +85,12 @@ export class ReviewStepComponent implements OnInit { } submitPreprint() { - if (this.preprint()?.reviewsState !== ReviewsState.Accepted) { - this.actions.submitPreprint().subscribe({ - complete: () => { - this.toastService.showSuccess('preprints.preprintStepper.common.successMessages.preprintSubmitted'); - this.router.navigate(['/preprints', this.provider()!.id, this.preprint()!.id]); - }, - }); - } else { - this.toastService.showSuccess('preprints.preprintStepper.common.successMessages.preprintSubmitted'); - } + this.actions.submitPreprint().subscribe({ + complete: () => { + this.toastService.showSuccess('preprints.preprintStepper.common.successMessages.preprintSubmitted'); + this.router.navigate(['/preprints', this.provider()!.id, this.preprint()!.id]); + }, + }); } cancelSubmission() { diff --git a/src/app/features/preprints/pages/update-preprint-stepper/update-preprint-stepper.component.ts b/src/app/features/preprints/pages/update-preprint-stepper/update-preprint-stepper.component.ts index 5c4281755..0136d4e05 100644 --- a/src/app/features/preprints/pages/update-preprint-stepper/update-preprint-stepper.component.ts +++ b/src/app/features/preprints/pages/update-preprint-stepper/update-preprint-stepper.component.ts @@ -81,9 +81,7 @@ export class UpdatePreprintStepperComponent implements OnInit, OnDestroy, CanDea isPreprintProviderLoading = select(PreprintProvidersSelectors.isPreprintProviderDetailsLoading); hasBeenSubmitted = select(PreprintStepperSelectors.hasBeenSubmitted); - currentUserIsAdmin = computed(() => { - return this.preprint()?.currentUserPermissions.includes(UserPermissions.Admin) || false; - }); + currentUserIsAdmin = computed(() => this.preprint()?.currentUserPermissions.includes(UserPermissions.Admin) || false); editAndResubmitMode = computed(() => { const providerIsPremod = this.preprintProvider()?.reviewsWorkflow === ProviderReviewsWorkflow.PreModeration; @@ -130,6 +128,7 @@ export class UpdatePreprintStepperComponent implements OnInit, OnDestroy, CanDea currentStep = signal(submitPreprintSteps[0]); isWeb = toSignal(inject(IS_WEB)); + readonly SubmitStepsEnum = PreprintSteps; readonly PreprintSteps = PreprintSteps; constructor() { @@ -149,6 +148,12 @@ export class UpdatePreprintStepperComponent implements OnInit, OnDestroy, CanDea }); } + @HostListener('window:beforeunload', ['$event']) + public onBeforeUnload($event: BeforeUnloadEvent): boolean { + $event.preventDefault(); + return false; + } + canDeactivate(): Observable | boolean { return this.hasBeenSubmitted(); } @@ -181,12 +186,4 @@ export class UpdatePreprintStepperComponent implements OnInit, OnDestroy, CanDea moveToPreviousStep() { this.currentStep.set(this.updateSteps()[this.currentStep()?.index - 1]); } - - @HostListener('window:beforeunload', ['$event']) - public onBeforeUnload($event: BeforeUnloadEvent): boolean { - $event.preventDefault(); - return false; - } - - protected readonly SubmitStepsEnum = PreprintSteps; } From 9b27d304122e9937c7815aba2b635f3fa4aa9d5a Mon Sep 17 00:00:00 2001 From: nsemets Date: Mon, 29 Sep 2025 11:11:59 +0300 Subject: [PATCH 3/3] fix(bugs): fixed bugs --- .../resource-tooltip-info.component.html | 2 +- .../registration-links-card.component.html | 20 +++++++++++-------- .../registry/models/linked-nodes.models.ts | 1 - .../models/registry-components.models.ts | 1 - ...registered-contributor-dialog.component.ts | 4 ++-- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/app/features/metadata/dialogs/resource-tooltip-info/resource-tooltip-info.component.html b/src/app/features/metadata/dialogs/resource-tooltip-info/resource-tooltip-info.component.html index 78f670046..d44c216fb 100644 --- a/src/app/features/metadata/dialogs/resource-tooltip-info/resource-tooltip-info.component.html +++ b/src/app/features/metadata/dialogs/resource-tooltip-info/resource-tooltip-info.component.html @@ -6,7 +6,7 @@ {{ 'project.metadata.resourceInformation.tooltipDialog.secondaryContent' | translate: { resourceName } }}

- {{ 'project.metadata.resourceInformation.tooltipDialog.dataTypeLink' | translate }} + {{ 'project.metadata.resourceInformation.tooltipDialog.thirdContent' | translate }} - @if (registrationData()) { +@if (registrationData()) { +

-

- {{ registrationData().title || 'project.registrations.card.noTitle' | translate }} -

+
@@ -81,7 +85,7 @@

@@ -113,5 +117,5 @@

{{ 'shared.resources.title' | translate }}

- } - + +} diff --git a/src/app/features/registry/models/linked-nodes.models.ts b/src/app/features/registry/models/linked-nodes.models.ts index acfaa1265..f8f68785b 100644 --- a/src/app/features/registry/models/linked-nodes.models.ts +++ b/src/app/features/registry/models/linked-nodes.models.ts @@ -10,7 +10,6 @@ export interface LinkedNode { dateModified: string; tags: string[]; isPublic: boolean; - contributorsCount?: number; contributors?: ContributorModel[]; htmlUrl: string; apiUrl: string; diff --git a/src/app/features/registry/models/registry-components.models.ts b/src/app/features/registry/models/registry-components.models.ts index 3693f916d..3589177d1 100644 --- a/src/app/features/registry/models/registry-components.models.ts +++ b/src/app/features/registry/models/registry-components.models.ts @@ -11,7 +11,6 @@ export interface RegistryComponentModel { registrationSupplement: string; tags: string[]; isPublic: boolean; - contributorsCount?: number; contributors?: ContributorModel[]; registry?: string; } diff --git a/src/app/shared/components/contributors/add-unregistered-contributor-dialog/add-unregistered-contributor-dialog.component.ts b/src/app/shared/components/contributors/add-unregistered-contributor-dialog/add-unregistered-contributor-dialog.component.ts index e47f70cc8..946250911 100644 --- a/src/app/shared/components/contributors/add-unregistered-contributor-dialog/add-unregistered-contributor-dialog.component.ts +++ b/src/app/shared/components/contributors/add-unregistered-contributor-dialog/add-unregistered-contributor-dialog.component.ts @@ -60,8 +60,8 @@ export class AddUnregisteredContributorDialogComponent { const contributorData: ContributorAddModel = { fullName: formData.fullName, email: formData.email, - isBibliographic: false, - permission: ContributorPermission.Read, + isBibliographic: true, + permission: ContributorPermission.Write, }; const data: ContributorDialogAddModel = { data: [contributorData], type: AddContributorType.Unregistered }; this.dialogRef.close(data);