diff --git a/src/app/features/project/overview/components/overview-components/overview-components.component.html b/src/app/features/project/overview/components/overview-components/overview-components.component.html index 9d2af3670..9db934712 100644 --- a/src/app/features/project/overview/components/overview-components/overview-components.component.html +++ b/src/app/features/project/overview/components/overview-components/overview-components.component.html @@ -21,7 +21,9 @@

{{ 'project.overview.components.title' | translate }}

- {{ component.title }} + + {{ component.title }} +

@if (isCurrentUserContributor(component)) { diff --git a/src/app/features/project/overview/components/overview-components/overview-components.component.ts b/src/app/features/project/overview/components/overview-components/overview-components.component.ts index 06e02e3b8..1f433622e 100644 --- a/src/app/features/project/overview/components/overview-components/overview-components.component.ts +++ b/src/app/features/project/overview/components/overview-components/overview-components.component.ts @@ -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; diff --git a/src/app/features/project/overview/mappers/project-overview.mapper.ts b/src/app/features/project/overview/mappers/project-overview.mapper.ts index 2bd0c45c2..2869c9820 100644 --- a/src/app/features/project/overview/mappers/project-overview.mapper.ts +++ b/src/app/features/project/overview/mappers/project-overview.mapper.ts @@ -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, @@ -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, @@ -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,