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/features/metadata/metadata.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
(updateSelectedSubjects)="updateSelectedSubjects($event)"
[isSubjectsUpdating]="isSubjectsUpdating()!"
[selectedSubjects]="selectedSubjects()"
[readonly]="!hasWriteAccess()"
[readonly]="!hasAdminAccess()"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ <h3>{{ 'preprints.preprintStepper.review.sections.metadata.tags' | translate }}<

<div class="flex flex-wrap gap-2">
@for (tag of preprintValue.tags; track tag) {
<p-tag [value]="tag" severity="info" />
<p-tag
class="cursor-pointer hover:bg-black-alpha-10"
[value]="tag"
severity="info"
(click)="tagClicked(tag)"
/>
} @empty {
<p>{{ 'common.labels.none' | translate }}</p>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { Skeleton } from 'primeng/skeleton';
import { Tag } from 'primeng/tag';

import { DatePipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, computed, effect, input } from '@angular/core';
import { ChangeDetectionStrategy, Component, computed, effect, inject, input } from '@angular/core';
import { Router } from '@angular/router';

import { CitationSectionComponent } from '@osf/features/preprints/components/preprint-details/citation-section/citation-section.component';
import { PreprintSelectors } from '@osf/features/preprints/store/preprint';
Expand Down Expand Up @@ -39,6 +40,7 @@ export class AdditionalInfoComponent {
private actions = createDispatchMap({
fetchSubjects: FetchSelectedSubjects,
});
private router = inject(Router);

preprintProviderId = input.required<string>();

Expand Down Expand Up @@ -67,4 +69,8 @@ export class AdditionalInfoComponent {
this.actions.fetchSubjects(this.preprint()!.id, ResourceType.Preprint);
});
}

tagClicked(tag: string) {
this.router.navigate(['/search'], { queryParams: { search: tag } });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@
@if (fileVersions().length) {
@let fileVersionsValue = fileVersions();

<div class="flex flex-column align-items-start sm:flex-row sm:justify-content-between sm:align-items-center">
<div
class="flex flex-column gap-3 align-items-start sm:flex-row sm:justify-content-between sm:align-items-center"
>
<p>{{ fileVersionsValue[0].name }}</p>
<p>{{ 'preprints.details.file.version' | translate: { version: fileVersionsValue[0].id } }}</p>
<p class="white-space-nowrap">
{{ 'preprints.details.file.version' | translate: { version: fileVersionsValue[0].id } }}
</p>
<p-button
class="white-space-nowrap"
severity="secondary"
[label]="'preprints.details.file.downloadPreviousVersion' | translate"
(click)="versionsMenu.toggle($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ <h3>{{ 'preprints.preprintStepper.review.sections.metadata.tags' | translate }}<

<div class="flex flex-wrap gap-2">
@for (tag of preprintValue.tags; track tag) {
<p-tag [value]="tag" severity="info" />
<p-tag
class="cursor-pointer hover:bg-black-alpha-10"
[value]="tag"
severity="info"
(click)="tagClicked(tag)"
/>
} @empty {
<p>{{ 'common.labels.none' | translate }}</p>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { Skeleton } from 'primeng/skeleton';
import { Tag } from 'primeng/tag';

import { DatePipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, computed, effect, input, OnDestroy, output } from '@angular/core';
import { ChangeDetectionStrategy, Component, computed, effect, inject, input, OnDestroy, output } from '@angular/core';
import { Router } from '@angular/router';

import { ApplicabilityStatus, PreregLinkInfo } from '@osf/features/preprints/enums';
import { PreprintProviderDetails } from '@osf/features/preprints/models';
Expand Down Expand Up @@ -57,6 +58,8 @@ export class PreprintTombstoneComponent implements OnDestroy {
fetchPreprintById: FetchPreprintById,
fetchSubjects: FetchSelectedSubjects,
});
private router = inject(Router);

preprintVersionSelected = output<string>();

preprintProvider = input.required<PreprintProviderDetails | undefined>();
Expand Down Expand Up @@ -93,4 +96,8 @@ export class PreprintTombstoneComponent implements OnDestroy {
ngOnDestroy(): void {
this.actions.resetContributorsState();
}

tagClicked(tag: string) {
this.router.navigate(['/search'], { queryParams: { search: tag } });
}
}
Loading