From 6e188b81af4e868771f2cdaef449c958a8f6d192 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 28 Jun 2019 09:49:21 +0000 Subject: [PATCH] [Admin|Trunk]: Replace with properties utilsService all calls of utilities Service. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56257 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/pages/affiliations/affiliations.component.ts | 4 ++-- src/app/pages/curator/curator.component.ts | 10 +++++----- src/assets/env-properties.json | 4 +--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/app/pages/affiliations/affiliations.component.ts b/src/app/pages/affiliations/affiliations.component.ts index 0c23412..f22e0e2 100644 --- a/src/app/pages/affiliations/affiliations.component.ts +++ b/src/app/pages/affiliations/affiliations.component.ts @@ -168,10 +168,10 @@ export class AffiliationsComponent implements OnInit { addAffiliation() { if (!this.isEmptyAffiliation()) { - this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.logo_url).subscribe((logo_url)=> { + this.utilitiesService.getTiny(this.properties.utilsService + '/tiny?url=' + this.affiliation.logo_url).subscribe((logo_url)=> { this.affiliation.logo_url = logo_url; - this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.website_url).subscribe((website_url) => { + this.utilitiesService.getTiny(this.properties.utilsService + '/tiny?url='+ this.affiliation.website_url).subscribe((website_url) => { this.affiliation.website_url = website_url; if (!this.curatorAffiliations) { diff --git a/src/app/pages/curator/curator.component.ts b/src/app/pages/curator/curator.component.ts index 19aa0e1..9318613 100644 --- a/src/app/pages/curator/curator.component.ts +++ b/src/app/pages/curator/curator.component.ts @@ -59,7 +59,7 @@ export class CuratorComponent implements OnInit { this.curator = curator; this.curator.email = Session.getUserEmail(); if (this.curator.photo && this.curator.photo !== '') { - this.photo = this.properties.downloadUrl + '/' + this.curator.photo; + this.photo = this.properties.utilsService + '/download/' + this.curator.photo; } else { this.photo = '../../../assets/common-assets/curator-default.png'; } @@ -102,7 +102,7 @@ export class CuratorComponent implements OnInit { this.curator = curator; this.curator.email = Session.getUserEmail(); if (this.curator.photo && this.curator.photo !== '') { - this.photo = this.properties.downloadUrl + '/' + this.curator.photo; + this.photo = this.properties.utilsService + '/download/' + this.curator.photo; } else { this.photo = '../../../assets/common-assets/curator-default.png'; } @@ -193,9 +193,9 @@ export class CuratorComponent implements OnInit { if ((this.hasChanged || this.affiliationsChanged) && this.curator && this.curator.name && this.curator.name !== '') { this.showLoading = true; if (this.file) { - this.utilitiesService.uploadPhoto(this.properties.uploadService + '/' + this.curator._id, this.file).subscribe((res) => { + this.utilitiesService.uploadPhoto(this.properties.utilsService + '/upload/' + this.curator._id, this.file).subscribe((res) => { if (this.curator.photo && this.curator.photo !== '') { - this.utilitiesService.deletePhoto(this.properties.deleteUrl + '/' + this.curator.photo).subscribe(); + this.utilitiesService.deletePhoto(this.properties.utilsService + '/delete/' + this.curator.photo).subscribe(); } this.curator.photo = res.filename; this.curatorService.updateCurator(this.properties.adminToolsAPIURL + 'curator', @@ -215,7 +215,7 @@ export class CuratorComponent implements OnInit { ); } else { if(this.deletePhoto) { - this.utilitiesService.deletePhoto(this.properties.deleteUrl + '/' + this.curator.photo).subscribe(); + this.utilitiesService.deletePhoto(this.properties.utilsService + '/delete/' + this.curator.photo).subscribe(); this.curator.photo = ''; } this.curatorService.updateCurator(this.properties.adminToolsAPIURL + 'curator', diff --git a/src/assets/env-properties.json b/src/assets/env-properties.json index 063fd82..60b22b8 100644 --- a/src/assets/env-properties.json +++ b/src/assets/env-properties.json @@ -32,9 +32,7 @@ "ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf", "helpdesk" : "https://www.openaire.eu/support/helpdesk", "uploadService" : "http://mpagasas.di.uoa.gr:8001/upload", - "downloadUrl" : "http://mpagasas.di.uoa.gr:8001/download", - "deleteUrl" : "http://mpagasas.di.uoa.gr:8001/delete", - "tinyUrl": "http://mpagasas.di.uoa.gr:8001/tiny?url=", + "utilsService" : "http://mpagasas.di.uoa.gr:8000", "vocabulariesAPI" :"https://beta.services.openaire.eu/provision/mvc/vocabularies/",