From 3203f81cfb92be69388989b520b2fa491c6f53f7 Mon Sep 17 00:00:00 2001 From: NazarMykhalkevych Date: Wed, 10 Sep 2025 16:32:18 +0300 Subject: [PATCH 1/8] fix(registration): fixed 594 --- .../registries-landing/registries-landing.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/features/registries/pages/registries-landing/registries-landing.component.ts b/src/app/features/registries/pages/registries-landing/registries-landing.component.ts index 9e79c0402..dd70711cb 100644 --- a/src/app/features/registries/pages/registries-landing/registries-landing.component.ts +++ b/src/app/features/registries/pages/registries-landing/registries-landing.component.ts @@ -8,6 +8,8 @@ import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/cor import { FormControl } from '@angular/forms'; import { Router } from '@angular/router'; +import { AuthService } from '@core/services'; +import { UserSelectors } from '@core/store/user'; import { RegistryServicesComponent } from '@osf/features/registries/components'; import { GetRegistries, RegistriesSelectors } from '@osf/features/registries/store'; import { @@ -37,6 +39,8 @@ import { environment } from 'src/environments/environment'; }) export class RegistriesLandingComponent implements OnInit { private router = inject(Router); + private readonly isAuthenticated = select(UserSelectors.isAuthenticated); + private readonly authService = inject(AuthService); searchControl = new FormControl(''); @@ -66,6 +70,10 @@ export class RegistriesLandingComponent implements OnInit { } goToCreateRegistration(): void { - this.router.navigate([`/registries/${environment.defaultProvider}/new`]); + if (this.isAuthenticated()) { + this.router.navigate([`/registries/${environment.defaultProvider}/new`]); + } else { + this.authService.navigateToSignIn(); + } } } From de8debf0ed84558d9c0cce736782418117b98e23 Mon Sep 17 00:00:00 2001 From: NazarMykhalkevych Date: Wed, 10 Sep 2025 22:04:15 +0300 Subject: [PATCH 2/8] fix(registration-bugs): fixed some registrations bugs --- .../file-detail/file-detail.component.ts | 4 +-- src/app/features/files/store/files.actions.ts | 5 +--- src/app/features/files/store/files.state.ts | 2 +- .../add-metadata/add-metadata.component.ts | 6 +++- ...confirm-registration-dialog.component.html | 1 + .../custom-step/custom-step.component.html | 9 ++++-- .../metadata/metadata.component.html | 3 +- .../registries-license.component.html | 1 + .../new-registration.component.html | 9 +++++- .../new-registration.component.scss | 1 + .../new-registration.component.ts | 23 +++++++++++++-- .../components/review/review.component.html | 11 ++++---- .../registries/services/projects.service.ts | 28 ------------------- .../store/handlers/projects.handlers.ts | 16 +++++++---- .../registries/store/registries.actions.ts | 5 +++- .../registries/store/registries.state.ts | 4 +-- .../generic-filter.component.html | 2 +- .../components/license/license.component.html | 3 +- .../sub-header/sub-header.component.html | 2 +- .../sub-header/sub-header.component.scss | 1 + .../truncated-text.component.ts | 10 ++++++- src/app/shared/services/files.service.ts | 4 +-- src/styles/_fonts.scss | 4 +++ 23 files changed, 91 insertions(+), 63 deletions(-) delete mode 100644 src/app/features/registries/services/projects.service.ts diff --git a/src/app/features/files/pages/file-detail/file-detail.component.ts b/src/app/features/files/pages/file-detail/file-detail.component.ts index 40ff066d9..d4c60db1a 100644 --- a/src/app/features/files/pages/file-detail/file-detail.component.ts +++ b/src/app/features/files/pages/file-detail/file-detail.component.ts @@ -183,8 +183,8 @@ export class FileDetailComponent { this.actions.getFileResourceMetadata(this.resourceId, this.resourceType); this.actions.getFileResourceContributors(this.resourceId, this.resourceType); if (fileId) { - const storageLink = this.file()?.links.download || ''; - this.actions.getFileRevisions(storageLink, fileId); + const storageLink = this.file()?.links.upload || ''; + this.actions.getFileRevisions(storageLink); this.actions.getCedarTemplates(); this.actions.getCedarRecords(fileId, ResourceType.File); } diff --git a/src/app/features/files/store/files.actions.ts b/src/app/features/files/store/files.actions.ts index 96ef709fa..a6fc56f71 100644 --- a/src/app/features/files/store/files.actions.ts +++ b/src/app/features/files/store/files.actions.ts @@ -114,10 +114,7 @@ export class SetFileMetadata { export class GetFileRevisions { static readonly type = '[Files] Get Revisions'; - constructor( - public link: string, - public fileId: string - ) {} + constructor(public link: string) {} } export class UpdateTags { diff --git a/src/app/features/files/store/files.state.ts b/src/app/features/files/store/files.state.ts index d0e977eb2..d9e572374 100644 --- a/src/app/features/files/store/files.state.ts +++ b/src/app/features/files/store/files.state.ts @@ -257,7 +257,7 @@ export class FilesState { const state = ctx.getState(); ctx.patchState({ fileRevisions: { ...state.fileRevisions, isLoading: true, error: null } }); - return this.filesService.getFileRevisions(action.link, action.fileId).pipe( + return this.filesService.getFileRevisions(action.link).pipe( tap({ next: (revisions) => { ctx.patchState({ fileRevisions: { data: revisions, isLoading: false, error: null } }); diff --git a/src/app/features/metadata/pages/add-metadata/add-metadata.component.ts b/src/app/features/metadata/pages/add-metadata/add-metadata.component.ts index 0c9b31a1f..c27330578 100644 --- a/src/app/features/metadata/pages/add-metadata/add-metadata.component.ts +++ b/src/app/features/metadata/pages/add-metadata/add-metadata.component.ts @@ -123,7 +123,11 @@ export class AddMetadataComponent implements OnInit { if (templates?.links?.first && templates?.links?.last && templates.links.first !== templates.links.last) { this.actions.getCedarTemplates(); } else { - this.router.navigate(['..'], { relativeTo: this.activatedRoute }); + if (this.resourceType() === ResourceType.File) { + this.router.navigate([this.resourceId]); + } else { + this.router.navigate(['..'], { relativeTo: this.activatedRoute }); + } } } diff --git a/src/app/features/registries/components/confirm-registration-dialog/confirm-registration-dialog.component.html b/src/app/features/registries/components/confirm-registration-dialog/confirm-registration-dialog.component.html index 9379b23c6..f4df946e2 100644 --- a/src/app/features/registries/components/confirm-registration-dialog/confirm-registration-dialog.component.html +++ b/src/app/features/registries/components/confirm-registration-dialog/confirm-registration-dialog.component.html @@ -58,6 +58,7 @@ [disabled]="isRegistrationSubmitting()" /> (keyup.enter)="inplaceRef.deactivate()" (keyup.space)="inplaceRef.deactivate()" > - @@ -207,6 +207,11 @@

{{ 'files.actions.uploadFile' | translate }}

class="mr-2" (click)="goBack()" >
- + diff --git a/src/app/features/registries/components/metadata/metadata.component.html b/src/app/features/registries/components/metadata/metadata.component.html index c877f627a..a3bb08450 100644 --- a/src/app/features/registries/components/metadata/metadata.component.html +++ b/src/app/features/registries/components/metadata/metadata.component.html @@ -13,6 +13,7 @@

{{ 'registries.metadata.title' | translate }}

- - + +
diff --git a/src/app/features/metadata/dialogs/funding-dialog/funding-dialog.component.html b/src/app/features/metadata/dialogs/funding-dialog/funding-dialog.component.html index 33a353b0b..734741348 100644 --- a/src/app/features/metadata/dialogs/funding-dialog/funding-dialog.component.html +++ b/src/app/features/metadata/dialogs/funding-dialog/funding-dialog.component.html @@ -47,7 +47,7 @@
- @if (fundingEntries.length > 1) { + @if (configFunders.length || fundingEntries.length > 1) {
- +
diff --git a/src/app/features/metadata/dialogs/funding-dialog/funding-dialog.component.ts b/src/app/features/metadata/dialogs/funding-dialog/funding-dialog.component.ts index da758e84a..b0d97c15d 100644 --- a/src/app/features/metadata/dialogs/funding-dialog/funding-dialog.component.ts +++ b/src/app/features/metadata/dialogs/funding-dialog/funding-dialog.component.ts @@ -39,6 +39,8 @@ export class FundingDialogComponent implements OnInit { private searchSubject = new Subject(); + configFunders = this.config.data?.funders; + constructor() { effect(() => { const funders = this.fundersList() || []; @@ -66,9 +68,8 @@ export class FundingDialogComponent implements OnInit { ngOnInit(): void { this.actions.getFundersList(); - const configFunders = this.config.data?.funders; - if (configFunders?.length > 0) { - configFunders.forEach((funder: Funder) => { + if (this.configFunders?.length > 0) { + this.configFunders.forEach((funder: Funder) => { this.addFundingEntry({ funderName: funder.funderName || '', funderIdentifier: funder.funderIdentifier || '', @@ -104,11 +105,10 @@ export class FundingDialogComponent implements OnInit { }), awardTitle: new FormControl(supplement?.title || supplement?.awardTitle || '', { nonNullable: true, - validators: [Validators.required], }), awardUri: new FormControl(supplement?.url || supplement?.awardUri || '', { nonNullable: true, - validators: [CustomValidators.linkValidator(), CustomValidators.requiredTrimmed()], + validators: [CustomValidators.linkValidator()], }), awardNumber: new FormControl(supplement?.awardNumber || '', { nonNullable: true, @@ -124,6 +124,11 @@ export class FundingDialogComponent implements OnInit { removeFundingEntry(index: number): void { if (this.fundingEntries.length > 1) { this.fundingEntries.removeAt(index); + } else { + const result: FundingDialogResult = { + fundingEntries: [], + }; + this.dialogRef.close(result); } } diff --git a/src/app/features/metadata/dialogs/resource-information-dialog/resource-information-dialog.component.html b/src/app/features/metadata/dialogs/resource-information-dialog/resource-information-dialog.component.html index d5a9d26f5..9882a7e53 100644 --- a/src/app/features/metadata/dialogs/resource-information-dialog/resource-information-dialog.component.html +++ b/src/app/features/metadata/dialogs/resource-information-dialog/resource-information-dialog.component.html @@ -31,10 +31,12 @@ optionValue="value" [placeholder]="'common.buttons.select' | translate" appendTo="body" + [virtualScroll]="true" + [virtualScrollItemSize]="35" class="w-full" > - {{ option.label }} + {{ option.label }} diff --git a/src/styles/overrides/button.scss b/src/styles/overrides/button.scss index 09fd79b4c..d2cf4ebb3 100644 --- a/src/styles/overrides/button.scss +++ b/src/styles/overrides/button.scss @@ -31,7 +31,7 @@ } .btn-icon-only .p-button { - padding: mix.rem(13px) mix.rem(20px); + padding: mix.rem(13px) mix.rem(21px); } .btn-full-width { From 3ef0b52387750501578bea989cdd9a40cc4f21bf Mon Sep 17 00:00:00 2001 From: NazarMykhalkevych Date: Fri, 12 Sep 2025 14:32:38 +0300 Subject: [PATCH 8/8] fix(bugs): add some area labels --- .../pages/file-detail/file-detail.component.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/features/files/pages/file-detail/file-detail.component.html b/src/app/features/files/pages/file-detail/file-detail.component.html index ffc24acfc..05c85e754 100644 --- a/src/app/features/files/pages/file-detail/file-detail.component.html +++ b/src/app/features/files/pages/file-detail/file-detail.component.html @@ -31,6 +31,7 @@ severity="secondary" class="btn-icon-only" icon="fas fa-download" + [ariaLabel]="'common.buttons.download' | translate" (click)="downloadFile(file()?.links?.download!)" /> } @@ -40,6 +41,7 @@ severity="secondary" class="btn-icon-only" icon="fas fa-file-import" + [ariaLabel]="'common.buttons.embed' | translate" (click)="embedMenu.toggle($event)" /> @@ -56,6 +58,7 @@ severity="secondary" class="btn-icon-only" icon="fas fa-share-nodes" + [ariaLabel]="'common.buttons.share' | translate" (click)="shareMenu.toggle($event)" /> @@ -67,7 +70,13 @@ } @if (file() && !isAnonymous()) { - + }