Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { GetEmails, UserEmailsSelectors } from '@core/store/user-emails';
import { ConfirmEmailComponent } from '@shared/components';

import { FullScreenLoaderComponent, ToastComponent } from './shared/components';
import { MetaTagsService } from './shared/services/meta-tags.service';
import { MetaTagsService } from './shared/services';

@Component({
selector: 'osf-root',
Expand Down
8 changes: 4 additions & 4 deletions src/app/core/constants/nav-items.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,15 @@ export const MENU_ITEMS: MenuItem[] = [
visible: false,
items: [
{
id: 'settings-profile-settings',
routerLink: '/settings/profile-settings',
id: 'settings-profile',
routerLink: '/settings/profile',
label: 'navigation.profileSettings',
visible: true,
routerLinkActiveOptions: { exact: true },
},
{
id: 'settings-account-settings',
routerLink: '/settings/account-settings',
id: 'settings-account',
routerLink: '/settings/account',
label: 'navigation.accountSettings',
visible: true,
routerLinkActiveOptions: { exact: true },
Expand Down
1 change: 1 addition & 0 deletions src/app/features/project/wiki/wiki.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
[componentsList]="componentsWikiList()"
[currentWikiId]="currentWikiId()"
[viewOnly]="hasViewOnly()"
[showAddBtn]="true"
(createWiki)="onCreateWiki()"
(deleteWiki)="onDeleteWiki()"
></osf-wiki-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
<div class="flex flex-column gap-3 mt-1">
<div class="flex flex-column gap-2">
<h2>{{ resourceName }}</h2>
<a [href]="'https://doi/' + currentResource()?.pid">https://doi/{{ currentResource()?.pid }}</a>
<a class="font-bold" [href]="'https://doi/' + currentResource()?.pid">
https://doi/{{ currentResource()?.pid }}
</a>
</div>
<p>{{ currentResource()?.description }}</p>
</div>
Expand All @@ -25,7 +27,7 @@ <h2>{{ resourceName }}</h2>
class="btn-full-width"
[label]="'common.buttons.edit' | translate"
severity="info"
(click)="backToEdit()"
(onClick)="backToEdit()"
/>
<p-button
class="btn-full-width"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ import { ResourceFormComponent } from '../resource-form/resource-form.component'
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AddResourceDialogComponent {
protected readonly dialogRef = inject(DynamicDialogRef);
protected readonly currentResource = select(RegistryResourcesSelectors.getCurrentResource);
protected readonly isCurrentResourceLoading = select(RegistryResourcesSelectors.isCurrentResourceLoading);
private translateService = inject(TranslateService);
readonly dialogRef = inject(DynamicDialogRef);
readonly currentResource = select(RegistryResourcesSelectors.getCurrentResource);
readonly isCurrentResourceLoading = select(RegistryResourcesSelectors.isCurrentResourceLoading);
private readonly translateService = inject(TranslateService);

private dialogConfig = inject(DynamicDialogConfig);
private registryId: string = this.dialogConfig.data.id;

protected inputLimits = InputLimits;
protected isResourceConfirming = signal(false);
inputLimits = InputLimits;
isResourceConfirming = signal(false);

protected form = new FormGroup<RegistryResourceFormModel>({
form = new FormGroup<RegistryResourceFormModel>({
pid: new FormControl<string | null>('', [CustomValidators.requiredTrimmed(), CustomValidators.doiValidator]),
resourceType: new FormControl<string | null>('', [Validators.required]),
description: new FormControl<string | null>(''),
Expand All @@ -60,7 +60,7 @@ export class AddResourceDialogComponent {
public resourceOptions = signal<SelectOption[]>(resourceTypeOptions);
public isPreviewMode = signal<boolean>(false);

protected readonly RegistryResourceType = RegistryResourceType;
readonly RegistryResourceType = RegistryResourceType;

previewResource(): void {
if (this.form.invalid) {
Expand All @@ -78,19 +78,15 @@ export class AddResourceDialogComponent {
throw new Error(this.translateService.instant('resources.errors.noCurrentResource'));
}

this.actions.previewResource(currentResource.id, addResource).subscribe(() => {
this.isPreviewMode.set(true);
});
this.actions.previewResource(currentResource.id, addResource).subscribe(() => this.isPreviewMode.set(true));
}

backToEdit() {
this.isPreviewMode.set(false);
}

onAddResource() {
const addResource: ConfirmAddResource = {
finalized: true,
};
const addResource: ConfirmAddResource = { finalized: true };
const currentResource = this.currentResource();

if (!currentResource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ import { ResourceFormComponent } from '../resource-form/resource-form.component'
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class EditResourceDialogComponent {
protected readonly dialogRef = inject(DynamicDialogRef);
protected readonly isCurrentResourceLoading = select(RegistryResourcesSelectors.isCurrentResourceLoading);
readonly dialogRef = inject(DynamicDialogRef);
readonly isCurrentResourceLoading = select(RegistryResourcesSelectors.isCurrentResourceLoading);
private translateService = inject(TranslateService);

private dialogConfig = inject(DynamicDialogConfig);
private registryId: string = this.dialogConfig.data.id;
private resource: RegistryResource = this.dialogConfig.data.resource as RegistryResource;

protected form = new FormGroup({
form = new FormGroup({
pid: new FormControl<string | null>('', [CustomValidators.requiredTrimmed(), CustomValidators.doiValidator]),
resourceType: new FormControl<string | null>('', [Validators.required]),
description: new FormControl<string | null>(''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h2 class="align-self-center">
<strong>{{ 'project.overview.metadata.contributors' | translate }}:</strong>
<span class="contributors">
@for (contributor of registrationData().contributors; track contributor.id) {
<a [href]="">{{ contributor.fullName }}</a>
<a class="font-bold" [routerLink]="['/user', contributor.userId]">{{ contributor.fullName }}</a>
@if (!$last) {
<span>, </span>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Card } from 'primeng/card';

import { DatePipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
import { RouterLink } from '@angular/router';

import { DataResourcesComponent, IconComponent, TruncatedTextComponent } from '@osf/shared/components';
import { RevisionReviewStates } from '@osf/shared/enums';
Expand All @@ -13,7 +14,16 @@ import { LinkedNode, LinkedRegistration, RegistryComponentModel } from '../../mo

@Component({
selector: 'osf-registration-links-card',
imports: [Card, Button, TranslatePipe, DatePipe, DataResourcesComponent, TruncatedTextComponent, IconComponent],
imports: [
Card,
Button,
TranslatePipe,
DatePipe,
DataResourcesComponent,
TruncatedTextComponent,
IconComponent,
RouterLink,
],
templateUrl: './registration-links-card.component.html',
styleUrl: './registration-links-card.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand All @@ -24,24 +34,24 @@ export class RegistrationLinksCardComponent {
readonly updateEmitRegistrationData = output<string>();
readonly reviewEmitRegistrationData = output<string>();

protected readonly RevisionReviewStates = RevisionReviewStates;
readonly RevisionReviewStates = RevisionReviewStates;

protected readonly isRegistrationData = computed(() => {
readonly isRegistrationData = computed(() => {
const data = this.registrationData();
return 'reviewsState' in data;
});

protected readonly isComponentData = computed(() => {
readonly isComponentData = computed(() => {
const data = this.registrationData();
return 'registrationSupplement' in data;
});

protected readonly registrationDataTyped = computed(() => {
readonly registrationDataTyped = computed(() => {
const data = this.registrationData();
return this.isRegistrationData() ? (data as LinkedRegistration) : null;
});

protected readonly componentsDataTyped = computed(() => {
readonly componentsDataTyped = computed(() => {
const data = this.registrationData();
return this.isComponentData() ? (data as RegistryComponentModel) : null;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,19 @@ import { RegistryOverviewSelectors, SubmitDecision } from '../../store/registry-
})
export class RegistryMakeDecisionComponent {
private readonly fb = inject(FormBuilder);
protected readonly config = inject(DynamicDialogConfig);
protected readonly dialogRef = inject(DynamicDialogRef);
readonly config = inject(DynamicDialogConfig);
readonly dialogRef = inject(DynamicDialogRef);

protected readonly ReviewActionTrigger = ReviewActionTrigger;
protected readonly SchemaResponseActionTrigger = SchemaResponseActionTrigger;
protected readonly SubmissionReviewStatus = SubmissionReviewStatus;
protected readonly ModerationDecisionFormControls = ModerationDecisionFormControls;
protected reviewActions = select(RegistryOverviewSelectors.getReviewActions);
readonly ReviewActionTrigger = ReviewActionTrigger;
readonly SchemaResponseActionTrigger = SchemaResponseActionTrigger;
readonly SubmissionReviewStatus = SubmissionReviewStatus;
readonly ModerationDecisionFormControls = ModerationDecisionFormControls;
reviewActions = select(RegistryOverviewSelectors.getReviewActions);

protected isSubmitting = select(RegistryOverviewSelectors.isReviewActionSubmitting);
protected requestForm!: FormGroup;
isSubmitting = select(RegistryOverviewSelectors.isReviewActionSubmitting);
requestForm!: FormGroup;

protected actions = createDispatchMap({
submitDecision: SubmitDecision,
});
actions = createDispatchMap({ submitDecision: SubmitDecision });

registry = this.config.data.registry as RegistryOverview;
embargoEndDate = this.registry.embargoEndDate;
Expand Down Expand Up @@ -105,7 +103,7 @@ export class RegistryMakeDecisionComponent {
});
}

protected handleSubmission(): void {
handleSubmission(): void {
const revisionId = this.config.data.revisionId;
this.actions
.submitDecision(
Expand All @@ -120,7 +118,7 @@ export class RegistryMakeDecisionComponent {
.subscribe();
}

protected isCommentRequired(action: string): boolean {
isCommentRequired(action: string): boolean {
return (
action === ReviewActionTrigger.RejectSubmission ||
action === SchemaResponseActionTrigger.RejectRevision ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ import { RevisionReviewStates } from '@shared/enums';
})
export class RegistryRevisionsComponent {
@HostBinding('class') classes = 'flex-1 flex';

registry = input.required<RegistryOverview | null>();
selectedRevisionIndex = input.required<number>();
isSubmitting = input<boolean>(false);
isModeration = input<boolean>(false);
openRevision = output<number>();

readonly updateRegistration = output<string>();
readonly continueUpdate = output<void>();
readonly RevisionReviewStates = RevisionReviewStates;

unApprovedRevisionId: string | null = null;

Expand Down Expand Up @@ -76,7 +79,6 @@ export class RegistryRevisionsComponent {
this.openRevision.emit(index);
}

protected readonly RevisionReviewStates = RevisionReviewStates;
continueUpdateHandler(): void {
this.continueUpdate.emit();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use "/styles/variables" as var;
@use "styles/mixins" as mix;

.accordion-border {
border: 1px solid var.$grey-2;
border: 1px solid var(--grey-2);
border-radius: mix.rem(12px);
height: max-content !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import { DialogService } from 'primeng/dynamicdialog';
import { ChangeDetectionStrategy, Component, computed, HostBinding, inject, input } from '@angular/core';
import { Router } from '@angular/router';

import { WithdrawDialogComponent } from '@osf/features/registry/components';
import { RegistryOverview } from '@osf/features/registry/models';
import { MakePublic } from '@osf/features/registry/store/registry-overview';
import { RegistrationReviewStates, RevisionReviewStates } from '@osf/shared/enums';
import { RegistryStatus } from '@shared/enums';
import { hasViewOnlyParam } from '@shared/helpers';
import { CustomConfirmationService } from '@shared/services';
import { RegistrationReviewStates, RegistryStatus, RevisionReviewStates } from '@osf/shared/enums';
import { hasViewOnlyParam } from '@osf/shared/helpers';
import { CustomConfirmationService } from '@osf/shared/services';

import { RegistryOverview } from '../../models';
import { MakePublic } from '../../store/registry-overview';
import { WithdrawDialogComponent } from '../withdraw-dialog/withdraw-dialog.component';

@Component({
selector: 'osf-registry-statuses',
Expand All @@ -27,15 +27,15 @@ import { CustomConfirmationService } from '@shared/services';
export class RegistryStatusesComponent {
@HostBinding('class') classes = 'flex-1 flex';
private readonly router = inject(Router);
registry = input.required<RegistryOverview | null>();
private readonly dialogService = inject(DialogService);
private readonly translateService = inject(TranslateService);

registry = input.required<RegistryOverview | null>();

readonly RegistryStatus = RegistryStatus;
readonly RevisionReviewStates = RevisionReviewStates;
readonly customConfirmationService = inject(CustomConfirmationService);
readonly actions = createDispatchMap({
makePublic: MakePublic,
});
readonly actions = createDispatchMap({ makePublic: MakePublic });

get canWithdraw(): boolean {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@

<div>
<label [for]="'coi-reason'">{{ 'resources.descriptionLabel' | translate }}</label>
<textarea class="w-full" pTextarea id="coi-reason" [rows]="3" [formControl]="getControl('description')"></textarea>
<textarea
class="w-full"
pTextarea
id="coi-reason"
[rows]="3"
[formControl]="getControl('description')"
[maxlength]="inputLimits.description.maxLength"
></textarea>
</div>

<div class="flex justify-content-between w-full gap-1">
Expand All @@ -29,7 +36,7 @@
class="btn-full-width"
[label]="cancelButtonLabel() | translate"
severity="info"
(click)="handleCancel()"
(onClick)="handleCancel()"
/>
}
<p-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export class ResourceFormComponent {
cancelClicked = output<void>();
submitClicked = output<void>();

protected inputLimits = InputLimits;
public resourceOptions = signal<SelectOption[]>(resourceTypeOptions);
inputLimits = InputLimits;
resourceOptions = signal<SelectOption[]>(resourceTypeOptions);

protected getControl(controlName: keyof RegistryResourceFormModel): FormControl<string | null> {
getControl(controlName: keyof RegistryResourceFormModel): FormControl<string | null> {
return this.formGroup().get(controlName) as FormControl<string | null>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import { environment } from 'src/environments/environment';
})
export class ShortRegistrationInfoComponent {
registration = input.required<RegistryOverview>();
protected readonly environment = environment;

readonly environment = environment;

get associatedProjectUrl(): string {
return `${this.environment.webUrl}/${this.registration().associatedProjectId}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ import { TextInputComponent } from '@shared/components';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WithdrawDialogComponent {
protected readonly dialogRef = inject(DynamicDialogRef);
readonly dialogRef = inject(DynamicDialogRef);
private readonly config = inject(DynamicDialogConfig);
private readonly actions = createDispatchMap({
withdrawRegistration: WithdrawRegistration,
});

protected readonly form = new FormGroup({
text: new FormControl(''),
});
protected readonly inputLimits = InputLimits;
private readonly actions = createDispatchMap({ withdrawRegistration: WithdrawRegistration });

readonly form = new FormGroup({ text: new FormControl('') });
readonly inputLimits = InputLimits;

withdrawRegistration(): void {
const registryId = this.config.data.registryId;
Expand Down
Loading
Loading