From e165caf47802f7b6a8ee0a096378967337e9b963 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 13 Jun 2019 08:23:34 +0000 Subject: [PATCH] [Admin]: init Affiliation: copy object git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56069 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/pages/affiliations/affiliations.component.ts | 10 +++------- src/app/pages/curator/curator.component.ts | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/app/pages/affiliations/affiliations.component.ts b/src/app/pages/affiliations/affiliations.component.ts index abd95a5..a763f24 100644 --- a/src/app/pages/affiliations/affiliations.component.ts +++ b/src/app/pages/affiliations/affiliations.component.ts @@ -85,11 +85,9 @@ export class AffiliationsComponent implements OnInit { initAffiliation(affiliation: Affiliation = null) { this.resetMessages(); - this.affiliation = new Affiliation(); + if (affiliation) { - this.affiliation.name = affiliation.name; - this.affiliation.logo_url = affiliation.logo_url; - this.affiliation.website_url = affiliation.website_url; + this.affiliation = {...affiliation}; if(!this.curatorAffiliations) { this.affiliation.communityId = affiliation.communityId; this.affiliation.id = affiliation.id; @@ -101,9 +99,7 @@ export class AffiliationsComponent implements OnInit { } } else { this.index = -1; - this.affiliation.name = ''; - this.affiliation.logo_url = ''; - this.affiliation.website_url = ''; + this.affiliation = new Affiliation(); if(!this.curatorAffiliations) { this.affiliation.communityId = this.communityId; } diff --git a/src/app/pages/curator/curator.component.ts b/src/app/pages/curator/curator.component.ts index 06de1ae..70355b7 100644 --- a/src/app/pages/curator/curator.component.ts +++ b/src/app/pages/curator/curator.component.ts @@ -6,7 +6,7 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properti import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {CuratorService} from '../../openaireLibrary/connect/curators/curator.service'; -import {Affiliation, Curator} from '../../openaireLibrary/utils/entities/CuratorInfo'; +import {Curator} from '../../openaireLibrary/utils/entities/CuratorInfo'; import {HelperFunctions} from '../../openaireLibrary/utils/HelperFunctions.class'; import {UtilitiesService} from '../../openaireLibrary/services/utilities.service';