diff --git a/src/app/portal/components/single/single-project/single-project.component.html b/src/app/portal/components/single/single-project/single-project.component.html index 0655cc17b..7604d7463 100644 --- a/src/app/portal/components/single/single-project/single-project.component.html +++ b/src/app/portal/components/single/single-project/single-project.component.html @@ -66,18 +66,43 @@

+
+

{{row.subFields[0].label}}

- - -

{{row.subFields[1].label}}

+
+
+

{{row.subFields[1].label}}

+ +
{{ origOrg.orgName }}
+
+
+
+

{{row.subFields[2].label}}

{{ person.fullName }}
+
+
+

{{row.subFields[3].label}}

+ + + +
+ {{ relOrg.orgName }} +
+
+ + +
+ + + +
@@ -210,20 +235,11 @@

Hanketiedon lähde

-
-

- {{source.funder.name}} - - Rakennerahastotietopalvelu - (eura2014.fi - - ) - +

+

+ {{source.dataSource.trim()}}

- -

Tiedon lähde ei saatavilla.

diff --git a/src/app/portal/components/single/single-project/single-project.component.ts b/src/app/portal/components/single/single-project/single-project.component.ts index 39aa168f8..97cc68368 100644 --- a/src/app/portal/components/single/single-project/single-project.component.ts +++ b/src/app/portal/components/single/single-project/single-project.component.ts @@ -115,13 +115,21 @@ export class SingleProjectComponent implements OnInit, OnDestroy { tooltip: $localize`:@@spParticipantsTooltip:Hankkeeseen osallistuvat organisaatiot ja henkilöt`, showOnlyLabel: true, subFields: [{ - label: $localize`:@@spOrganizations:Organisaatiot`, + label: $localize`:@@spResponsibleOrganization:Vastuuorganisaatio`, field: 'responsibleOrganizations', showOnlyLabel: false }, + { + label: $localize`:@@spOriginalOrganizations:Alkuperäinen vastuuorganisaatio`, + field: 'originalResponsibleOrganization', + }, { label: $localize`:@@spPersons:Henkilöt`, field: 'responsiblePersons', + }, + { + label: $localize`:@@spRelatedOrganizations:Liittyvät organisaatiot`, + field: 'relatedOrganizations', }] }, { @@ -237,6 +245,7 @@ export class SingleProjectComponent implements OnInit, OnDestroy { // .pipe(map(responseData => [responseData])) .subscribe({ next: (responseData) => { + console.log(responseData); this.responseData = responseData; const project = this.responseData.projects[0]; if (project) { diff --git a/src/app/portal/models/project/project.model.ts b/src/app/portal/models/project/project.model.ts index 89cd353a7..ce398a39b 100644 --- a/src/app/portal/models/project/project.model.ts +++ b/src/app/portal/models/project/project.model.ts @@ -24,9 +24,14 @@ export class Project { public projectURL: string, public responsibleOrganizations: object[], public responsibleOrganization: string, + public relatedOrganizations: object[], + public relatedOrganization: string, + public originalOrganizations: object[], + public originalOrganization: string, public responsiblePerson: object[], public keywords: string, - public completions: object[] + public completions: object[], + public dataSource: string ) { } } @@ -51,7 +56,33 @@ export class ProjectAdapter implements Adapter { }); } + const relOrgList = []; + if (item.relatedOrganizations) { + item.relatedOrganizations.forEach((org) => { + relOrgList.push({ + orgName: this.utils.checkTranslation('orgName', org).trim(), + orgId: org.orgid, + orgLinkId: org.businessId ? org.orgid : '' + } + ); + }); + } + + const origOrgList = []; + if (item.originalOrganization) { + item.originalOrganization.forEach((org) => { + origOrgList.push({ + orgName: this.utils.checkTranslation('orgName', org).trim(), + orgId: org.orgid + } + ); + }); + } + + const origOrgStr = origOrgList.map(org => org.orgName).join(', '); + const relOrgStr = relOrgList.map(org => org.orgName).join(', '); const respOrgStr = respOrgList.map(org => org.orgName).join(', '); + const keywords = item?.keywords ? item.keywords.filter((item) => item?.keyword && item.keyword.trim().length > 0).map(kw => kw.keyword.replace(/,$/, '')).join(', ') : ''; return new Project( @@ -68,9 +99,14 @@ export class ProjectAdapter implements Adapter { item.projectURL, respOrgList, respOrgStr, + relOrgList, + relOrgStr, + origOrgList, + origOrgStr, item.responsiblePerson, keywords, - item?.completions ? item.completions : [] + item?.completions ? item.completions : [], + item.dataSource ); } }