Skip to content

Commit 9aea27c

Browse files
authored
fix(components): fixed vol for components (#663)
1 parent 23a5f24 commit 9aea27c

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/app/features/project/overview/components/overview-components/overview-components.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ <h2>{{ 'project.overview.components.title' | translate }}</h2>
2121
<div class="flex justify-content-between align-items-center">
2222
<h2 class="flex align-items-center gap-2">
2323
<osf-icon [iconClass]="component.public ? 'fas fa-lock-open' : 'fas fa-lock'"></osf-icon>
24-
<a class="node-title" [href]="component.id">{{ component.title }}</a>
24+
<a class="node-title cursor-pointer" (click)="navigateToComponent(component.id)">
25+
{{ component.title }}
26+
</a>
2527
</h2>
2628

2729
@if (isCurrentUserContributor(component)) {

src/app/features/project/overview/components/overview-components/overview-components.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ export class OverviewComponentsComponent {
101101
});
102102
}
103103

104+
navigateToComponent(componentId: string): void {
105+
const url = this.router.serializeUrl(
106+
this.router.createUrlTree(['/', componentId], { queryParamsHandling: 'preserve' })
107+
);
108+
109+
window.open(url, '_self');
110+
}
111+
104112
private handleDeleteComponent(componentId: string): void {
105113
const project = this.project();
106114
if (!project) return;

src/app/features/project/overview/mappers/project-overview.mapper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class ProjectOverviewMapper {
2626
year: response.attributes.node_license.year,
2727
}
2828
: undefined,
29-
license: response.embeds.license?.data?.attributes as LicenseModel,
29+
license: response.embeds?.license?.data?.attributes as LicenseModel,
3030
doi: response.attributes.doi,
3131
publicationDoi: response.attributes.publication_doi,
3232
analyticsKey: response.attributes.analytics_key,
@@ -37,16 +37,16 @@ export class ProjectOverviewMapper {
3737
wikiEnabled: response.attributes.wiki_enabled,
3838
customCitation: response.attributes.custom_citation,
3939
contributors: ContributorsMapper.getContributors(response?.embeds?.bibliographic_contributors?.data),
40-
affiliatedInstitutions: response.embeds.affiliated_institutions
40+
affiliatedInstitutions: response.embeds?.affiliated_institutions
4141
? InstitutionsMapper.fromInstitutionsResponse(response.embeds.affiliated_institutions)
4242
: [],
43-
identifiers: response.embeds.identifiers?.data.map((identifier) => ({
43+
identifiers: response.embeds?.identifiers?.data.map((identifier) => ({
4444
id: identifier.id,
4545
type: identifier.type,
4646
value: identifier.attributes.value,
4747
category: identifier.attributes.category,
4848
})),
49-
...(response.embeds.storage?.data &&
49+
...(response.embeds?.storage?.data &&
5050
!response.embeds.storage?.errors && {
5151
storage: {
5252
id: response.embeds.storage.data.id,
@@ -55,7 +55,7 @@ export class ProjectOverviewMapper {
5555
storageLimitStatus: response.embeds.storage.data.attributes.storage_limit_status,
5656
},
5757
}),
58-
supplements: response.embeds.preprints?.data.map((preprint) => ({
58+
supplements: response.embeds?.preprints?.data.map((preprint) => ({
5959
id: preprint.id,
6060
type: preprint.type,
6161
title: preprint.attributes.title,

0 commit comments

Comments
 (0)