diff --git a/connect/curators/curator.service.ts b/connect/curators/curator.service.ts index cf28ceff..52516530 100644 --- a/connect/curators/curator.service.ts +++ b/connect/curators/curator.service.ts @@ -12,7 +12,7 @@ export class CuratorService { } public getCurators(properties: EnvProperties, communityId: string): Observable { - let url: string = properties.adminToolsAPIURL + '/' + communityId + '/curator'; + let url: string = properties.adminToolsAPIURL + communityId + '/curator'; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); } diff --git a/monitor/services/resources.service.ts b/monitor/services/resources.service.ts index 8884ed22..657e6bca 100644 --- a/monitor/services/resources.service.ts +++ b/monitor/services/resources.service.ts @@ -68,7 +68,7 @@ export class ResourcesService { } public isPagesEnabled() { - let url = properties.adminToolsAPIURL + "/monitor/monitor/pages"; + let url = properties.adminToolsAPIURL + "monitor/monitor/pages"; return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(pages => { let result = this.routes.map(() => false); diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index ba7bf5bb..65b8a403 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -57,7 +57,7 @@ export class StakeholderService { getStakeholder(alias: string, shouldUpdate: boolean = false): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias || shouldUpdate) { this.promise = new Promise((resolve, reject) => { - this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => { + this.sub = this.http.get(properties.monitorServiceAPIURL + 'stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { this.stakeholderSubject.next(stakeholder); @@ -74,7 +74,7 @@ export class StakeholderService { getChildStakeholder(parent: string, type: string, child: string, shouldUpdate: boolean = false): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== child || shouldUpdate) { this.promise = new Promise((resolve, reject) => { - this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(parent) + '/' + type + '/' + encodeURIComponent(child), CustomOptions.registryOptions()).pipe(map(stakeholder => { + this.sub = this.http.get(properties.monitorServiceAPIURL + 'stakeholder/' + encodeURIComponent(parent) + '/' + type + '/' + encodeURIComponent(child), CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { this.stakeholderSubject.next(stakeholder); @@ -91,7 +91,7 @@ export class StakeholderService { getResearcherStakeholder(orcid, name, results, shouldUpdate: boolean = false): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== orcid || shouldUpdate) { this.promise = new Promise((resolve, reject) => { - this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => { + this.sub = this.http.get(properties.monitorServiceAPIURL + 'stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { stakeholder.index_id = orcid; @@ -123,19 +123,19 @@ export class StakeholderService { } getAlias(url: string): Observable { - return this.http.get(url + '/stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => { + return this.http.get(url + 'stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => { return HelperFunctions.copy(stakeholders); })); } getStakeholders(url: string, type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> { - return this.http.get(url + '/stakeholder' + ((type) ? ('?type=' + type) : (defaultId?'?defaultId=' + defaultId:'')) + ((type && defaultId) ? ('&defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { + return this.http.get(url + 'stakeholder' + ((type) ? ('?type=' + type) : (defaultId?'?defaultId=' + defaultId:'')) + ((type && defaultId) ? ('&defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders)); })); } getMyStakeholders(url: string, type: string = null): Observable { - return this.http.get(url + '/my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(manageStakeholder => { + return this.http.get(url + 'my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(manageStakeholder => { return HelperFunctions.copy({ templates: Stakeholder.checkIsUpload(manageStakeholder.templates), standalone: Stakeholder.checkIsUpload(manageStakeholder.standalone), @@ -155,20 +155,20 @@ export class StakeholderService { umbrella: umbrella, standalone: standalone } - return this.http.post(url + '/build-stakeholder', buildStakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { + return this.http.post(url + 'build-stakeholder', buildStakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })); } changeVisibility(url: string, path: string[], visibility: Visibility, propagate: boolean = false): Observable { - return this.http.post(url + '/' + path.join('/') + '/change-visibility' + '?visibility=' + visibility + (propagate ? '&propagate=true' : ''), null, CustomOptions.registryOptions()); + return this.http.post(url + path.join('/') + '/change-visibility' + '?visibility=' + visibility + (propagate ? '&propagate=true' : ''), null, CustomOptions.registryOptions()); } saveElement(url: string, element: any, path: string[] = [], isFull: boolean = false): Observable { if (element.alias && element.alias.startsWith('/')) { element.alias = element.alias.slice(1); } - return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + + return this.http.post(url + path.join('/') + '/save' + (isFull ? '/full' : ''), element, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); @@ -179,7 +179,7 @@ export class StakeholderService { } saveBulkElements(url: string, indicators, path: string[] = []): Observable { - return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + + return this.http.post(url + path.join('/') + '/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); @@ -190,7 +190,7 @@ export class StakeholderService { } saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable
{ - return this.http.post
(url + ((path.length > 0) ? '/' : '') + path.join('/') + + return this.http.post
(url + path.join('/') + '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { return HelperFunctions.copy(element); })); @@ -201,27 +201,27 @@ export class StakeholderService { if (childrenAction) { params = "?children=" + childrenAction; } - return this.http.delete(url + '/' + path.join('/') + '/delete' + params, CustomOptions.registryOptions()); + return this.http.delete(url + path.join('/') + '/delete' + params, CustomOptions.registryOptions()); } reorderElements(url: string, path: string[], ids: string[]): Observable { - return this.http.post(url + '/' + path.join('/') + '/reorder', ids, CustomOptions.registryOptions()); + return this.http.post(url + path.join('/') + '/reorder', ids, CustomOptions.registryOptions()); } reorderIndicators(url: string, path: string[], indicators: string[]): Observable { - return this.http.post(url + '/' + path.join('/') + '/reorder', indicators, CustomOptions.registryOptions()).pipe(map(indicators => { + return this.http.post(url + path.join('/') + '/reorder', indicators, CustomOptions.registryOptions()).pipe(map(indicators => { return HelperFunctions.copy(indicators); })); } moveIndicator(url: string, path: string[], moveIndicator: MoveIndicator): Observable { - return this.http.post(url + '/' + path.join('/') + '/moveIndicator', moveIndicator, CustomOptions.registryOptions()).pipe(map(subCategory => { + return this.http.post(url + path.join('/') + '/moveIndicator', moveIndicator, CustomOptions.registryOptions()).pipe(map(subCategory => { return HelperFunctions.copy(subCategory); })); } updateUmbrella(url: string, id: string, update: UpdateUmbrella): Observable { - return this.http.post(url + '/' + id + '/umbrella', update, CustomOptions.registryOptions()).pipe(map(umbrella => { + return this.http.post(url + id + '/umbrella', update, CustomOptions.registryOptions()).pipe(map(umbrella => { return HelperFunctions.copy(umbrella); })); } diff --git a/services/customization.service.ts b/services/customization.service.ts index e4dd4933..c95a1cc3 100644 --- a/services/customization.service.ts +++ b/services/customization.service.ts @@ -26,19 +26,19 @@ export class CustomizationService { saveLayout(properties: EnvProperties, pid: string, layout: Layout, portalType = null): Observable { CustomizationService.removeNulls(layout); - return this.http.post(properties.adminToolsAPIURL + '/' + (portalType?portalType: properties.adminToolsPortalType) + '/' + return this.http.post(properties.adminToolsAPIURL + (portalType?portalType: properties.adminToolsPortalType) + '/' + pid + '/layout', layout, CustomOptions.getAuthOptionsWithBody()); } deleteLayout(properties: EnvProperties, pid: string, portalType = null): Observable { - return this.http.delete(properties.adminToolsAPIURL + '/' + (portalType?portalType: properties.adminToolsPortalType) + '/' + return this.http.delete(properties.adminToolsAPIURL + (portalType?portalType: properties.adminToolsPortalType) + '/' + pid + '/layout', CustomOptions.getAuthOptionsWithBody()); } getLayout(properties: EnvProperties, pid: string): Observable { - return this.http.get(properties.adminToolsAPIURL+"/" + properties.adminToolsPortalType + '/' + return this.http.get(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/layout'); } getLayouts(properties: EnvProperties): Observable { - return this.http.get(properties.adminToolsAPIURL+'/community/layouts'); + return this.http.get(properties.adminToolsAPIURL + 'community/layouts'); } mockLayout(): any { return this.http.get('./assets/customizationOptions.json') ; diff --git a/services/plugins.service.ts b/services/plugins.service.ts index ad6e9bd9..38af2426 100644 --- a/services/plugins.service.ts +++ b/services/plugins.service.ts @@ -43,7 +43,7 @@ export class PluginsService { } countPluginTemplatePerPageForAllPortals(api: string) { - return this.http.get(api + '/pluginTemplate/page/count'); + return this.http.get(api + 'pluginTemplate/page/count'); } getPluginsByPage(api: string, pid: string, pageId: string) { @@ -66,11 +66,11 @@ export class PluginsService { return this.http.post(api + 'community/' + community + '/plugin/status/' + id, status, CustomOptions.getAuthOptionsWithBody()); } getPluginById(api: string, id: string) { - return this.http.get(api + '/plugin/' + id); + return this.http.get(api + 'plugin/' + id); } getPluginTemplateById(api: string, id: string) { - return this.http.get(api + '/pluginTemplates/' + id); + return this.http.get(api + 'pluginTemplates/' + id); } } diff --git a/utils/configuration/configuration.service.ts b/utils/configuration/configuration.service.ts index 43f804bb..c5edcd36 100644 --- a/utils/configuration/configuration.service.ts +++ b/utils/configuration/configuration.service.ts @@ -35,7 +35,7 @@ export class ConfigurationService { public initPortal(properties: EnvProperties, pid: string) { if (pid == null || this.portal?.getValue()?.static) return; - let url = properties.adminToolsAPIURL + "/" + properties.adminToolsPortalType + "/" + pid + "/full"; + let url = properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + pid + "/full"; this.promise = new Promise(resolve => { this.sub = this.http.get(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload?'&forceReload=true':'')) :*/ url).subscribe( (portal: Portal) => { diff --git a/utils/email/email.service.ts b/utils/email/email.service.ts index 2dab2857..95bcf4ed 100644 --- a/utils/email/email.service.ts +++ b/utils/email/email.service.ts @@ -16,22 +16,22 @@ export class EmailService { } notifyManagers(pid: string, role: "manager" | "subscriber", email: Email) { - return this.http.post(properties.adminToolsAPIURL + '/notifyManagers/' + pid + '/' + role, email, CustomOptions.getAuthOptions()) + return this.http.post(properties.adminToolsAPIURL + 'notifyManagers/' + pid + '/' + role, email, CustomOptions.getAuthOptions()) } notifyNewManager(email: Email) { - return this.http.post(properties.adminToolsAPIURL + '/notifyNewManager', email, CustomOptions.getAuthOptions()) + return this.http.post(properties.adminToolsAPIURL + 'notifyNewManager', email, CustomOptions.getAuthOptions()) } sendEmail(properties: EnvProperties, email: Email) { - return this.http.post(properties.adminToolsAPIURL + "/sendMail/", email, CustomOptions.registryOptions()); + return this.http.post(properties.adminToolsAPIURL + "sendMail/", email, CustomOptions.registryOptions()); } contact(properties: EnvProperties, email: Email, recaptcha: string = null):Observable { const data: EmailRecaptcha = new EmailRecaptcha(); data.email = email; data.recaptcha = recaptcha; - return this.http.post(properties.adminToolsAPIURL + '/contact', data); + return this.http.post(properties.adminToolsAPIURL + 'contact', data); } } diff --git a/utils/helper/helper.service.ts b/utils/helper/helper.service.ts index 639f913b..3d5c621d 100644 --- a/utils/helper/helper.service.ts +++ b/utils/helper/helper.service.ts @@ -19,9 +19,9 @@ export class HelperService { let url = properties.adminToolsAPIURL; if (div) { - url += '/divhelpcontent?active=true&community=' + communityId + '&page=' + router + '&div=' + div; + url += 'divhelpcontent?active=true&community=' + communityId + '&page=' + router + '&div=' + div; } else { - url += '/pagehelpcontent?active=true&community=' + communityId + '&page=' + router + '&position=' + position; + url += 'pagehelpcontent?active=true&community=' + communityId + '&page=' + router + '&position=' + position; if (before) { url += '&before=' + before; } @@ -42,7 +42,7 @@ export class HelperService { if (typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { let page_route: string = router.split('?')[0].substring(0); let url = properties.adminToolsAPIURL; - url += '/' + portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' + + url += portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' + ((page_route.indexOf("/" + portal + "/") != -1) ? ("/" + page_route.split("/" + portal + "/")[1]) : page_route); return this.http.get(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')) :*/ url); } else { @@ -60,7 +60,7 @@ export class HelperService { if (typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { let page_route: string = router.split('?')[0].substring(0); let url = properties.adminToolsAPIURL; - url += '/' + properties.adminToolsPortalType + '/' + communityId + '/divhelpcontent/grouped?active=true&page=' + + url += properties.adminToolsPortalType + '/' + communityId + '/divhelpcontent/grouped?active=true&page=' + ((page_route.indexOf("/" + communityId + "/") != -1) ? ("/" + page_route.split("/" + communityId + "/")[1]) : page_route); return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload ? '&forceReload=true' : '')) : url); } else { diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index 8f0b7308..94f0cea2 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -116,7 +116,7 @@ export let commonDev: EnvProperties = { cookieDomain: ".di.uoa.gr", feedbackmail: "kostis30fylloy@gmail.com", cacheUrl: "http://dl170.madgik.di.uoa.gr:3000/get?url=", - monitorServiceAPIURL: "http://mpagasas.di.uoa.gr:19380/uoa-monitor-service", + monitorServiceAPIURL: "http://mpagasas.di.uoa.gr:19380/uoa-monitor-service/", adminToolsAPIURL: "http://duffy.di.uoa.gr:19280/uoa-admin-tools/", datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/api/", contextsAPI: "https://dev-openaire.d4science.org/openaire/context", @@ -152,7 +152,7 @@ export let commonTest: EnvProperties = { loginServiceURL: " https://services.openaire.eu/login-service/", cacheUrl: "https://explore.openaire.eu/cache/get?url=", datasourcesAPI: "https://services.openaire.eu/openaire/ds/api/", - monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service", + monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service/", adminToolsAPIURL: "https://services.openaire.eu/uoa-admin-tools/", contextsAPI: "https://services.openaire.eu/openaire/context", communityAPI: "https://services.openaire.eu/openaire/community/", @@ -181,7 +181,7 @@ export let commonBeta: EnvProperties = { loginServiceURL: "https://beta.services.openaire.eu/login-service/", cacheUrl: "https://demo.openaire.eu/cache/get?url=", datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/api/", - monitorServiceAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service", + monitorServiceAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service/", adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/", contextsAPI: "https://beta.services.openaire.eu/openaire/context", communityAPI: "https://beta.services.openaire.eu/openaire/community/", @@ -220,7 +220,7 @@ export let commonProd: EnvProperties = { loginServiceURL: "https://services.openaire.eu/login-service/", cacheUrl: "https://explore.openaire.eu/cache/get?url=", datasourcesAPI: "https://services.openaire.eu/openaire/ds/api/", - monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service", + monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service/", adminToolsAPIURL: "https://services.openaire.eu/uoa-admin-tools/", contextsAPI: "https://services.openaire.eu/openaire/context", communityAPI: "https://services.openaire.eu/openaire/community/",