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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ <h2>{{ 'project.overview.components.title' | translate }}</h2>
<div class="flex justify-content-between align-items-center">
<h2 class="flex align-items-center gap-2">
<osf-icon [iconClass]="component.public ? 'fas fa-lock-open' : 'fas fa-lock'"></osf-icon>
<a class="node-title" [href]="component.id">{{ component.title }}</a>
<a class="node-title cursor-pointer" (click)="navigateToComponent(component.id)">
{{ component.title }}
</a>
</h2>

@if (isCurrentUserContributor(component)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ export class OverviewComponentsComponent {
});
}

navigateToComponent(componentId: string): void {
const url = this.router.serializeUrl(
this.router.createUrlTree(['/', componentId], { queryParamsHandling: 'preserve' })
);

window.open(url, '_self');
}

private handleDeleteComponent(componentId: string): void {
const project = this.project();
if (!project) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class ProjectOverviewMapper {
year: response.attributes.node_license.year,
}
: undefined,
license: response.embeds.license?.data?.attributes as LicenseModel,
license: response.embeds?.license?.data?.attributes as LicenseModel,
doi: response.attributes.doi,
publicationDoi: response.attributes.publication_doi,
analyticsKey: response.attributes.analytics_key,
Expand All @@ -37,16 +37,16 @@ export class ProjectOverviewMapper {
wikiEnabled: response.attributes.wiki_enabled,
customCitation: response.attributes.custom_citation,
contributors: ContributorsMapper.getContributors(response?.embeds?.bibliographic_contributors?.data),
affiliatedInstitutions: response.embeds.affiliated_institutions
affiliatedInstitutions: response.embeds?.affiliated_institutions
? InstitutionsMapper.fromInstitutionsResponse(response.embeds.affiliated_institutions)
: [],
identifiers: response.embeds.identifiers?.data.map((identifier) => ({
identifiers: response.embeds?.identifiers?.data.map((identifier) => ({
id: identifier.id,
type: identifier.type,
value: identifier.attributes.value,
category: identifier.attributes.category,
})),
...(response.embeds.storage?.data &&
...(response.embeds?.storage?.data &&
!response.embeds.storage?.errors && {
storage: {
id: response.embeds.storage.data.id,
Expand All @@ -55,7 +55,7 @@ export class ProjectOverviewMapper {
storageLimitStatus: response.embeds.storage.data.attributes.storage_limit_status,
},
}),
supplements: response.embeds.preprints?.data.map((preprint) => ({
supplements: response.embeds?.preprints?.data.map((preprint) => ({
id: preprint.id,
type: preprint.type,
title: preprint.attributes.title,
Expand Down
Loading