[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
This commit is contained in:
k.triantafyllou 2019-06-13 08:23:34 +00:00
parent 43e1274b2a
commit e165caf478
2 changed files with 4 additions and 8 deletions

View File

@ -85,11 +85,9 @@ export class AffiliationsComponent implements OnInit {
initAffiliation(affiliation: Affiliation = null) { initAffiliation(affiliation: Affiliation = null) {
this.resetMessages(); this.resetMessages();
this.affiliation = new Affiliation();
if (affiliation) { if (affiliation) {
this.affiliation.name = affiliation.name; this.affiliation = {...affiliation};
this.affiliation.logo_url = affiliation.logo_url;
this.affiliation.website_url = affiliation.website_url;
if(!this.curatorAffiliations) { if(!this.curatorAffiliations) {
this.affiliation.communityId = affiliation.communityId; this.affiliation.communityId = affiliation.communityId;
this.affiliation.id = affiliation.id; this.affiliation.id = affiliation.id;
@ -101,9 +99,7 @@ export class AffiliationsComponent implements OnInit {
} }
} else { } else {
this.index = -1; this.index = -1;
this.affiliation.name = ''; this.affiliation = new Affiliation();
this.affiliation.logo_url = '';
this.affiliation.website_url = '';
if(!this.curatorAffiliations) { if(!this.curatorAffiliations) {
this.affiliation.communityId = this.communityId; this.affiliation.communityId = this.communityId;
} }

View File

@ -6,7 +6,7 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properti
import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {Session} from '../../openaireLibrary/login/utils/helper.class';
import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class';
import {CuratorService} from '../../openaireLibrary/connect/curators/curator.service'; 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 {HelperFunctions} from '../../openaireLibrary/utils/HelperFunctions.class';
import {UtilitiesService} from '../../openaireLibrary/services/utilities.service'; import {UtilitiesService} from '../../openaireLibrary/services/utilities.service';