[Trunk | Admin]: affiliations.component: Bug fix: no check to make url tiny (call the function anyway).

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56235 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-06-27 13:26:54 +00:00
parent d9369ca67a
commit 3d2fdda714
1 changed files with 15 additions and 31 deletions

View File

@ -167,41 +167,25 @@ export class AffiliationsComponent implements OnInit {
}
addAffiliation() {
console.info(this.affiliation);
if (!this.isEmptyAffiliation()) {
this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.logo_url).subscribe((logo_url)=> {
this.affiliation.logo_url = logo_url;
if(!HelperFunctions.isTiny(this.affiliation.logo_url)) {
this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.logo_url).subscribe((logo_url)=> {
this.affiliation.logo_url = logo_url;
if(!HelperFunctions.isTiny(this.affiliation.website_url)) {
this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.website_url).subscribe((website_url) => {
this.affiliation.website_url = website_url;
if (!this.curatorAffiliations) {
this.updateCommunityAffiliations(this.index);
} else {
if (this.index === -1) {
this.affiliations.push(this.affiliation);
} else {
this.affiliations[this.index] = this.affiliation;
}
}
this.change();
});
}
})
} else {
if(!this.curatorAffiliations) {
this.updateCommunityAffiliations(this.index);
} else {
if (this.index === -1) {
this.affiliations.push(this.affiliation);
this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.website_url).subscribe((website_url) => {
this.affiliation.website_url = website_url;
if (!this.curatorAffiliations) {
this.updateCommunityAffiliations(this.index);
} else {
this.affiliations[this.index] = this.affiliation;
if (this.index === -1) {
this.affiliations.push(this.affiliation);
} else {
this.affiliations[this.index] = this.affiliation;
}
}
}
this.change();
}
this.change();
});
})
}
}