From 7f7b08b7af2d08c628c061a199798d5f56330c76 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 23 Jul 2024 02:17:45 +0300 Subject: [PATCH 01/13] [develop | DONE | ADDED]: Added the option to claim works to ORCID without pids, but with OpenAIRE id. 1. myOrcidLinks.component.ts & orcid.service.ts: Added functionality for orcid claim with openaireId. 2. orcid-work.component.ts: Added functionality for orcid claim with openaireId & added (missing from previous commit) @Input() compactView to show or not the word "claim". 3. orcidWork.ts: Set openaireId (relcanId) as external-id with "external-id-type": "source-work-id". 4. newSearchPage.component.ts: Added field public isLoggedIn: boolean = false; and initialize it by calling userManagementService.getUserInfo(). 5. newSearchPage.component.html: In set isLoggedIn parameter. 6. searchResult.component.ts: Added functionality for orcid claim with openaireId & Added field @Input() isLoggedIn: boolean = false; and replaced Session check. 7. result-preview.component.ts & result-preview.component.html: Removed checks to orcid claim only when there are pids. --- .../my-orcid-links/myOrcidLinks.component.ts | 16 ++++-- orcid/orcid-work.component.ts | 56 ++++++++++++------- orcid/orcid.service.ts | 24 ++++---- orcid/orcidWork.ts | 9 +++ .../searchUtils/newSearchPage.component.html | 3 +- .../searchUtils/newSearchPage.component.ts | 16 +++++- .../searchUtils/searchResult.component.ts | 21 ++++--- .../result-preview.component.html | 4 +- .../result-preview.component.ts | 2 +- 9 files changed, 103 insertions(+), 48 deletions(-) diff --git a/orcid/my-orcid-links/myOrcidLinks.component.ts b/orcid/my-orcid-links/myOrcidLinks.component.ts index 0e71b330..c4cb03f0 100644 --- a/orcid/my-orcid-links/myOrcidLinks.component.ts +++ b/orcid/my-orcid-links/myOrcidLinks.component.ts @@ -206,7 +206,7 @@ export class MyOrcidLinksComponent { this.subscriptions.push(this._orcidService.getPersonalDetails().subscribe( details => { let author: string = ""; -console.log(details) + if(details && details['name']) { let name: string = details['name']; if(name['given-names'] && name['given-names']['value']) { @@ -303,9 +303,13 @@ console.log(details) let works = this.works.slice(from, to); for(let work of works) { - for(let pid of work['pids']) { - let identifier: Identifier = Identifier.getIdentifierFromString(pid, false); - this.orcidQuery += (this.orcidQuery ? " or " : "") + ('(pid="'+StringUtils.URIEncode(identifier.id)+'")'); + if(work['pids'] && work['pids'].length > 0) { + for (let pid of work['pids']) { + let identifier: Identifier = Identifier.getIdentifierFromString(pid, false); + this.orcidQuery += (this.orcidQuery ? " or " : "") + ('(pid="' + StringUtils.URIEncode(identifier.id) + '")'); + } + } else { + this.orcidQuery += (this.orcidQuery ? " or " : "") + ('(objIdentifier="' + StringUtils.URIEncode(work['openaireId']) + '")'); } } this.showLoading = false; @@ -344,8 +348,8 @@ console.log(details) let relatedResults = []; this.currentResults.push({"work": work, "results" : relatedResults}) results.forEach(result => { - let identifierValues: string[] = [].concat(...Array.from(result.identifiers.values())); - if(work['pids'].some(pid => identifierValues.includes(pid))) { + let identifierValues: string[] = result.identifiers ? [].concat(...Array.from(result.identifiers.values())) : []; + if((work['pids'] && work['pids'].some(pid => identifierValues.includes(pid))) || work['openaireId'] === result.relcanId) { let index: number = resultsFound.get(identifierValues); if(!index) { diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index 8473be66..fbb996f5 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -24,7 +24,7 @@ declare var UIkit: any; + [title]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipAdd"> @@ -32,21 +32,21 @@ declare var UIkit: any; [ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''" [class.uk-text-bolder]="!(isMobile && pageType == 'landing')" [class.uk-text-muted]="isDisabled"> - - Claim + Claim
+ [innerHTML]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipAdd">
+ [title]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipDelete"> @@ -54,15 +54,15 @@ declare var UIkit: any; [ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''" [class.uk-text-bolder]="!(isMobile && pageType == 'landing')" [class.uk-text-muted]="isDisabled"> - - Remove + Remove
+ [innerHTML]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipDelete">
@@ -192,8 +192,16 @@ declare var UIkit: any;

-
+
+ + Source-work-id: + + + {{openaireId.value}} + + +
@@ -300,6 +308,8 @@ export class OrcidWorkComponent { //for myorcid links page @Input() showOnlyUpdateButton: boolean = false; @Input() showUpdateButton: boolean = true; + @Input() compactView: boolean = false; // if true, do not show label for actions + public subscriptions: Subscription[] = []; @ViewChild('workModal') workModal; // @ViewChild('saveWorkModal') saveWorkModal; @@ -317,6 +327,7 @@ export class OrcidWorkComponent { public works: any[] = []; public orcidWorks: any[] = []; + public openaireId: {value: string, url: string} = null; public window: any; public isLoggedIn: boolean = false; @@ -395,10 +406,14 @@ export class OrcidWorkComponent { public parseIdentifiers(identifiers: ExternalIDV3_0[]): Map { let identifiersMap: Map = new Map(); for (let identifier of identifiers) { - if (!identifiersMap.has(identifier['external-id-type'])) { - identifiersMap.set(identifier['external-id-type'], new Array()); + if(identifier['external-id-type'] == "source-work-id") { + this.openaireId = {value: identifier['external-id-value'], url: identifier['external-id-url'].value}; + } else { + if (!identifiersMap.has(identifier['external-id-type'])) { + identifiersMap.set(identifier['external-id-type'], new Array()); + } + identifiersMap.get(identifier['external-id-type']).push(identifier['external-id-value']); } - identifiersMap.get(identifier['external-id-type']).push(identifier['external-id-value']); } return identifiersMap; } @@ -442,7 +457,7 @@ export class OrcidWorkComponent { } private getPutCode() { - this.subscriptions.push(this.orcidService.getPutCode(this.pids).subscribe( + this.subscriptions.push(this.orcidService.getPutCode(this.resultLandingInfo.relcanId, this.pids).subscribe( putCodes => { this.putCodes = putCodes; this.cdr.markForCheck(); @@ -511,7 +526,7 @@ export class OrcidWorkComponent { } private saveWork() { - this.subscriptions.push(this.orcidService.saveWork(this.resultLandingInfo, this.pids).subscribe( + this.subscriptions.push(this.orcidService.saveWork(this.resultLandingInfo, this.resultLandingInfo.relcanId,this.pids).subscribe( response => { if(this.properties.logServiceUrl) { this.subscriptions.push(this._logService.logOrcidLink(this.properties, "added", this.resultLandingInfo.title, this.resultLandingInfo.identifiers.get('doi')[0]).subscribe(res => { })); @@ -564,7 +579,7 @@ export class OrcidWorkComponent { } private updateWorkPreparation() { - if (!Session.isLoggedIn()) { + if (!this.isLoggedIn) { this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, @@ -590,7 +605,7 @@ export class OrcidWorkComponent { } private updateWork() { - this.subscriptions.push(this.orcidService.updateWork(this.resultLandingInfo, this.pids, this.putCodes[0]).subscribe( + this.subscriptions.push(this.orcidService.updateWork(this.resultLandingInfo, this.resultLandingInfo.relcanId, this.pids, this.putCodes[0]).subscribe( response => { if (response) { this.updateDates[0] = response['last-modified-date'].value; @@ -626,7 +641,8 @@ export class OrcidWorkComponent { } public getOrcidWorks() { - if (!Session.isLoggedIn()) { + this.openaireId = null; + if (!this.isLoggedIn) { this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, @@ -668,7 +684,7 @@ export class OrcidWorkComponent { public deleteWorks(confirmed: boolean = false) { - if (!Session.isLoggedIn()) { + if (!this.isLoggedIn) { this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, @@ -833,7 +849,7 @@ export class OrcidWorkComponent { this.message += "There was an error getting work \"" + this.resultTitle + "\" from your ORCID record.
Please try again later."; } else if (this.currentAction == "add") { // this.message += "There was an error adding work with pids: "+this.pids+" to your ORCID record.
Please try again later."; - this.message += "There was an error adding work with pids: \"" + this.pids + "\" to your ORCID record.
Please try again later."; + this.message += "There was an error adding work with openaireId: \""+this.resultLandingInfo.relcanId+(this.pids?.length > 0 ? "\" and pids: \"" + this.pids : "") +"\" to your ORCID record.
Please try again later."; } else if (this.currentAction == "update") { // this.message += "There was an error updating work with pids: "+this.pids+" to your ORCID record.
Please try again later."; this.message += "There was an error updating work \"" + this.resultTitle + "\" to your ORCID record.
Please try again later."; @@ -877,7 +893,7 @@ export class OrcidWorkComponent { } get isDisabled() { - return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn || (!this.pids && (!this.identifiers || this.identifiers.size == 0))); + return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn); } get noPids() { diff --git a/orcid/orcid.service.ts b/orcid/orcid.service.ts index 8a48da02..999ffcd6 100644 --- a/orcid/orcid.service.ts +++ b/orcid/orcid.service.ts @@ -11,19 +11,21 @@ import {ConnectHelper} from "../connect/connectHelper"; export class OrcidService { constructor(private http: HttpClient) {} - getPutCode(pids: string) { - let url: string = properties.orcidAPIURL+"local/put-code?pids="+pids; + getPutCode(openaireId: string, pids: string) { + let url: string = properties.orcidAPIURL+"local/put-code?openaireId="+openaireId+(pids ? ("&pids="+pids) : ""); return this.http.get(url, CustomOptions.registryOptions()); } - getPutCodes(pids: string[][]) { + getPutCodes(openaireIds: string[], pids: string[][]) { let url: string = properties.orcidAPIURL+"local/put-codes"; - return this.http.post(url, JSON.stringify(pids), CustomOptions.registryOptions()); + let map = {"pids": pids, "openaireIds": openaireIds}; + return this.http.post(url, JSON.stringify(map), CustomOptions.registryOptions()); } - getLocalWorksByPids(pids: string[][]) { + getLocalWorksByPids(openaireIds: string[], pids: string[][]) { let url: string = properties.orcidAPIURL+"local/works"; - return this.http.post(url, JSON.stringify(pids), CustomOptions.registryOptions()); + let map = {"pids": pids, "openaireIds": openaireIds}; + return this.http.post(url, JSON.stringify(map), CustomOptions.registryOptions()); } getToken(code: string) { @@ -47,14 +49,15 @@ export class OrcidService { return this.http.get(url, CustomOptions.registryOptions()); } - saveWork(resultLandingInfo: ResultLandingInfo, pids: string) { + saveWork(resultLandingInfo: ResultLandingInfo, openaireId: string, pids: string) { let work = WorkV3_0.resultLandingInfoConvert(resultLandingInfo, null); let portalId: string = ConnectHelper.getCommunityFromDomain(properties.domain); // if dashboard format changes, check in API the metrics service ("calculateMetrics" method) for orcid KPIs let dashboard: string = properties.environment + "_" + properties.dashboard + (portalId? "_" + portalId : ""); let result = { "dashboard": dashboard, - "pids": pids.split(","), + "openaireId": openaireId, + "pids": pids? pids.split(",") : [], "work": work }; let url: string = properties.orcidAPIURL+"orcid/work/save"; @@ -93,10 +96,11 @@ export class OrcidService { // return this.http.post(url, JSON.stringify(work), CustomOptions.registryOptions()) // .pipe(map(res => work)); // } - updateWork(resultLandingInfo: ResultLandingInfo, pids: string, putCode: string) { + updateWork(resultLandingInfo: ResultLandingInfo, openaireId: string, pids: string, putCode: string) { let work = WorkV3_0.resultLandingInfoConvert(resultLandingInfo, putCode); let result = { - "pids": pids.split(","), + "openaireId": openaireId, + "pids": pids ? pids.split(",") : [], "work": work }; diff --git a/orcid/orcidWork.ts b/orcid/orcidWork.ts index 054384a0..e92fbcb2 100644 --- a/orcid/orcidWork.ts +++ b/orcid/orcidWork.ts @@ -154,6 +154,15 @@ export class WorkV3_0 { ) }) })) + } else { + work['external-ids'] = { 'external-id': [{ + "external-id-type": "source-work-id", + "external-id-value": resultLandingInfo.relcanId, + "external-id-relationship": "self", + "external-id-url": { + "value": "https://explore.openaire.eu/search/"+resultLandingInfo.resultType+"?id="+resultLandingInfo.relcanId + }, + }] }; } // url (UrlV3_0, optional), diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 67044711..054997ae 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -409,7 +409,8 @@ [status]=searchUtils.status [type]="entityType" [showLoading]="true" [properties]=properties - [compactView]="compactView"> + [compactView]="compactView" + [isLoggedIn]="isLoggedIn"> { + if (user) { + this.isLoggedIn = true; + } else { + this.isLoggedIn = false; + } + }, error => { + this.isLoggedIn = false; + })); + if(properties.adminToolsPortalType !== "explore") { //this.getDivContents(); this.getPageContents(); diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index cd2467d5..1914bf8d 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -26,6 +26,8 @@ export class SearchResultComponent implements OnInit, OnChanges { @Input() showEnermaps: boolean; @Input() compactView: boolean = false; // if true, show less info (e.g. hide description) on each result + @Input() isLoggedIn: boolean = false; + public isMobile: boolean = false; private subscriptions: any[] = []; @@ -60,25 +62,30 @@ export class SearchResultComponent implements OnInit, OnChanges { } if ((properties.adminToolsPortalType == "explore" || properties.adminToolsPortalType == "community" || properties.adminToolsPortalType == "aggregator" || properties.dashboard == "irish") - && Session.isLoggedIn() && this.results && this.results.length > 0 + && this.isLoggedIn && this.results && this.results.length > 0 && (this.type == "result" || this.type == "publication" || this.type == "dataset" || this.type == "software" || this.type == "other") ) { - this.subscriptions.push(this.orcidService.getPutCodes(this.previewResults.map( + this.subscriptions.push(this.orcidService.getPutCodes( + this.previewResults.map(previewResult => {return previewResult.relcanId}), + this.previewResults.map( previewResult => { if (previewResult.identifiers) { - let pidsArray: string[] = []; - for (let key of Array.from(previewResult.identifiers.keys())) { - pidsArray = pidsArray.concat(previewResult.identifiers.get(key)); + let pidsArray: string[] = null; + if(previewResult.identifiers?.size > 0) { + pidsArray = []; + for (let key of Array.from(previewResult.identifiers.keys())) { + pidsArray = pidsArray.concat(previewResult.identifiers.get(key)); + } } return pidsArray;//.join(); } })).subscribe( putCodes => { for (let i = 0; i < this.previewResults.length; i++) { - if (this.previewResults[i].identifiers) { + //if (this.previewResults[i].identifiers) { this.previewResults[i].orcidPutCodes = putCodes[i]; // console.debug(i, this.previewResults[i].orcidPutCodes); - } + //} } this.previewResults = JSON.parse(JSON.stringify(this.previewResults, this.replacer), this.reviver); }, error => { diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 01ebc125..717ca160 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -193,7 +193,7 @@ [url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id" [showTooltip]="false" [compactView]="compactView"> - - 0; + this.showOrcid; } projectActions() { -- 2.17.1 From 49528c98746591fe519c49944119274fbb97efb3 Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 9 Sep 2024 13:22:09 +0300 Subject: [PATCH 02/13] [develop | DONE | FIXED] minor typo in search bar plugin --- .../components/search-bar/plugin-search-bar.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/plugins/components/search-bar/plugin-search-bar.component.ts b/dashboard/plugins/components/search-bar/plugin-search-bar.component.ts index efc1fb63..83704fb2 100644 --- a/dashboard/plugins/components/search-bar/plugin-search-bar.component.ts +++ b/dashboard/plugins/components/search-bar/plugin-search-bar.component.ts @@ -44,7 +44,7 @@ export class PluginSearchBar extends PluginBaseInfo{ -
+
-- 2.17.1 From 8e41736f487e0c5895068e5ca5ec613e288135ef Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 10 Sep 2024 00:20:08 +0300 Subject: [PATCH 03/13] [develop | DONE | ADDED]: fos.component.less: (commented classes) Experimenting on visibility and transitioning of FoS L4. --- fos/fos.component.less | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/fos/fos.component.less b/fos/fos.component.less index c8020e14..bb0f90ed 100644 --- a/fos/fos.component.less +++ b/fos/fos.component.less @@ -3,3 +3,25 @@ .custom-bottom-border { border-bottom: 5px solid fade(@explore-color, @global-opacity); } + +//.child { +// height: 0; +// //visibility: hidden; +// opacity: 0; +//} +// +//.parent:hover .uk-transition-slide-top { +// transition-delay: 0.5s; +//} +// +//.parent:hover .child { +// height: auto; +// visibility: visible; +// opacity: 1; +// //transition-delay: 0.5s; +// //transition: 0.6s ease-out; +//} +// +//.parent { +// //transition: all 0.6s ease-out; +//} \ No newline at end of file -- 2.17.1 From 8f4dc4a4ee81ce22f9a775077e035daea9febd99 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 10 Sep 2024 00:25:40 +0300 Subject: [PATCH 04/13] [develop | DONE | FIXED]: slider-tab.component.ts & slider-tabs.component.ts: Added element for embedded code. --- sharedComponents/tabs/slider-tab.component.ts | 2 +- sharedComponents/tabs/slider-tabs.component.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sharedComponents/tabs/slider-tab.component.ts b/sharedComponents/tabs/slider-tab.component.ts index b2113b55..a8a13a05 100644 --- a/sharedComponents/tabs/slider-tab.component.ts +++ b/sharedComponents/tabs/slider-tab.component.ts @@ -3,7 +3,7 @@ import {ActivatedRoute} from "@angular/router"; @Component({ selector: 'slider-tab', - template: `` + template: `` }) export class SliderTabComponent { @Input("tabTitle") diff --git a/sharedComponents/tabs/slider-tabs.component.ts b/sharedComponents/tabs/slider-tabs.component.ts index ae72cece..dc0419a5 100644 --- a/sharedComponents/tabs/slider-tabs.component.ts +++ b/sharedComponents/tabs/slider-tabs.component.ts @@ -21,6 +21,7 @@ declare var UIkit; @Component({ selector: 'slider-tabs', template: ` +
-- 2.17.1 From 38f411b5145c6c2f19dee2caa95fd172f110bbbb Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 10 Sep 2024 00:36:06 +0300 Subject: [PATCH 05/13] [develop | DONE | REMOVED]: resultLanding.module.ts: Removed unused import of SearchTabModule. --- landingPages/result/resultLanding.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index d1792e55..2d7dfc11 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -38,7 +38,6 @@ import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; import {ResultLandingRoutingModule} from "./resultLanding-routing.module"; import {OrcidCoreModule} from "../../orcid/orcid-core.module"; -import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module"; @NgModule({ imports: [ -- 2.17.1 From e66192172a9f19820f3617933412f7edb4d2374e Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 10 Sep 2024 02:07:04 +0300 Subject: [PATCH 06/13] [develop | DONE | FIXED]: navigationBar.component.ts: Added a class field public isClient: boolean = false; and set it in constructor with "this.isClient = !isPlatformServer(this.platform);" statement | navigationBar.component.html: Added checks not to display dropdowns on server (needed also for non destructive hydration). --- sharedComponents/navigationBar.component.html | 4 ++-- sharedComponents/navigationBar.component.ts | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html index a0147369..8b90121a 100644 --- a/sharedComponents/navigationBar.component.html +++ b/sharedComponents/navigationBar.component.html @@ -220,7 +220,7 @@ {{menu.badge}} {{menu.title}} -
+
    @@ -272,7 +272,7 @@ {{menu.title}} -
      diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts index bffc64f1..a0657c2b 100644 --- a/sharedComponents/navigationBar.component.ts +++ b/sharedComponents/navigationBar.component.ts @@ -1,10 +1,10 @@ import { ChangeDetectorRef, - Component, ElementRef, + Component, ElementRef, Inject, Input, OnChanges, OnDestroy, - OnInit, QueryList, + OnInit, PLATFORM_ID, SimpleChanges, ViewChild, ViewChildren } from '@angular/core'; @@ -21,6 +21,7 @@ import {NotificationConfiguration} from "../notifications/notifications-sidebar/ import {SearchInputComponent} from "./search-input/search-input.component"; import {Filter} from "../searchPages/searchUtils/searchHelperClasses.class"; import {RouterHelper} from "../utils/routerHelper.class"; +import {isPlatformServer} from "@angular/common"; declare var UIkit; @@ -97,12 +98,16 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges { @ViewChild('canvas') canvas: ElementRef; public routerHelper: RouterHelper = new RouterHelper(); + public isClient: boolean = false; constructor(private router: Router, private route: ActivatedRoute, private config: ConfigurationService, private _helpContentService: HelpContentService, private layoutService: LayoutService, - private cdr: ChangeDetectorRef) {} + private cdr: ChangeDetectorRef, + @Inject(PLATFORM_ID) private platform: any) { + this.isClient = !isPlatformServer(this.platform); + } ngOnInit() { this.subs.push(this.route.queryParams.subscribe(params => { -- 2.17.1 From 980fc6a34adb9e4ec7e87948a7c29127a387090c Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 10 Sep 2024 02:13:05 +0300 Subject: [PATCH 07/13] [develop | DONE | FIXED]: userMini.component.ts Added a class field isClient: boolean = false; and set it in constructor with "this.isClient = !isPlatformServer(this.platform);" statement & added checks not to display dropdowns on server (needed also for non destructive hydration). --- login/userMini.component.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/login/userMini.component.ts b/login/userMini.component.ts index 87029003..08d20edc 100644 --- a/login/userMini.component.ts +++ b/login/userMini.component.ts @@ -1,4 +1,14 @@ -import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild} from '@angular/core'; +import { + Component, + EventEmitter, + Inject, + Input, + OnChanges, + OnInit, + Output, PLATFORM_ID, + SimpleChanges, + ViewChild +} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Session, User} from './utils/helper.class'; import {RouterHelper} from '../utils/routerHelper.class'; @@ -9,6 +19,7 @@ import { NotificationConfiguration, NotificationsSidebarComponent } from "../notifications/notifications-sidebar/notifications-sidebar.component"; +import {isPlatformServer} from "@angular/common"; declare var UIkit; @@ -27,7 +38,7 @@ declare var UIkit; -
      +
      • Date: Wed, 11 Sep 2024 20:33:33 +0300 Subject: [PATCH 08/13] [develop | DONE | FIXED]: showAuthors.component.ts: Typo fix in ORCID box (3rd party repositories, not 3d party). --- utils/authors/showAuthors.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index 64857b73..2262625e 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -58,7 +58,7 @@ import {properties} from "../../../../environments/environment"; Harvested from ORCID Public Data File Derived by OpenAIRE algorithms or harvested - from 3d party repositories + from 3rd party repositories
      Date: Wed, 11 Sep 2024 21:04:03 +0300 Subject: [PATCH 09/13] [develop | DONE | CHANGED] Renamed property "eoscMarketplaceURL" to "openScienceCloudURL" and added new property "eoscMarketplaceURL" (new value) | Updated current domain and marketplace domain from eosc-portal.eu to eosc-beyond.eu. 1. env-properties.ts: Added property openScienceCloudURL?: string. 2. environment.ts: Renamed property "eoscMarketplaceURL" to "openScienceCloudURL" and set value for new property "eoscMarketplaceURL". 3. dataProviderInfo.ts: Use properties.openScienceCloudURL instead of properties.eoscMarketplaceURL. 4. dataProvider.component.ts & organization.component.ts & project.component.ts & resultLanding.component.ts: Updated method "eoscBackLink()" to use "properties.eoscMarketplaceURL" instead of static url "https://search.marketplace.eosc-portal.eu/". 5. parsingFunctions.class.ts: In eoscSubjects use "properties.eoscMarketplaceURL" instead of static url "https://search.marketplace.eosc-portal.eu/". 6. connectHelper.ts: In method "getCommunityFromDomain()", added check domain.indexOf('eosc-beyond.eu') != -1. --- connect/connectHelper.ts | 2 +- .../dataProvider/dataProvider.component.ts | 5 +++-- .../landing-utils/parsingFunctions.class.ts | 10 +++++----- .../organization/organization.component.ts | 7 ++++--- landingPages/project/project.component.ts | 5 +++-- landingPages/result/resultLanding.component.ts | 5 +++-- utils/entities/dataProviderInfo.ts | 2 +- utils/properties/env-properties.ts | 1 + utils/properties/environments/environment.ts | 14 +++++++++++--- 9 files changed, 32 insertions(+), 19 deletions(-) diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 0e9d1e43..8d940b48 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -15,7 +15,7 @@ export class ConnectHelper { // domain = "covid-19.openaire.eu"; //for testing } domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix - if (domain.indexOf('eosc-portal.eu') != -1) { + if (domain.indexOf('eosc-portal.eu') != -1 || domain.indexOf('eosc-beyond.eu') != -1) { return "eosc"; } if (domain.indexOf('openaire.eu') === -1) { diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts index 60c954ec..92c5b553 100644 --- a/landingPages/dataProvider/dataProvider.component.ts +++ b/landingPages/dataProvider/dataProvider.component.ts @@ -988,10 +988,11 @@ export class DataProviderComponent { } public get eoscBackLink() { - if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) { + if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == this.properties.eoscMarketplaceURL))) { return this.referrer+this.prevPath; } else { - return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; + return this.properties.eoscMarketplaceURL; + // return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; } } } diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 240c7093..837ca6ee 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -14,11 +14,11 @@ import {StringUtils} from "../../utils/string-utils.class"; }) export class ParsingFunctions { public eoscSubjects = [ - {label: 'EOSC::Jupyter Notebook', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=eosc_if:%22Jupyter%20Notebook%22', value: 'Jupyter Notebook'}, - {label: 'EOSC::RO-crate', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=eosc_if:%22RO%5C-crate%22', value: 'RO-crate'}, - {label: 'EOSC::Galaxy Workflow', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=eosc_if:%22Galaxy%20Workflow%22', value: 'Galaxy Workflow'}, - {label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=eosc_if:%22Twitter%20Data%22', value: 'Twitter Data'}, - {label: 'EOSC::Data Cube', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=eosc_if:%22Data%20Cube%22', value: 'Data Cube'} + {label: 'EOSC::Jupyter Notebook', link: properties.eoscMarketplaceURL+'search/service?q=*&fq=eosc_if:%22Jupyter%20Notebook%22', value: 'Jupyter Notebook'}, + {label: 'EOSC::RO-crate', link: properties.eoscMarketplaceURL+'search/service?q=*&fq=eosc_if:%22RO%5C-crate%22', value: 'RO-crate'}, + {label: 'EOSC::Galaxy Workflow', link: properties.eoscMarketplaceURL+'search/service?q=*&fq=eosc_if:%22Galaxy%20Workflow%22', value: 'Galaxy Workflow'}, + {label: 'EOSC::Twitter Data', link: properties.eoscMarketplaceURL+'search/service?q=*&fq=eosc_if:%22Twitter%20Data%22', value: 'Twitter Data'}, + {label: 'EOSC::Data Cube', link: properties.eoscMarketplaceURL+'search/service?q=*&fq=eosc_if:%22Data%20Cube%22', value: 'Data Cube'} ] public notebookInSubjects: boolean = false; private notebookKeyword: string = "eosc jupyter notebook"; diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index ad7f77c8..d32a336b 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -830,10 +830,11 @@ export class OrganizationComponent { } public get eoscBackLink() { - if (this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) { - return this.referrer + this.prevPath; + if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == this.properties.eoscMarketplaceURL))) { + return this.referrer+this.prevPath; } else { - return "https://" + (this.properties.environment == "beta" ? "beta." : "") + "search.marketplace.eosc-portal.eu/"; + return this.properties.eoscMarketplaceURL; + // return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; } } } diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 4ae72222..928a968f 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -1098,10 +1098,11 @@ export class ProjectComponent { } public get eoscBackLink() { - if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) { + if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == this.properties.eoscMarketplaceURL))) { return this.referrer+this.prevPath; } else { - return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; + return this.properties.eoscMarketplaceURL; + // return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; } } } diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 910897ff..a3136619 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -1246,10 +1246,11 @@ export class ResultLandingComponent { } public get eoscBackLink() { - if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) { + if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == this.properties.eoscMarketplaceURL))) { return this.referrer+this.prevPath; } else { - return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; + return this.properties.eoscMarketplaceURL; + // return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; } } } diff --git a/utils/entities/dataProviderInfo.ts b/utils/entities/dataProviderInfo.ts index 7ed87639..8054e5cb 100644 --- a/utils/entities/dataProviderInfo.ts +++ b/utils/entities/dataProviderInfo.ts @@ -10,7 +10,7 @@ export class DataproviderProvenance { this.provenance.set("re3data_____::", {"urlPrefix": properties.r3DataURL, "name": "re3data.org"}); this.provenance.set("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"}); this.provenance.set("eosc________::", { - "urlPrefix": properties.eoscMarketplaceURL, + "urlPrefix": properties.openScienceCloudURL, "name": "EOSC Resource Hub" }); } } diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index f518f97f..daa1534d 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -52,6 +52,7 @@ export interface EnvProperties { wikiDataURL?: string; fundRefURL?: string; fairSharingURL?: string, + openScienceCloudURL?: string, eoscMarketplaceURL?: string, sherpaURL?: string; sherpaURLSuffix?: string; diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index 94f0cea2..6d6a7617 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -25,7 +25,7 @@ export let common: EnvProperties = { wikiDataURL: "https://www.wikidata.org/wiki/", fundRefURL: "https://data.crossref.org/fundingdata/funder/", fairSharingURL: "https://fairsharing.org/", - eoscMarketplaceURL: "https://open-science-cloud.ec.europa.eu/resources/services/", + openScienceCloudURL: "https://open-science-cloud.ec.europa.eu/resources/services/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/", sherpaURLSuffix: "/", zenodo: "https://zenodo.org/", @@ -135,6 +135,8 @@ export let commonDev: EnvProperties = { miningBackendURL: 'https://beta.services.openaire.eu/interactive-mining', feedbackmailForMissingEntities: 'feedback@openaire.eu', connectPortalUrl: 'http://scoobydoo.di.uoa.gr:4200', + // eosc urls + eoscMarketplaceURL: "https://search.marketplace.sandbox.eosc-beyond.eu" } export let commonTest: EnvProperties = { @@ -163,7 +165,8 @@ export let commonTest: EnvProperties = { adminPortalURL: "https://admin.connect.openaire.eu", baseOpenaireLink: 'https://explore.openaire.eu', - + // eosc urls + eoscMarketplaceURL: "https://search.marketplace.sandbox.eosc-beyond.eu" } export let commonBeta: EnvProperties = { @@ -203,6 +206,8 @@ export let commonBeta: EnvProperties = { deleteBrowserCacheUrl: 'https://beta.services.openaire.eu/uoa-admin-tools/cache', connectPortalUrl: 'https://beta.connect.openaire.eu', + // eosc urls + eoscMarketplaceURL: "https://search.marketplace.sandbox.eosc-beyond.eu/" } export let commonProd: EnvProperties = { @@ -243,7 +248,10 @@ export let commonProd: EnvProperties = { connectPortalUrl: 'https://connect.openaire.eu', //irish - openOrgsUrl:"https://orgs.openaire.eu" + openOrgsUrl:"https://orgs.openaire.eu", + + // eosc urls + eoscMarketplaceURL: "https://search.marketplace.eosc-beyond.eu" } -- 2.17.1 From d298a10686f2cd79242f3aec0d229a623c0bca55 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 12 Sep 2024 10:49:03 +0300 Subject: [PATCH 10/13] [develop | DONE | CHANGED] monitorServiceAPIURL, notificationsAPIURL, adminToolsAPIURL properties: moved to service files and not function parameters, remove duplicate '/' from stakeholder.service.ts --- .../components/curators/curators.component.ts | 2 +- connect/curators/curator.service.ts | 7 +- dashboard/divId/divIds.component.ts | 10 +- .../class-help-content-form.component.ts | 8 +- .../class-help-contents.component.ts | 8 +- dashboard/entity/entities.component.ts | 12 +- .../page-help-content-form.component.ts | 4 +- .../helpTexts/page-help-contents.component.ts | 8 +- dashboard/menu/menu.component.ts | 2 +- dashboard/page/pages.component.ts | 24 +-- .../plugins-form/pluginsForm.component.ts | 8 +- dashboard/plugins/plugins.component.ts | 16 +- .../templates/pluginTemplates.component.ts | 12 +- dashboard/portal/portals.component.ts | 8 +- .../edit-stakeholder.component.ts | 4 +- monitor-admin/general/general.component.ts | 2 +- .../manage-all.component.ts | 4 +- .../manageStakeholders.component.ts | 4 +- monitor-admin/topic/indicators.component.ts | 24 +-- monitor-admin/topic/topic.component.ts | 12 +- monitor-admin/umbrella/umbrella.component.ts | 4 +- monitor/services/stakeholder.service.ts | 69 +++++---- services/help-content.service.ts | 140 +++++++++--------- services/plugins.service.ts | 56 +++---- 24 files changed, 230 insertions(+), 218 deletions(-) diff --git a/connect/components/curators/curators.component.ts b/connect/components/curators/curators.component.ts index 3fbbb7b0..e36afa17 100644 --- a/connect/components/curators/curators.component.ts +++ b/connect/components/curators/curators.component.ts @@ -97,7 +97,7 @@ export class CuratorsComponent { } private getCurators() { - this.subs.push(this.curatorsService.getCurators(this.properties, this.community.communityId).subscribe(curators => { + this.subs.push(this.curatorsService.getCurators(this.community.communityId).subscribe(curators => { this.curators = curators; this.showLoading = false; }, error => { diff --git a/connect/curators/curator.service.ts b/connect/curators/curator.service.ts index 52516530..a87d264f 100644 --- a/connect/curators/curator.service.ts +++ b/connect/curators/curator.service.ts @@ -4,6 +4,7 @@ import {Observable} from 'rxjs'; import {Curator} from '../../utils/entities/CuratorInfo'; import {EnvProperties} from '../../utils/properties/env-properties'; import {CustomOptions} from "../../services/servicesUtils/customOptions.class"; +import {properties} from '../../../../environments/environment'; @Injectable() export class CuratorService { @@ -11,17 +12,17 @@ export class CuratorService { constructor(private http: HttpClient) { } - public getCurators(properties: EnvProperties, communityId: string): Observable { + public getCurators(communityId: string): Observable { let url: string = properties.adminToolsAPIURL + communityId + '/curator'; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); } - public updateCurator(properties: EnvProperties, curator: Curator) { + public updateCurator(curator: Curator) { let url: string = properties.adminToolsAPIURL + "curator"; return this.http.post(url, curator, CustomOptions.registryOptions()); } - public getCurator(properties: EnvProperties): Observable { + public getCurator(): Observable { let url: string = properties.adminToolsAPIURL + 'curator'; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url, CustomOptions.registryOptions()); } diff --git a/dashboard/divId/divIds.component.ts b/dashboard/divId/divIds.component.ts index 2c3d964c..120e7641 100644 --- a/dashboard/divId/divIds.component.ts +++ b/dashboard/divId/divIds.component.ts @@ -80,7 +80,7 @@ export class DivIdsComponent implements OnInit { getDivIds() { this.showLoading = true; - this.subscriptions.push(this._helpContentService.getAllDivIdsFull(this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getAllDivIdsFull().subscribe( divIds => { this.divIds = divIds; this.checkboxes = []; @@ -138,7 +138,7 @@ export class DivIdsComponent implements OnInit { public confirmedDeleteDivIds(data: any) { this.showLoading = true; - this.subscriptions.push(this._helpContentService.deleteDivIds(this.selectedDivIds, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.deleteDivIds(this.selectedDivIds).subscribe( _ => { this.deleteDivIdsFromArray(this.selectedDivIds); NotificationHandler.rise('Classes have been successfully deleted'); @@ -191,7 +191,7 @@ export class DivIdsComponent implements OnInit { public divIdSaveConfirmed(data: any) { this.showLoading = true; if (!this.classForm.getRawValue()._id) { - this.subscriptions.push(this._helpContentService.saveDivId(this.classForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.saveDivId(this.classForm.getRawValue()).subscribe( divId => { this.divIdSavedSuccessfully(divId); NotificationHandler.rise('Class ' + divId.name + ' has been successfully created'); @@ -200,7 +200,7 @@ export class DivIdsComponent implements OnInit { error => this.handleUpdateError("System error creating class", error) )); } else { - this.subscriptions.push(this._helpContentService.updateDivId(this.classForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.updateDivId(this.classForm.getRawValue()).subscribe( divId => { this.divIdUpdatedSuccessfully(divId); NotificationHandler.rise('Class ' + divId.name + ' has been successfully updated'); @@ -261,7 +261,7 @@ export class DivIdsComponent implements OnInit { getPages() { this.showLoading = true; - this.subscriptions.push(this._helpContentService.getAllPages(this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getAllPages().subscribe( pages => { this.allPages = []; pages.forEach(page => { diff --git a/dashboard/divhelpcontent/class-help-content-form.component.ts b/dashboard/divhelpcontent/class-help-content-form.component.ts index e2ca58a1..0025c243 100644 --- a/dashboard/divhelpcontent/class-help-content-form.component.ts +++ b/dashboard/divhelpcontent/class-help-content-form.component.ts @@ -59,8 +59,8 @@ export class ClassContentFormComponent implements OnInit { getInfo(pageId: string) { this.showLoading = true; - let obs = zip(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal), - this._helpContentService.getDivIdsFullByPortal(pageId, this.properties.adminToolsAPIURL, this.portal)); + let obs = zip(this._helpContentService.getPageByPortal(pageId, this.portal), + this._helpContentService.getDivIdsFullByPortal(pageId, this.portal)); this.subs.push(obs.subscribe( results => { this.page = results[0]; @@ -73,7 +73,7 @@ export class ClassContentFormComponent implements OnInit { this.showLoading = false; this.initCKEditor(); } else { - this.subs.push(this._helpContentService.getDivHelpContent(this.pageContentId, this.properties.adminToolsAPIURL, this.portal).subscribe(pageHelpContent => { + this.subs.push(this._helpContentService.getDivHelpContent(this.pageContentId, this.portal).subscribe(pageHelpContent => { this.pageHelpContent = pageHelpContent; if (this.properties.adminToolsPortalType != this.page.portalType) { this._router.navigate(['../'], {relativeTo: this.route}); @@ -161,7 +161,7 @@ export class ClassContentFormComponent implements OnInit { if (this.myForm.valid) { this.showLoading = true; let pageHelpContent: DivHelpContent = this.myForm.getRawValue(); - this.subs.push(this._helpContentService.insertOrUpdateDivHelpContent(pageHelpContent, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subs.push(this._helpContentService.insertOrUpdateDivHelpContent(pageHelpContent, this.portal).subscribe( _ => { this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); NotificationHandler.rise('Page content has been successfully updated'); diff --git a/dashboard/divhelpcontent/class-help-contents.component.ts b/dashboard/divhelpcontent/class-help-contents.component.ts index 6ecdcbb4..17481f72 100644 --- a/dashboard/divhelpcontent/class-help-contents.component.ts +++ b/dashboard/divhelpcontent/class-help-contents.component.ts @@ -79,7 +79,7 @@ export class ClassHelpContentsComponent implements OnInit { getPage(pageId: string) { this.showLoading = true; - this.subscriptions.push(this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subscriptions.push(this._helpService.getPageByPortal(pageId, this.portal).subscribe( page => { if (this.properties.adminToolsPortalType != page.portalType) { this.router.navigate(['./pageContents'], {queryParams: {'communityId': this.portal}}); @@ -109,7 +109,7 @@ export class ClassHelpContentsComponent implements OnInit { } getPageHelpContents(community_pid: string) { - this.subscriptions.push(this._helpService.getCommunityDivHelpContents(community_pid, this.properties.adminToolsAPIURL, this.selectedPageId).subscribe( + this.subscriptions.push(this._helpService.getCommunityDivHelpContents(community_pid, this.selectedPageId).subscribe( pageHelpContents => { this.divHelpContents = pageHelpContents as Array; this.counter.all = this.divHelpContents.length; @@ -150,7 +150,7 @@ export class ClassHelpContentsComponent implements OnInit { public confirmedDeletePageHelpContents(data: any) { this.showLoading = true; - this.subscriptions.push(this._helpService.deleteDivHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subscriptions.push(this._helpService.deleteDivHelpContents(this.selectedPageContents, this.portal).subscribe( _ => { this.deletePageHelpContentsFromArray(this.selectedPageContents); NotificationHandler.rise('Page content(s) has been successfully deleted'); @@ -189,7 +189,7 @@ export class ClassHelpContentsComponent implements OnInit { } public togglePageHelpContents(status: boolean, ids: string[]) { - this.subscriptions.push(this._helpService.toggleDivHelpContents(ids, status, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subscriptions.push(this._helpService.toggleDivHelpContents(ids, status, this.portal).subscribe( () => { for (let id of ids) { let i = this.checkboxes.findIndex(_ => _.divHelpContent._id == id); diff --git a/dashboard/entity/entities.component.ts b/dashboard/entity/entities.component.ts index 6607626e..cbf330d2 100644 --- a/dashboard/entity/entities.component.ts +++ b/dashboard/entity/entities.component.ts @@ -125,7 +125,7 @@ export class EntitiesComponent implements OnInit { getEntities(portal: string) { this.showLoading = true; if (portal) { - this._helpContentService.getCommunityEntities(portal, this.properties.adminToolsAPIURL).subscribe( + this._helpContentService.getCommunityEntities(portal).subscribe( entities => { this.entities = entities; this.checkboxes = []; @@ -139,7 +139,7 @@ export class EntitiesComponent implements OnInit { }, error => this.handleError('System error retrieving entities', error)); } else { - this._helpContentService.getEntities(this.properties.adminToolsAPIURL).subscribe( + this._helpContentService.getEntities().subscribe( entities => { this.entities = entities; this.checkboxes = []; @@ -197,7 +197,7 @@ export class EntitiesComponent implements OnInit { public confirmedDeleteEntities(data: any) { this.showLoading = true; - this._helpContentService.deleteEntities(this.selectedEntities, this.properties.adminToolsAPIURL).subscribe( + this._helpContentService.deleteEntities(this.selectedEntities).subscribe( _ => { this.deleteEntitiesFromArray(this.selectedEntities); NotificationHandler.rise('Entities have been successfully deleted'); @@ -240,7 +240,7 @@ export class EntitiesComponent implements OnInit { this.showLoading = true; if (this.entityForm.getRawValue()._id) { this._helpContentService.updateEntity( - this.entityForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe( + this.entityForm.getRawValue()).subscribe( entity => { this.entityUpdatedSuccessfully(entity); NotificationHandler.rise('Entity ' + entity.name + ' has been successfully updated'); @@ -250,7 +250,7 @@ export class EntitiesComponent implements OnInit { error => this.handleUpdateError('System error updating entity', error) ); } else { - this._helpContentService.saveEntity(this.entityForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe( + this._helpContentService.saveEntity(this.entityForm.getRawValue()).subscribe( entity => { this.entitySavedSuccessfully(entity); NotificationHandler.rise('Entity ' + entity.name + ' has been successfully created'); @@ -338,7 +338,7 @@ export class EntitiesComponent implements OnInit { public continueToggling(event: any) { this._helpContentService.toggleEntities( - this.portal, this.toggleIds, this.toggleStatus, this.properties.adminToolsAPIURL).subscribe( + this.portal, this.toggleIds, this.toggleStatus).subscribe( () => { for (let id of this.toggleIds) { const i = this.checkboxes.findIndex(_ => _.entity._id === id); diff --git a/dashboard/helpTexts/page-help-content-form.component.ts b/dashboard/helpTexts/page-help-content-form.component.ts index 3ff04faf..776ffc1b 100644 --- a/dashboard/helpTexts/page-help-content-form.component.ts +++ b/dashboard/helpTexts/page-help-content-form.component.ts @@ -62,7 +62,7 @@ export class PageContentFormComponent implements OnInit { getInfo(pageId: string) { this.showLoading = true; - let obs = zip(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal), this._helpContentService.getCommunityPageHelpContents(this.portal, this.properties.adminToolsAPIURL, pageId)); + let obs = zip(this._helpContentService.getPageByPortal(pageId, this.portal), this._helpContentService.getCommunityPageHelpContents(this.portal, pageId)); this.subs.push(obs.subscribe( results => { this.page = results[0]; @@ -197,7 +197,7 @@ export class PageContentFormComponent implements OnInit { if (this.myForm.valid) { this.showLoading = true; let pageHelpContent: PageHelpContent = this.myForm.getRawValue(); - this.subs.push(this._helpContentService.savePageHelpContent(pageHelpContent, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subs.push(this._helpContentService.savePageHelpContent(pageHelpContent, this.portal).subscribe( _ => { NotificationHandler.rise('Page content has been successfully ' + (this.pageContentId ? 'updated' : 'created') + ''); this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); diff --git a/dashboard/helpTexts/page-help-contents.component.ts b/dashboard/helpTexts/page-help-contents.component.ts index 531dac25..f3fe8c4b 100644 --- a/dashboard/helpTexts/page-help-contents.component.ts +++ b/dashboard/helpTexts/page-help-contents.component.ts @@ -82,7 +82,7 @@ export class PageHelpContentsComponent implements OnInit { getPage(pageId: string) { this.showLoading = true; - this.subscriptions.push(this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subscriptions.push(this._helpService.getPageByPortal(pageId, this.portal).subscribe( page => { if (this.properties.adminToolsPortalType != page.portalType) { this.router.navigate(['./pageContents']); @@ -111,7 +111,7 @@ export class PageHelpContentsComponent implements OnInit { } getPageHelpContents(community_pid: string) { - this.subscriptions.push(this._helpService.getCommunityPageHelpContents(community_pid, this.properties.adminToolsAPIURL, this.selectedPageId).subscribe( + this.subscriptions.push(this._helpService.getCommunityPageHelpContents(community_pid, this.selectedPageId).subscribe( pageHelpContents => { this.pageHelpContents = pageHelpContents as Array; this.counter.all = this.pageHelpContents.length; @@ -160,7 +160,7 @@ export class PageHelpContentsComponent implements OnInit { public confirmedDeletePageHelpContents(data: any) { this.showLoading = true; - this.subscriptions.push(this._helpService.deletePageHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subscriptions.push(this._helpService.deletePageHelpContents(this.selectedPageContents, this.portal).subscribe( _ => { this.deletePageHelpContentsFromArray(this.selectedPageContents); NotificationHandler.rise('Page content(s) has been successfully deleted'); @@ -201,7 +201,7 @@ export class PageHelpContentsComponent implements OnInit { } public togglePageHelpContents(status: boolean, ids: string[]) { - this.subscriptions.push(this._helpService.togglePageHelpContents(ids, status, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subscriptions.push(this._helpService.togglePageHelpContents(ids, status, this.portal).subscribe( () => { for (let id of ids) { let i = this.checkboxes.findIndex(_ => _.pageHelpContent._id == id); diff --git a/dashboard/menu/menu.component.ts b/dashboard/menu/menu.component.ts index 788469da..5f32db4c 100644 --- a/dashboard/menu/menu.component.ts +++ b/dashboard/menu/menu.component.ts @@ -181,7 +181,7 @@ export class MenuComponent implements OnInit { getPages() { this.subscriptions.push( - this._helpContentService.getCommunityPagesByType(this.portal, '', this.properties.adminToolsAPIURL).subscribe( + this._helpContentService.getCommunityPagesByType(this.portal, '').subscribe( data => { let pages = data; this.pageStatus = new Map(); diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts index 9f110d9f..1cd7809d 100644 --- a/dashboard/page/pages.component.ts +++ b/dashboard/page/pages.component.ts @@ -131,7 +131,7 @@ export class PagesComponent implements OnInit { this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.portal; })); })); - this.subscriptions.push(this._helpContentService.getEntities(this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getEntities().subscribe( entities => { this.allEntities = []; entities.forEach(entity => { @@ -166,7 +166,7 @@ export class PagesComponent implements OnInit { parameters = '?page_type=' + this.pagesType; } if (portal) { - this.subscriptions.push(this._helpContentService.getCommunityPagesByType(portal, parameters, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getCommunityPagesByType(portal, parameters).subscribe( pages => { this.pagesReturned(pages); //if(!this.pagesType || this.pagesType == "link") { @@ -178,7 +178,7 @@ export class PagesComponent implements OnInit { error => this.handleError('System error retrieving pages', error) )); } else { - this.subscriptions.push(this._helpContentService.getAllPagesFull(this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getAllPagesFull().subscribe( pages => { this.pagesReturned(pages); this.showLoading = false; @@ -189,7 +189,7 @@ export class PagesComponent implements OnInit { } getPagesWithDivIds(portal: string) { - this.subscriptions.push(this._helpContentService.getPageIdsFromDivIds(portal, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getPageIdsFromDivIds(portal).subscribe( pages => { this.pageWithDivIds = pages; this.showLoading = false; @@ -247,7 +247,7 @@ export class PagesComponent implements OnInit { public confirmedDeletePages() { this.showLoading = true; - this.subscriptions.push(this._helpContentService.deletePages(this.selectedPages, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.deletePages(this.selectedPages).subscribe( _ => { this.deletePagesFromArray(this.selectedPages); NotificationHandler.rise('Pages have been successfully deleted'); @@ -316,7 +316,7 @@ export class PagesComponent implements OnInit { public pageSaveConfirmed(data: any) { this.showLoading = true; if (!this.pageForm.getRawValue()._id) { - this.subscriptions.push(this._helpContentService.savePage(this.pageForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.savePage(this.pageForm.getRawValue()).subscribe( page => { this.pageSavedSuccessfully(page, true); NotificationHandler.rise('Page ' + page.name + ' has been successfully created'); @@ -326,7 +326,7 @@ export class PagesComponent implements OnInit { error => this.handleUpdateError('System error creating page', error) )); } else { - this.subscriptions.push(this._helpContentService.updatePage(this.pageForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.updatePage(this.pageForm.getRawValue()).subscribe( page => { this.pageSavedSuccessfully(page, false); NotificationHandler.rise('Page ' + page.name + ' has been successfully updated'); @@ -408,7 +408,7 @@ export class PagesComponent implements OnInit { } public togglePages(status: boolean, ids: string[]) { - this.subscriptions.push(this._helpContentService.togglePages(this.portal, ids, status, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.togglePages(this.portal, ids, status).subscribe( () => { for (let id of ids) { let i = this.checkboxes.findIndex(_ => _.page._id == id); @@ -429,17 +429,17 @@ export class PagesComponent implements OnInit { } getCountsPerPID(community_pid: string) { - this.subscriptions.push(this._helpContentService.countCommunityPageHelpContents(community_pid, this.properties.adminToolsAPIURL, false).subscribe( + this.subscriptions.push(this._helpContentService.countCommunityPageHelpContents(community_pid, false).subscribe( pageHelpContentsCount => { this.pageHelpContentsCount = pageHelpContentsCount; }, error => this.handleError('System error retrieving page contents', error))); - this.subscriptions.push(this._helpContentService.countCommunityPageHelpContents(community_pid, this.properties.adminToolsAPIURL, true).subscribe( + this.subscriptions.push(this._helpContentService.countCommunityPageHelpContents(community_pid, true).subscribe( pageClassContentsCount => { this.pageClassContentsCount = pageClassContentsCount; }, error => this.handleError('System error retrieving page contents', error))); - this.subscriptions.push(this._pluginsService.countPluginTemplatePerPage( this.properties.adminToolsAPIURL, community_pid).subscribe( + this.subscriptions.push(this._pluginsService.countPluginTemplatePerPage(community_pid).subscribe( countPlugins => { this.pagePluginTemplatesCount = countPlugins; }, @@ -447,7 +447,7 @@ export class PagesComponent implements OnInit { } getPluginTemplatesContentsCounts() { - this.subscriptions.push(this._pluginsService.countPluginTemplatePerPageForAllPortals( this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._pluginsService.countPluginTemplatePerPageForAllPortals().subscribe( countPlugins => { this.pagePluginTemplatesCount = countPlugins; }, diff --git a/dashboard/plugins/plugins-form/pluginsForm.component.ts b/dashboard/plugins/plugins-form/pluginsForm.component.ts index c0ec0d16..4dbb41db 100644 --- a/dashboard/plugins/plugins-form/pluginsForm.component.ts +++ b/dashboard/plugins/plugins-form/pluginsForm.component.ts @@ -94,7 +94,7 @@ export class PluginsFormComponent implements OnInit { getPage(pageId: string) { this.showLoading = true; - this.subscriptions.push(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subscriptions.push(this._helpContentService.getPageByPortal(pageId, this.portal).subscribe( page => { if (this.properties.adminToolsPortalType != page.portalType) { this._router.navigate(['..'],{ relativeTo: this.route}); @@ -108,10 +108,10 @@ export class PluginsFormComponent implements OnInit { getPluginAndTemplate(){ if(this.selectedTemplateId){ - this.subscriptions.push(this._pluginsService.getPluginTemplateById(this.properties.adminToolsAPIURL, this.selectedTemplateId).subscribe(template => { + this.subscriptions.push(this._pluginsService.getPluginTemplateById(this.selectedTemplateId).subscribe(template => { this.selectedTemplate = template; if(this.selectedPluginId){ - this.subscriptions.push(this._pluginsService.getPluginById(this.properties.adminToolsAPIURL, this.selectedPluginId).subscribe(plugin => { + this.subscriptions.push(this._pluginsService.getPluginById(this.selectedPluginId).subscribe(plugin => { this.selectedPlugin = plugin; this.edit(this.selectedPlugin, this.selectedTemplate); })); @@ -167,7 +167,7 @@ export class PluginsFormComponent implements OnInit { this.savePlugin(plugin,update) } public savePlugin(plugin, update){ - this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.properties.adminToolsAPIURL,this.selectedCommunityPid ).subscribe( + this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.selectedCommunityPid ).subscribe( saved => { this._clearCacheService.purgeBrowserCache(null, this.selectedCommunityPid) this.edit(saved, this.selectedTemplate) diff --git a/dashboard/plugins/plugins.component.ts b/dashboard/plugins/plugins.component.ts index 3010aa8c..592e8f1c 100644 --- a/dashboard/plugins/plugins.component.ts +++ b/dashboard/plugins/plugins.component.ts @@ -116,7 +116,7 @@ export class PluginsComponent implements OnInit { getPage(pageId: string) { this.showLoading = true; - this.subscriptions.push(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal).subscribe( + this.subscriptions.push(this._helpContentService.getPageByPortal(pageId, this.portal).subscribe( page => { if (this.properties.adminToolsPortalType != page.portalType) { this._router.navigate(['./pageContents']); @@ -130,11 +130,11 @@ export class PluginsComponent implements OnInit { getPagePlugins() { this.showLoading = true; - this.subscriptions.push(this._pluginsService.getPluginTemplatesByPage(this.properties.adminToolsAPIURL, this.selectedCommunityPid, this.selectedPageId).subscribe( + this.subscriptions.push(this._pluginsService.getPluginTemplatesByPage(this.selectedCommunityPid, this.selectedPageId).subscribe( templates => { this.pluginTemplates = templates; - this.subscriptions.push(this._pluginsService.getPluginsByPage(this.properties.adminToolsAPIURL, this.selectedCommunityPid, this.selectedPageId).subscribe( + this.subscriptions.push(this._pluginsService.getPluginsByPage(this.selectedCommunityPid, this.selectedPageId).subscribe( plugins => { this.plugins = plugins; this.pluginsByPlacement = new Map(); @@ -200,7 +200,7 @@ export class PluginsComponent implements OnInit { } public savePlugin(plugin, update, index) { - this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe( + this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.selectedCommunityPid).subscribe( saved => { this.savedSuccessfully(saved, update, index); this.selectedTemplate = null; @@ -257,7 +257,7 @@ export class PluginsComponent implements OnInit { getPages() { this.showLoading = true; - this.subscriptions.push(this._helpContentService.getAllPages(this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getAllPages().subscribe( pages => { this.allPages = []; pages.forEach(page => { @@ -290,7 +290,7 @@ export class PluginsComponent implements OnInit { this.index = i; this.selectedTemplate = this.pluginsByPlacement.get(placement)[i].template; if (id) { - this.subscriptions.push(this._pluginsService.togglePlugin(id, status, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe( + this.subscriptions.push(this._pluginsService.togglePlugin(id, status, this.selectedCommunityPid).subscribe( () => { this.pluginsByPlacement.get(placement)[i].plugin.active = status; @@ -318,7 +318,7 @@ export class PluginsComponent implements OnInit { public move(plugin: Plugin, up: boolean, index, placement) { if (plugin._id) { - this.subscriptions.push(this._pluginsService.updatePluginOrder(plugin, this.properties.adminToolsAPIURL, up ? -1 : 1, this.selectedCommunityPid).subscribe( + this.subscriptions.push(this._pluginsService.updatePluginOrder(plugin, up ? -1 : 1, this.selectedCommunityPid).subscribe( saved => { this.pluginsByPlacement.get(placement)[index].plugin = saved; this.clearCache(); @@ -361,7 +361,7 @@ export class PluginsComponent implements OnInit { confirmDelete() { this.showLoading = true; - this.subscriptions.push(this._pluginsService.deletePlugin(this.selectedPlugin._id, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._pluginsService.deletePlugin(this.selectedPlugin._id).subscribe( deleted => { this.pluginsByPlacement.get(this.selectedPlacementView).splice(this.selectedPluginIndex, 1); this.clearCache(); diff --git a/dashboard/plugins/templates/pluginTemplates.component.ts b/dashboard/plugins/templates/pluginTemplates.component.ts index 31041916..fed43c4a 100644 --- a/dashboard/plugins/templates/pluginTemplates.component.ts +++ b/dashboard/plugins/templates/pluginTemplates.component.ts @@ -90,7 +90,7 @@ export class PluginTemplatesComponent implements OnInit { getPage(pageId: string) { this.showLoading = true; - this.subscriptions.push(this._helpContentService.getPageById(pageId, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getPageById(pageId).subscribe( page => { this.page = page; this.allPages = []; @@ -108,7 +108,7 @@ export class PluginTemplatesComponent implements OnInit { getTemplates(pageId = null) { this.showLoading = true; - this.subscriptions.push(this._pluginsService.getPluginTemplates(this.properties.adminToolsAPIURL, pageId).subscribe( + this.subscriptions.push(this._pluginsService.getPluginTemplates(pageId).subscribe( templates => { for(let pos of this.pluginUtils.placementsOptions){ this.templatesByPlacement.set(pos.value,[]); @@ -145,7 +145,7 @@ export class PluginTemplatesComponent implements OnInit { public confirmedDelete() { this.showLoading = true; - this.subscriptions.push(this._pluginsService.deletePluginTemplate(this.selectedTemplate._id, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._pluginsService.deletePluginTemplate(this.selectedTemplate._id).subscribe( _ => { this.deleteFromArray(this.selectedTemplate); NotificationHandler.rise('Template have been successfully deleted'); @@ -230,7 +230,7 @@ export class PluginTemplatesComponent implements OnInit { } public move(template: PluginTemplate, up: boolean, index, placement) { - this.subscriptions.push(this._pluginsService.updatePluginTemplateOrder(template, this.properties.adminToolsAPIURL, up ? -1 : 1).subscribe( + this.subscriptions.push(this._pluginsService.updatePluginTemplateOrder(template, up ? -1 : 1).subscribe( saved => { this.templatesByPlacement.get(placement)[index] = saved; }, @@ -253,7 +253,7 @@ export class PluginTemplatesComponent implements OnInit { template.settings[attr.key] = {name: attr.name, type: attr.type, value: attr.value}; } let update = template._id ? true : false; - this.subscriptions.push(this._pluginsService.savePluginTemplate(template, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._pluginsService.savePluginTemplate(template).subscribe( saved => { this.selectedTemplate = saved; this.savedSuccessfully(saved, update); @@ -300,7 +300,7 @@ export class PluginTemplatesComponent implements OnInit { getPages() { this.showLoading = true; - this.subscriptions.push(this._helpContentService.getAllPages(this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getAllPages().subscribe( pages => { this.allPages = []; this.allPagesByPortal = new Map(); diff --git a/dashboard/portal/portals.component.ts b/dashboard/portal/portals.component.ts index 6519bc59..6f2e2f08 100644 --- a/dashboard/portal/portals.component.ts +++ b/dashboard/portal/portals.component.ts @@ -77,7 +77,7 @@ export class PortalsComponent implements OnInit { getPortals() { this.showLoading = true; - this.subscriptions.push(this._helpContentService.getPortalsFull(this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.getPortalsFull().subscribe( portals => { this.portals = portals; if (portals) { @@ -131,7 +131,7 @@ export class PortalsComponent implements OnInit { public confirmedDeletePortals(data: any) { this.showLoading = true; - this.subscriptions.push(this._helpContentService.deleteCommunities(this.selectedPortals, this.properties.adminToolsAPIURL, this.getPortalType()).subscribe( + this.subscriptions.push(this._helpContentService.deleteCommunities(this.selectedPortals, this.getPortalType()).subscribe( _ => { this.deletePortalsFromArray(this.selectedPortals); NotificationHandler.rise('Portals have been successfully deleted'); @@ -187,7 +187,7 @@ export class PortalsComponent implements OnInit { this.showLoading = true; if (this.portalForm.getRawValue()._id) { this.subscriptions.push(this._helpContentService.updateCommunity(this.portalForm.getRawValue(), - this.properties.adminToolsAPIURL).subscribe( + ).subscribe( portal => { this.portalUpdatedSuccessfully(portal); NotificationHandler.rise('Portal ' + portal.name + ' has been successfully updated'); @@ -197,7 +197,7 @@ export class PortalsComponent implements OnInit { )); } else { this.subscriptions.push(this._helpContentService.saveCommunity(this.portalForm.getRawValue(), - this.properties.adminToolsAPIURL).subscribe( + ).subscribe( portal => { this.portalSavedSuccessfully(portal); NotificationHandler.rise('Portal ' + portal.name + ' has been successfully created'); diff --git a/monitor-admin/general/edit-stakeholder/edit-stakeholder.component.ts b/monitor-admin/general/edit-stakeholder/edit-stakeholder.component.ts index 34d7416b..27aa2ef3 100644 --- a/monitor-admin/general/edit-stakeholder/edit-stakeholder.component.ts +++ b/monitor-admin/general/edit-stakeholder/edit-stakeholder.component.ts @@ -382,7 +382,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent { this.stakeholderFb.get('defaultId').setValue(null); } this.removePhoto(); - this.subscriptions.push(this.stakeholderService.buildStakeholder(this.properties.monitorServiceAPIURL, + this.subscriptions.push(this.stakeholderService.buildStakeholder( this.stakeholderFb.getRawValue(), copyId, this.stakeholderCategory.value !== 'dependent', this.stakeholderCategory.value === 'umbrella') @@ -403,7 +403,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent { this.loading = false; })); } else { - this.subscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, this.stakeholderFb.getRawValue(), [], this.isFull).subscribe(stakeholder => { + this.subscriptions.push(this.stakeholderService.saveElement(this.stakeholderFb.getRawValue(), [], this.isFull).subscribe(stakeholder => { this.notification.entity = stakeholder._id; this.notification.stakeholder = stakeholder.alias; this.notification.stakeholderType = stakeholder.type; diff --git a/monitor-admin/general/general.component.ts b/monitor-admin/general/general.component.ts index c252f139..a8ff2c21 100644 --- a/monitor-admin/general/general.component.ts +++ b/monitor-admin/general/general.component.ts @@ -32,7 +32,7 @@ export class GeneralComponent extends BaseComponent implements OnInit { if(this.stakeholder) { this.title = this.stakeholder.name + " | General"; this.setMetadata(); - this.subscriptions.push(this.stakeholderService.getAlias(this.properties.monitorServiceAPIURL).subscribe(alias => { + this.subscriptions.push(this.stakeholderService.getAlias().subscribe(alias => { this.alias = alias; this.reset(); this.loading = false; diff --git a/monitor-admin/manageStakeholders/manage-all.component.ts b/monitor-admin/manageStakeholders/manage-all.component.ts index 18c3f3e6..0dbbf7aa 100644 --- a/monitor-admin/manageStakeholders/manage-all.component.ts +++ b/monitor-admin/manageStakeholders/manage-all.component.ts @@ -101,8 +101,8 @@ export class ManageAllComponent extends StakeholderBaseComponent implements OnIn this.active = this.stakeholderCategories[0].value; })); let data = zip( - this.stakeholderService.getMyStakeholders(this.properties.monitorServiceAPIURL), - this.stakeholderService.getAlias(this.properties.monitorServiceAPIURL) + this.stakeholderService.getMyStakeholders(), + this.stakeholderService.getAlias() ); this.subscriptions.push(data.subscribe(res => { this.manageStakeholders = res[0]; diff --git a/monitor-admin/manageStakeholders/manageStakeholders.component.ts b/monitor-admin/manageStakeholders/manageStakeholders.component.ts index 9aa03416..ced02bea 100644 --- a/monitor-admin/manageStakeholders/manageStakeholders.component.ts +++ b/monitor-admin/manageStakeholders/manageStakeholders.component.ts @@ -127,7 +127,7 @@ export class ManageStakeholdersComponent extends FilteredStakeholdersBaseCompone public deleteStakeholder() { this.deleteLoading = true; this.index = (this.stakeholder) ? this.stakeholders.findIndex(value => value._id === this.stakeholder._id) : -1; - this.subscriptions.push(this.stakeholderService.deleteElement(this.properties.monitorServiceAPIURL, [this.stakeholder._id]).subscribe(() => { + this.subscriptions.push(this.stakeholderService.deleteElement([this.stakeholder._id]).subscribe(() => { UIkit.notification(this.stakeholder.name+ ' has been successfully deleted', { status: 'success', timeout: 6000, @@ -153,7 +153,7 @@ export class ManageStakeholdersComponent extends FilteredStakeholdersBaseCompone let path = [ stakeholder._id ]; - this.subscriptions.push(this.stakeholderService.changeVisibility(this.properties.monitorServiceAPIURL, path, visibility).subscribe(returnedElement => { + this.subscriptions.push(this.stakeholderService.changeVisibility(path, visibility).subscribe(returnedElement => { stakeholder.visibility = returnedElement.visibility; UIkit.notification(stakeholder.name+ '\'s status has been successfully changed to ' + stakeholder.visibility.toLowerCase(), { status: 'success', diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index 97c148c3..9e8b05bb 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -802,7 +802,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id, this.section._id ]; - this.subscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, this.indicator, path).subscribe(indicator => { + this.subscriptions.push(this.stakeholderService.saveElement(this.indicator, path).subscribe(indicator => { if (this.index !== -1) { this.section.indicators[this.index] = indicator; } else { @@ -824,7 +824,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.editNumberNotify.sendNotification(this.notification); } } else { - this.stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL, null, this.stakeholder._id).subscribe(stakeholders => { + this.stakeholderService.getStakeholders(null, this.stakeholder._id).subscribe(stakeholders => { stakeholders.forEach(value => { this.notification.groups.push(Role.manager(value.type, value.alias)) }); @@ -874,7 +874,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]._id, this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index]._id ]; - this.subscriptions.push(this.stakeholderService.saveBulkElements(this.properties.monitorServiceAPIURL, sections, path).subscribe(stakeholder => { + this.subscriptions.push(this.stakeholderService.saveBulkElements(sections, path).subscribe(stakeholder => { this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts = stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts; this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers = stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers; this.setCharts(); @@ -904,7 +904,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple }); }); } else { - this.stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL, null, this.stakeholder._id).subscribe(stakeholders => { + this.stakeholderService.getStakeholders(null, this.stakeholder._id).subscribe(stakeholders => { stakeholders.forEach(value => { this.notification.groups.push(Role.manager(value.type, value.alias)) }); @@ -941,7 +941,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]._id, this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id ]; - this.subscriptions.push(this.stakeholderService.moveIndicator(this.properties.monitorServiceAPIURL, path, moveIndicator).subscribe(subCategory => { + this.subscriptions.push(this.stakeholderService.moveIndicator(path, moveIndicator).subscribe(subCategory => { this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex] = subCategory; this.setCharts(); this.setNumbers(); @@ -958,7 +958,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id, sectionId ]; - this.subscriptions.push(this.stakeholderService.reorderIndicators(this.properties.monitorServiceAPIURL, path, indicators).subscribe(indicators => { + this.subscriptions.push(this.stakeholderService.reorderIndicators(path, indicators).subscribe(indicators => { if (type === 'chart') { this.charts.find(section => section._id === sectionId).indicators = indicators; this.setCharts(); @@ -1053,7 +1053,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.section._id, this.indicator._id ]; - this.subscriptions.push(this.stakeholderService.deleteElement(this.properties.monitorServiceAPIURL, path, this.indicatorChildrenActionOnDelete).subscribe(() => { + this.subscriptions.push(this.stakeholderService.deleteElement(path, this.indicatorChildrenActionOnDelete).subscribe(() => { if (this.indicator.type === 'chart') { this.charts.find(section => section._id === this.section._id).indicators.splice(this.index, 1); this.setCharts(); @@ -1074,7 +1074,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.notification.groups.push(Role.manager(this.stakeholder.type, this.stakeholder.alias)); this.deleteNotify.sendNotification(this.notification); } else { - this.stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL, null, this.stakeholder._id).subscribe(stakeholders => { + this.stakeholderService.getStakeholders(null, this.stakeholder._id).subscribe(stakeholders => { stakeholders.forEach(value => { this.notification.groups.push(Role.manager(value.type, value.alias)) }); @@ -1104,7 +1104,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple sectionId, indicator._id ]; - this.subscriptions.push(this.stakeholderService.changeVisibility(this.properties.monitorServiceAPIURL, path, visibility).subscribe(returnedElement => { + this.subscriptions.push(this.stakeholderService.changeVisibility(path, visibility).subscribe(returnedElement => { indicator.visibility = returnedElement.visibility; UIkit.notification('Indicator has been successfully changed to ' + indicator.visibility.toLowerCase(), { status: 'success', @@ -1131,7 +1131,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]._id, this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id ]; - this.subscriptions.push(this.stakeholderService.saveSection(this.properties.monitorServiceAPIURL, sectionControl.value, path, index).subscribe(section => { + this.subscriptions.push(this.stakeholderService.saveSection(sectionControl.value, path, index).subscribe(section => { if (type === 'chart') { this.charts[index] = section; this.setCharts(); @@ -1166,7 +1166,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]._id, this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id ]; - this.subscriptions.push(this.stakeholderService.saveSection(this.properties.monitorServiceAPIURL, this.section, path, index).subscribe(section => { + this.subscriptions.push(this.stakeholderService.saveSection(this.section, path, index).subscribe(section => { if (type === 'chart') { if (index !== -1) { this.charts.splice(index, 0, section); @@ -1228,7 +1228,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id, this.section._id ]; - this.subscriptions.push(this.stakeholderService.deleteElement(this.properties.monitorServiceAPIURL, path, this.sectionChildrenActionOnDelete).subscribe(() => { + this.subscriptions.push(this.stakeholderService.deleteElement(path, this.sectionChildrenActionOnDelete).subscribe(() => { if (this.sectionTypeToDelete === "chart") { this.charts.splice(this.index, 1); this.setCharts(); diff --git a/monitor-admin/topic/topic.component.ts b/monitor-admin/topic/topic.component.ts index a7308db8..059eaf98 100644 --- a/monitor-admin/topic/topic.component.ts +++ b/monitor-admin/topic/topic.component.ts @@ -372,7 +372,7 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, let path = [this.stakeholder._id]; let ids = this.stakeholder.topics.map(topic => topic._id); HelperFunctions.swap(ids, index, newIndex); - this.stakeholderService.reorderElements(properties.monitorServiceAPIURL, path, ids).subscribe(() => { + this.stakeholderService.reorderElements(path, ids).subscribe(() => { HelperFunctions.swap(this.stakeholder.topics, index, newIndex); if(this.topicIndex === index) { this.chooseTopic(newIndex); @@ -515,7 +515,7 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, let path = [this.stakeholder._id, this.stakeholder.topics[this.topicIndex]._id]; let ids = this.stakeholder.topics[this.topicIndex].categories.map(category => category._id); HelperFunctions.swap(ids, index, newIndex); - this.stakeholderService.reorderElements(properties.monitorServiceAPIURL, path, ids).subscribe(() => { + this.stakeholderService.reorderElements(path, ids).subscribe(() => { HelperFunctions.swap(this.stakeholder.topics[this.topicIndex].categories, index, newIndex); if(this.categoryIndex === index) { this.chooseCategory(newIndex); @@ -657,7 +657,7 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, let path = [this.stakeholder._id, this.stakeholder.topics[this.topicIndex]._id, this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]._id]; let ids = this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories.map(subCategory => subCategory._id); HelperFunctions.swap(ids, index, newIndex); - this.stakeholderService.reorderElements(properties.monitorServiceAPIURL, path, ids).subscribe(() => { + this.stakeholderService.reorderElements(path, ids).subscribe(() => { HelperFunctions.swap(this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories, index, newIndex); if(this.subCategoryIndex === index) { this.chooseSubcategory(newIndex); @@ -707,7 +707,7 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, private save(message: string, path: string[], saveElement: any, callback: Function, redirect = false) { this.loading = true; - this.topicSubscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, saveElement, path).subscribe(saveElement => { + this.topicSubscriptions.push(this.stakeholderService.saveElement(saveElement, path).subscribe(saveElement => { callback(saveElement); this.stakeholderChanged(); this.loading = false; @@ -727,7 +727,7 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, private delete(message: string, path: string[], callback: Function, redirect = false) { this.loading = true; - this.topicSubscriptions.push(this.stakeholderService.deleteElement(this.properties.monitorServiceAPIURL, path, this.elementChildrenActionOnDelete).subscribe(() => { + this.topicSubscriptions.push(this.stakeholderService.deleteElement(path, this.elementChildrenActionOnDelete).subscribe(() => { callback(); this.stakeholderChanged(); this.loading = false; @@ -744,7 +744,7 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, } private changeStatus(element: Topic | Category | SubCategory, path: string[], visibility: Visibility, callback: Function = null, propagate: boolean = false) { - this.topicSubscriptions.push(this.stakeholderService.changeVisibility(this.properties.monitorServiceAPIURL, path, visibility, propagate).subscribe(returnedElement => { + this.topicSubscriptions.push(this.stakeholderService.changeVisibility(path, visibility, propagate).subscribe(returnedElement => { if(propagate) { callback(returnedElement); NotificationHandler.rise(StringUtils.capitalize(this.type) + ' has been successfully changed to ' + returnedElement.visibility.toLowerCase()); diff --git a/monitor-admin/umbrella/umbrella.component.ts b/monitor-admin/umbrella/umbrella.component.ts index aa8aadde..5ba6497c 100644 --- a/monitor-admin/umbrella/umbrella.component.ts +++ b/monitor-admin/umbrella/umbrella.component.ts @@ -286,7 +286,7 @@ export class UmbrellaComponent extends StakeholderBaseComponent implements OnIni setManageStakeholders() { this.loading = true; - this.subscriptions.push(this.stakeholderService.getMyStakeholders(this.properties.monitorServiceAPIURL, this.activeType).pipe(map(manageStakeholders => { + this.subscriptions.push(this.stakeholderService.getMyStakeholders(this.activeType).pipe(map(manageStakeholders => { delete manageStakeholders.templates; delete manageStakeholders.umbrella; return manageStakeholders; @@ -319,7 +319,7 @@ export class UmbrellaComponent extends StakeholderBaseComponent implements OnIni } updateUmbrella(successFn: Function = null, errorFn: Function = null): void { - this.subscriptions.push(this.stakeholderService.updateUmbrella(this.properties.monitorServiceAPIURL, this.stakeholder._id, this.updateFb.getRawValue()) + this.subscriptions.push(this.stakeholderService.updateUmbrella(this.stakeholder._id, this.updateFb.getRawValue()) .subscribe(umbrella => { this.loading = false; if(!this.activeType) { diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index 65b8a403..37b9af4a 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -122,20 +122,20 @@ export class StakeholderService { return this.stakeholderSubject.getValue(); } - getAlias(url: string): Observable { - return this.http.get(url + 'stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => { + getAlias(): Observable { + return this.http.get(properties.monitorServiceAPIURL + '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 => { + getStakeholders(type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> { + return this.http.get(properties.monitorServiceAPIURL + '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 => { + getMyStakeholders(type: string = null): Observable { + return this.http.get(properties.monitorServiceAPIURL + 'my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(manageStakeholder => { return HelperFunctions.copy({ templates: Stakeholder.checkIsUpload(manageStakeholder.templates), standalone: Stakeholder.checkIsUpload(manageStakeholder.standalone), @@ -145,7 +145,7 @@ export class StakeholderService { })); } - buildStakeholder(url: string, stakeholder: Stakeholder, copyId: string, standalone: boolean = true, umbrella: boolean = false): Observable { + buildStakeholder(stakeholder: Stakeholder, copyId: string, standalone: boolean = true, umbrella: boolean = false): Observable { if (stakeholder.alias && stakeholder.alias.startsWith('/')) { stakeholder.alias = stakeholder.alias.slice(1); } @@ -155,21 +155,26 @@ export class StakeholderService { umbrella: umbrella, standalone: standalone } - return this.http.post(url + 'build-stakeholder', buildStakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { + return this.http.post(properties.monitorServiceAPIURL + '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()); + changeVisibility(path: string[], visibility: Visibility, propagate: boolean = false): Observable { + path.push('change-visibility'); + return this.http.post(properties.monitorServiceAPIURL + path.join('/') + '?visibility=' + visibility + (propagate ? '&propagate=true' : ''), null, CustomOptions.registryOptions()); } - saveElement(url: string, element: any, path: string[] = [], isFull: boolean = false): Observable { + saveElement(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.join('/') + - '/save' + (isFull ? '/full' : ''), element, CustomOptions.registryOptions()).pipe(map(element => { + path.push('save'); + if(isFull) { + path.push('full'); + } + return this.http.post(properties.monitorServiceAPIURL + path.join('/'), + element, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); } else { @@ -178,9 +183,10 @@ export class StakeholderService { })); } - saveBulkElements(url: string, indicators, path: string[] = []): Observable { - return this.http.post(url + path.join('/') + - '/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => { + saveBulkElements(indicators, path: string[] = []): Observable { + path.push('save-bulk'); + return this.http.post(properties.monitorServiceAPIURL + path.join('/'), + indicators, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); } else { @@ -189,39 +195,44 @@ export class StakeholderService { })); } - saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable
      { - return this.http.post
      (url + path.join('/') + - '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { + saveSection(element: any, path: string[] = [], index: number = -1): Observable
      { + path.push('save/'); + return this.http.post
      (properties.monitorServiceAPIURL + path.join('/') + index, + element, CustomOptions.registryOptions()).pipe(map(element => { return HelperFunctions.copy(element); })); } - deleteElement(url: string, path: string[], childrenAction: string = null): Observable { + deleteElement(path: string[], childrenAction: string = null): Observable { let params: string = ""; if (childrenAction) { params = "?children=" + childrenAction; } - return this.http.delete(url + path.join('/') + '/delete' + params, CustomOptions.registryOptions()); + path.push('delete'); + return this.http.delete(properties.monitorServiceAPIURL + path.join('/') + params, CustomOptions.registryOptions()); } - reorderElements(url: string, path: string[], ids: string[]): Observable { - return this.http.post(url + path.join('/') + '/reorder', ids, CustomOptions.registryOptions()); + reorderElements(path: string[], ids: string[]): Observable { + path.push('reorder'); + return this.http.post(properties.monitorServiceAPIURL + path.join('/'), 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 => { + reorderIndicators(path: string[], indicators: string[]): Observable { + path.push('reorder'); + return this.http.post(properties.monitorServiceAPIURL + path.join('/'), 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 => { + moveIndicator(path: string[], moveIndicator: MoveIndicator): Observable { + path.push('moveIndicator'); + return this.http.post(properties.monitorServiceAPIURL + path.join('/'), 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 => { + updateUmbrella(id: string, update: UpdateUmbrella): Observable { + return this.http.post(properties.monitorServiceAPIURL + id + '/umbrella', update, CustomOptions.registryOptions()).pipe(map(umbrella => { return HelperFunctions.copy(umbrella); })); } diff --git a/services/help-content.service.ts b/services/help-content.service.ts index 1c24841b..f79bf1c9 100644 --- a/services/help-content.service.ts +++ b/services/help-content.service.ts @@ -30,27 +30,27 @@ export class HelpContentService { } } - getEntities(helpContentUrl:string) { - return this.http.get>(helpContentUrl + 'entity') + getEntities() { + return this.http.get>(properties.adminToolsAPIURL + 'entity') .pipe(catchError(this.handleError)); } - saveEntity(entity: Entity, helpContentUrl:string) { + saveEntity(entity: Entity) { HelpContentService.removeNulls(entity); - return this.http.post(helpContentUrl + 'entity/save', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + 'entity/save', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - updateEntity(entity: Entity, helpContentUrl:string) { + updateEntity(entity: Entity) { HelpContentService.removeNulls(entity); - return this.http.post(helpContentUrl + 'entity/update', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + 'entity/update', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - deleteEntities(ids : string[], helpContentUrl:string) { - return this.http.post(helpContentUrl + 'entity/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) + deleteEntities(ids: string[]) { + return this.http.post(properties.adminToolsAPIURL + 'entity/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } @@ -62,14 +62,14 @@ export class HelpContentService { // .catch(this.handleError); // } - getCommunityEntities(pid: string, helpContentUrl:string) { - return this.http.get>(helpContentUrl + properties.adminToolsPortalType + '/'+pid+'/entities') + getCommunityEntities(pid: string) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+'/entities') .pipe(catchError(this.handleError)); } - toggleEntities(pid: string, ids : string[],status : boolean, helpContentUrl:string) { + toggleEntities(pid: string, ids: string[], status: boolean) { - return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/'+pid+ '/entity/toggle?status='+ status.toString(), + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+ '/entity/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } @@ -99,16 +99,16 @@ export class HelpContentService { // } // Replacing getDivIdsFull - getAllDivIdsFull(helpContentUrl:string) { - return this.http.get>(helpContentUrl + 'div/full') + getAllDivIdsFull() { + return this.http.get>(properties.adminToolsAPIURL + 'div/full') //.map(res => > res.json()) .pipe(catchError(this.handleError)); } - getDivIdsFullByPortal(page_id: string, helpContentUrl:string, pid: string) { + getDivIdsFullByPortal(page_id: string, pid: string) { let parameters: string = page_id ? "?&page="+page_id : ""; - return this.http.get>(helpContentUrl + properties.adminToolsPortalType + '/'+pid + '/div/full'+parameters) + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid + '/div/full'+parameters) .pipe(catchError(this.handleError)); } // End of replacing getDivIdsFull @@ -124,57 +124,57 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - updateDivId(divId: DivId, helpContentUrl:string) { + updateDivId(divId: DivId) { HelpContentService.removeNulls(divId); - return this.http.post(helpContentUrl + 'div/update', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + 'div/update', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - saveDivId(divId: DivId, helpContentUrl:string) { + saveDivId(divId: DivId) { HelpContentService.removeNulls(divId); - return this.http.post(helpContentUrl + 'div/save', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + 'div/save', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - deleteDivIds(ids : string[], helpContentUrl:string) { - return this.http.post(helpContentUrl + 'div/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) + deleteDivIds(ids : string[]) { + return this.http.post(properties.adminToolsAPIURL + 'div/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - getPageIdsFromDivIds(pid: string, helpContentUrl:string) { - return this.http.get>(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/div/pages') + getPageIdsFromDivIds(pid: string) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + pid + '/div/pages') .pipe(catchError(this.handleError)); } - getCommunityDivHelpContents(pid: string, helpContentUrl:string, pageId:string = null) { - return this.http.get>(helpContentUrl + properties.adminToolsPortalType + "/" + pid + (pageId ? '/' + pageId : '') + '/divhelpcontent') + getCommunityDivHelpContents(pid: string, pageId:string = null) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + pid + (pageId ? '/' + pageId : '') + '/divhelpcontent') .pipe(catchError(this.handleError)); } - getDivHelpContent(id : string, helpContentUrl:string, pid: string) { - return this.http.get(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent/' + id) + getDivHelpContent(id : string, pid: string) { + return this.http.get(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent/' + id) .pipe(catchError(this.handleError)); } - insertOrUpdateDivHelpContent(divHelpContent: DivHelpContent, helpContentUrl:string, pid: string) { + insertOrUpdateDivHelpContent(divHelpContent: DivHelpContent, pid: string) { HelpContentService.removeNulls(divHelpContent); - return this.http.post(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent/' + (divHelpContent._id ? 'update' : 'save'), + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent/' + (divHelpContent._id ? 'update' : 'save'), JSON.stringify(divHelpContent), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - deleteDivHelpContents(ids : string[], helpContentUrl:string, pid: string) { - return this.http.post(helpContentUrl + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent/delete', + deleteDivHelpContents(ids : string[], pid: string) { + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + pid + '/divhelpcontent/delete', JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - toggleDivHelpContents(ids : string[],status : boolean, helpContentUrl:string, pid: string) { + toggleDivHelpContents(ids : string[], status : boolean, pid: string) { - return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/divhelpcontent/toggle?status='+ status.toString(), + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/divhelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } @@ -186,12 +186,12 @@ export class HelpContentService { } - getCommunityPageHelpContents(pid: string, helpContentUrl:string, pageId:string = null) { - return this.http.get>(helpContentUrl + properties.adminToolsPortalType + '/' + pid + (pageId ? '/' + pageId : '') + '/pagehelpcontent') + getCommunityPageHelpContents(pid: string, pageId:string = null) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + (pageId ? '/' + pageId : '') + '/pagehelpcontent') .pipe(catchError(this.handleError)); } - countCommunityPageHelpContents(pid: string, helpContentUrl:string ,classContents:boolean=false) { - return this.http.get>(helpContentUrl + properties.adminToolsPortalType + '/' + pid + (classContents?"/divhelpcontent":"/pagehelpcontent")+'/page/count') + countCommunityPageHelpContents(pid: string, classContents:boolean = false) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + (classContents?"/divhelpcontent":"/pagehelpcontent")+'/page/count') .pipe(catchError(this.handleError)); } getPageHelpContent(id : string, helpContentUrl:string, pid: string) { @@ -200,10 +200,10 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - savePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string, pid: string) { + savePageHelpContent(pageHelpContent: PageHelpContent, pid: string) { HelpContentService.removeNulls(pageHelpContent); - return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/' + (pageHelpContent._id ? 'update' : 'save'), + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/' + (pageHelpContent._id ? 'update' : 'save'), JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } @@ -216,14 +216,14 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - deletePageHelpContents(ids : string[], helpContentUrl:string, pid: string) { - return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/delete', + deletePageHelpContents(ids : string[], pid: string) { + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/delete', JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - togglePageHelpContents(ids : string[],status : boolean, helpContentUrl:string, pid: string) { - return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/toggle?status='+ status.toString(), + togglePageHelpContents(ids : string[],status : boolean, pid: string) { + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/pagehelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } @@ -240,8 +240,8 @@ export class HelpContentService { // } // Replacing getCommunityPages - getCommunityPagesByType(pid: string, type: string, helpContentUrl:string) { - return this.http.get>(helpContentUrl + properties.adminToolsPortalType + '/'+pid+'/pages' + getCommunityPagesByType(pid: string, type: string) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+'/pages' + (type ? '?page_type='+type : '')) .pipe(catchError(this.handleError)); } @@ -254,7 +254,7 @@ export class HelpContentService { } // End of replacing part of getPages (now getAllPages) //TODO double check with konstantina - there is no param that we are asking the community pages. without pid we get all portalTypes - getAllPages(helpContentUrl:string, pid:string = null) {//with_positions:boolean=null) { + getAllPages(pid:string = null) {//with_positions:boolean=null) { // let parameters: string = ""; // if(pid || with_positions == true || with_positions == false) { // parameters = "?"; @@ -265,23 +265,23 @@ export class HelpContentService { // parameters += "&with_positions="+with_positions; // } // } - return this.http.get>(helpContentUrl + 'page?' + (pid?"pid="+pid:"")) + return this.http.get>(properties.adminToolsAPIURL + 'page?' + (pid?"pid="+pid:"")) //.map(res => > res.json()) .pipe(catchError(this.handleError)); } - getAllPagesFull(helpContentUrl:string) { - return this.http.get>(helpContentUrl + 'page/full')//+(pid?("?pid="+pid):"")) + getAllPagesFull() { + return this.http.get>(properties.adminToolsAPIURL + 'page/full')//+(pid?("?pid="+pid):"")) //.map(res => > res.json()) .pipe(catchError(this.handleError)); } - getPageByPortal(pageId:string, helpContentUrl:string, pid: string) { - return this.http.get(helpContentUrl + properties.adminToolsPortalType + '/' + pid + '/page/'+pageId) + getPageByPortal(pageId:string, pid: string) { + return this.http.get(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/page/'+pageId) .pipe(catchError(this.handleError)); } - getPageById(pageId:string, helpContentUrl:string) { - return this.http.get(helpContentUrl + 'page/' + pageId) + getPageById(pageId:string) { + return this.http.get(properties.adminToolsAPIURL + 'page/' + pageId) .pipe(catchError(this.handleError)); } getCommunityPageByRoute(route:string, helpContentUrl:string, pid: string) { @@ -289,32 +289,32 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - savePage(page: Page, helpContentUrl:string) { + savePage(page: Page) { HelpContentService.removeNulls(page); - return this.http.post(helpContentUrl + 'page/save', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + 'page/save', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody()) //.map(res => res.json()) .pipe(catchError(this.handleError)); } - updatePage(page: Page, helpContentUrl:string) { + updatePage(page: Page) { HelpContentService.removeNulls(page); - return this.http.post(helpContentUrl + 'page/update', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + 'page/update', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - togglePages(selectedPortalPid: string, ids : string[],status : boolean, helpContentUrl:string) { + togglePages(selectedPortalPid: string, ids : string[], status : boolean) { - return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/'+selectedPortalPid+'/page/toggle?status='+ status.toString(), + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + selectedPortalPid + '/page/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - deletePages(ids : string[], helpContentUrl:string) { + deletePages(ids : string[]) { - return this.http.post(helpContentUrl + 'page/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + 'page/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } @@ -375,8 +375,8 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - getPortalsFull( helpContentUrl:string) { - return this.http.get>(helpContentUrl + 'portal/full') + getPortalsFull() { + return this.http.get>(properties.adminToolsAPIURL + 'portal/full') //.map(res => > res.json()) .pipe(catchError(this.handleError)); } @@ -385,31 +385,31 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - saveCommunity(portal: Portal, helpContentUrl:string) { + saveCommunity(portal: Portal) { // let headers = new Headers({'Content-Type': 'application/json'}); // let options = new RequestOptions({headers: headers}); HelpContentService.removeNulls(portal); - return this.http.post(helpContentUrl + portal.type + '/save', JSON.stringify(portal), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + portal.type + '/save', JSON.stringify(portal), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } - updateCommunity(portal: Portal, helpContentUrl:string) { + updateCommunity(portal: Portal) { // let headers = new Headers({'Content-Type': 'application/json'}); // let options = new RequestOptions({headers: headers}); HelpContentService.removeNulls(portal); - return this.http.post(helpContentUrl + portal.type + '/update', JSON.stringify(portal), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + portal.type + '/update', JSON.stringify(portal), CustomOptions.getAuthOptionsWithBody()) //.map(res => res.json()) .pipe(catchError(this.handleError)); } - deleteCommunities(ids : string[], helpContentUrl:string, portalType:string) { + deleteCommunities(ids : string[], portalType:string) { // let headers = new Headers({'Content-Type': 'application/json'}); // let options = new RequestOptions({headers: headers}); - return this.http.post(helpContentUrl + '/' + portalType + '/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(properties.adminToolsAPIURL + portalType + '/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } diff --git a/services/plugins.service.ts b/services/plugins.service.ts index 38af2426..e50d98d2 100644 --- a/services/plugins.service.ts +++ b/services/plugins.service.ts @@ -10,48 +10,48 @@ export class PluginsService { constructor(private http: HttpClient) { } - getPluginTemplates(api: string, pageId) { - return this.http.get>(api + 'pluginTemplates' + (pageId ? '/page/' + pageId : '')) + getPluginTemplates(pageId) { + return this.http.get>(properties.adminToolsAPIURL + 'pluginTemplates' + (pageId ? '/page/' + pageId : '')) } - savePluginTemplate(pluginTemplate: PluginTemplate, api: string) { - return this.http.post(api + 'pluginTemplate/save', pluginTemplate, CustomOptions.getAuthOptionsWithBody()); + savePluginTemplate(pluginTemplate: PluginTemplate) { + return this.http.post(properties.adminToolsAPIURL + 'pluginTemplate/save', pluginTemplate, CustomOptions.getAuthOptionsWithBody()); } - updatePluginTemplateOrder(pluginTemplate: PluginTemplate, api: string, position) { - return this.http.post(api + 'pluginTemplate/save/order/' + position, pluginTemplate, CustomOptions.getAuthOptionsWithBody()); + updatePluginTemplateOrder(pluginTemplate: PluginTemplate, position) { + return this.http.post(properties.adminToolsAPIURL + 'pluginTemplate/save/order/' + position, pluginTemplate, CustomOptions.getAuthOptionsWithBody()); } - updatePluginOrder(plugin: Plugin, api: string, position, community) { - return this.http.post(api + 'community/'+community+'/plugin/save/order/' + position, plugin, CustomOptions.getAuthOptionsWithBody()); + updatePluginOrder(plugin: Plugin, position, community) { + return this.http.post(properties.adminToolsAPIURL + 'community/'+community+'/plugin/save/order/' + position, plugin, CustomOptions.getAuthOptionsWithBody()); } - savePlugin(plugin, api: string, community) { - return this.http.post(api + 'community/' + community + '/plugin/save', JSON.stringify(plugin), CustomOptions.getAuthOptionsWithBody()); + savePlugin(plugin, community) { + return this.http.post(properties.adminToolsAPIURL + 'community/' + community + '/plugin/save', JSON.stringify(plugin), CustomOptions.getAuthOptionsWithBody()); } - deletePluginTemplate(id, api: string) { - return this.http.delete(api + 'pluginTemplate/' + id, CustomOptions.getAuthOptionsWithBody()); + deletePluginTemplate(id) { + return this.http.delete(properties.adminToolsAPIURL + 'pluginTemplate/' + id, CustomOptions.getAuthOptionsWithBody()); } - deletePlugin(id, api: string) { - return this.http.delete(api + 'plugin/' + id, CustomOptions.getAuthOptionsWithBody()); + deletePlugin(id) { + return this.http.delete(properties.adminToolsAPIURL + 'plugin/' + id, CustomOptions.getAuthOptionsWithBody()); } - countPluginTemplatePerPage(api: string, pid: string) { - return this.http.get(api + properties.adminToolsPortalType + '/' + pid + '/pluginTemplate/page/count'); + countPluginTemplatePerPage(pid: string) { + return this.http.get(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/pluginTemplate/page/count'); } - countPluginTemplatePerPageForAllPortals(api: string) { - return this.http.get(api + 'pluginTemplate/page/count'); + countPluginTemplatePerPageForAllPortals() { + return this.http.get(properties.adminToolsAPIURL + 'pluginTemplate/page/count'); } - getPluginsByPage(api: string, pid: string, pageId: string) { - return this.http.get>(api + properties.adminToolsPortalType + '/' + pid + '/plugins/page/' + pageId); + getPluginsByPage(pid: string, pageId: string) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/plugins/page/' + pageId); } - getPluginTemplatesByPage(api: string, pid: string, pageId: string) { - return this.http.get>(api + properties.adminToolsPortalType + '/' + pid + '/pluginTemplates/page/' + pageId); + getPluginTemplatesByPage(pid: string, pageId: string) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/pluginTemplates/page/' + pageId); } getPluginsByPageRoute(api:string, pid:string, route:string){ let url = api + 'community/' +pid+'/plugins/page/route?route=' + route; @@ -62,15 +62,15 @@ export class PluginsService { return this.http.get>(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload?'&forceReload=true':'')) :*/ url); } - togglePlugin(id: string, status: boolean, api: string, community) { - return this.http.post(api + 'community/' + community + '/plugin/status/' + id, status, CustomOptions.getAuthOptionsWithBody()); + togglePlugin(id: string, status: boolean, community) { + return this.http.post(properties.adminToolsAPIURL + 'community/' + community + '/plugin/status/' + id, status, CustomOptions.getAuthOptionsWithBody()); } - getPluginById(api: string, id: string) { - return this.http.get(api + 'plugin/' + id); + getPluginById(id: string) { + return this.http.get(properties.adminToolsAPIURL + 'plugin/' + id); } - getPluginTemplateById(api: string, id: string) { - return this.http.get(api + 'pluginTemplates/' + id); + getPluginTemplateById(id: string) { + return this.http.get(properties.adminToolsAPIURL + 'pluginTemplates/' + id); } } -- 2.17.1 From 35cf6ec956a54ba5234ba60f2d63022bf6998bc9 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 12 Sep 2024 12:27:49 +0300 Subject: [PATCH 11/13] [develop | DONE | FIXED] suggested repositories plugin: fix title and link --- .../plugin-suggested-repositories.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/plugins/components/suggested-repositories/plugin-suggested-repositories.component.html b/dashboard/plugins/components/suggested-repositories/plugin-suggested-repositories.component.html index 1ad99a59..17148d7a 100644 --- a/dashboard/plugins/components/suggested-repositories/plugin-suggested-repositories.component.html +++ b/dashboard/plugins/components/suggested-repositories/plugin-suggested-repositories.component.html @@ -23,13 +23,13 @@
      - {{item.name}} + {{item.officialname?item.officialname:item.name}}
      - + Go to repository -- 2.17.1 From 1593ea6ed9e62931800b62f4d4d4787228043d51 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Fri, 13 Sep 2024 09:59:24 +0300 Subject: [PATCH 12/13] [develop | DONE | CHANGED] adminToolsAPIURL: add property direclty on service file --- services/plugins.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/plugins.service.ts b/services/plugins.service.ts index e50d98d2..4c5fc032 100644 --- a/services/plugins.service.ts +++ b/services/plugins.service.ts @@ -53,12 +53,12 @@ export class PluginsService { getPluginTemplatesByPage(pid: string, pageId: string) { return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/pluginTemplates/page/' + pageId); } - getPluginsByPageRoute(api:string, pid:string, route:string){ - let url = api + 'community/' +pid+'/plugins/page/route?route=' + route; + getPluginsByPageRoute(pid:string, route:string){ + let url = properties.adminToolsAPIURL + 'community/' +pid+'/plugins/page/route?route=' + route; return this.http.get>(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload?'&forceReload=true':'')) : */url); } - getPluginTemplatesByPageRoute(api:string, pid:string, route:string){ - let url = api + 'community/' + pid + '/pluginTemplates/page/route?route=' + route; + getPluginTemplatesByPageRoute(pid:string, route:string){ + let url = properties.adminToolsAPIURL + 'community/' + pid + '/pluginTemplates/page/route?route=' + route; return this.http.get>(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload?'&forceReload=true':'')) :*/ url); } -- 2.17.1 From 8f668cd4ff51655caacdab42304c32cb2446fe64 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 18 Sep 2024 11:50:12 +0300 Subject: [PATCH 13/13] [develop | DONE | FIXED]: orcid-work.component.ts & result-preview.component.html & result-preview.component.ts: Added checks not to allow ORCID claim for results with no PIDs when not on development environment (until new version of orcid service is deployed). --- orcid/orcid-work.component.ts | 22 +++++++++++++------ .../result-preview.component.html | 6 +++-- .../result-preview.component.ts | 3 ++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index fbb996f5..77c53aa4 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -24,7 +24,9 @@ declare var UIkit: any; + [title]="((noPids && properties.environment != 'development') || !isLoggedIn) ? ((noPids && properties.environment != 'development') ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd"> + + @@ -32,7 +34,8 @@ declare var UIkit: any; [ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''" [class.uk-text-bolder]="!(isMobile && pageType == 'landing')" [class.uk-text-muted]="isDisabled"> - + Claim
      + [innerHTML]="((noPids && properties.environment != 'development') || !isLoggedIn) ? ((noPids && properties.environment != 'development') ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd">
      + + [title]="((noPids && properties.environment != 'development') || !isLoggedIn) ? ((noPids && properties.environment != 'development') ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete"> + @@ -54,7 +59,8 @@ declare var UIkit: any; [ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''" [class.uk-text-bolder]="!(isMobile && pageType == 'landing')" [class.uk-text-muted]="isDisabled"> - + Remove
      + [innerHTML]="((noPids && properties.environment != 'development') || !isLoggedIn) ? ((noPids && properties.environment != 'development') ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete">
      + @@ -893,7 +900,8 @@ export class OrcidWorkComponent { } get isDisabled() { - return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn); + // return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn); + return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn || (!this.pids && (!this.identifiers || this.identifiers.size == 0) && properties.environment != 'development')); } get noPids() { diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 717ca160..8e2caa9c 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -193,7 +193,8 @@ [url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id" [showTooltip]="false" [compactView]="compactView"> - + - + 0) || properties.environment == 'development'); + // this.showOrcid; } projectActions() { -- 2.17.1