From 400cda2022a14bd0d0fa6d7249d3c6f294933c6a Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 19 Sep 2024 10:51:28 +0300 Subject: [PATCH] [develop | DONE | CHANGED] change paths for files to use help-content.service from openaireLibrary, remove unused parameters from functions --- src/app/openaireLibrary | 2 +- src/app/pages/stats/stats.component.ts | 14 +++----------- .../users/personal-info/personal-info.component.ts | 10 +++++----- src/app/utils/validateEnabledPage.component.ts | 6 +++--- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 49528c9..8f646a8 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 49528c98746591fe519c49944119274fbb97efb3 +Subproject commit 8f646a883fb9d2f36163a6f1e8040df98b0c9347 diff --git a/src/app/pages/stats/stats.component.ts b/src/app/pages/stats/stats.component.ts index 6d81836..10d46e1 100644 --- a/src/app/pages/stats/stats.component.ts +++ b/src/app/pages/stats/stats.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit, ElementRef} from '@angular/core'; -import {HelpContentService} from '../../services/help-content.service'; +import {HelpContentService} from '../../openaireLibrary/services/help-content.service'; import {ActivatedRoute, Router} from '@angular/router'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; import { Portal } from '../../domain/portal'; @@ -112,7 +112,7 @@ export class StatsComponent implements OnInit { if(!Session.isLoggedIn()){ this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); } else { - this.contentService.getCommunityAdminStatisticsChoices(this.properties.adminToolsAPIURL, this.communityId) + this.contentService.getCommunityAdminStatisticsChoices(this.communityId) .subscribe( res => { this.statisticsDisplay = res; @@ -202,7 +202,6 @@ export class StatsComponent implements OnInit { this.showAllInMonitor = !this.showAllInMonitor; this.contentService.postCommunityAdminStatisticsChoices( - this.properties.adminToolsAPIURL, this.communityId, entity, 'charts', @@ -220,7 +219,6 @@ export class StatsComponent implements OnInit { () => { this.contentService.postCommunityAdminStatisticsChoices( - this.properties.adminToolsAPIURL, this.communityId, entity, 'charts', @@ -238,7 +236,6 @@ export class StatsComponent implements OnInit { () => { this.contentService.postCommunityAdminStatisticsChoices( - this.properties.adminToolsAPIURL, this.communityId, entity, 'charts', @@ -321,7 +318,6 @@ export class StatsComponent implements OnInit { //this.loadingMessage = 'Saving changes'; this.contentService.postCommunityAdminStatisticsChoices( - this.properties.adminToolsAPIURL, this.communityId, entity, 'charts', @@ -338,7 +334,6 @@ export class StatsComponent implements OnInit { () => { this.contentService.postCommunityAdminStatisticsChoices( - this.properties.adminToolsAPIURL, this.communityId, entity, 'charts', @@ -355,7 +350,6 @@ export class StatsComponent implements OnInit { () => { this.contentService.postCommunityAdminStatisticsChoices( - this.properties.adminToolsAPIURL, this.communityId, entity, 'charts', @@ -388,7 +382,7 @@ export class StatsComponent implements OnInit { } toggleShowGraphAnalysisView() { - this.contentService.statisticsIsActiveToggle(this.properties.adminToolsAPIURL, this.statisticsDisplay._id).subscribe(status => { + this.contentService.statisticsIsActiveToggle(this.statisticsDisplay._id).subscribe(status => { this.statisticsDisplay.isActive = status; }); } @@ -400,7 +394,6 @@ export class StatsComponent implements OnInit { this.updateErrorMessage = ""; this.contentService.postCommunityAdminStatisticsChoices( - this.properties.adminToolsAPIURL, this.communityId, entity, chartsOrNumbers, @@ -423,7 +416,6 @@ export class StatsComponent implements OnInit { this.updateErrorMessage = ""; this.contentService.postCommunityAdminStatisticsChoices( - this.properties.adminToolsAPIURL, this.communityId, entity, chartsOrNumbers, diff --git a/src/app/pages/users/personal-info/personal-info.component.ts b/src/app/pages/users/personal-info/personal-info.component.ts index a73a57f..642bce7 100644 --- a/src/app/pages/users/personal-info/personal-info.component.ts +++ b/src/app/pages/users/personal-info/personal-info.component.ts @@ -11,7 +11,7 @@ import {EnvProperties} from "../../../openaireLibrary/utils/properties/env-prope import {properties} from "../../../../environments/environment"; import {User} from "../../../openaireLibrary/login/utils/helper.class"; import {Affiliation, Curator} from "../../../openaireLibrary/utils/entities/CuratorInfo"; -import {HelpContentService} from "../../../services/help-content.service"; +import {HelpContentService} from "../../../openaireLibrary/services/help-content.service"; import {Page} from "../../../domain/page"; import {CommunityService} from "../../../openaireLibrary/connect/community/community.service"; import {StringUtils} from "../../../openaireLibrary/utils/string-utils.class"; @@ -223,7 +223,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { if (this.user) { this.title.setTitle(community.shortTitle.toUpperCase() + " | Personal Info"); this.loading = true; - this.subs.push(this.curatorService.getCurator(properties).subscribe(curator => { + this.subs.push(this.curatorService.getCurator().subscribe(curator => { this.initCurator(curator); this.reset(); this.loading = false; @@ -307,7 +307,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { } saveCurator() { - this.curatorService.updateCurator(this.properties, this.curatorFb.value).subscribe((curator) => { + this.curatorService.updateCurator(this.curatorFb.value).subscribe((curator) => { if (curator) { this._clearCacheService.purgeBrowserCache("Curator added/ updated", this.community.communityId); UIkit.notification('Your data has been saved successfully', { @@ -357,7 +357,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { } private curatorsPageStatus() { - this.helpContentService.getCommunityPagesByRoute(this.community.communityId, '/curators', this.properties.adminToolsAPIURL).subscribe((page) => { + this.helpContentService.getCommunityPagesByRoute(this.community.communityId, '/curators').subscribe((page) => { this.curatorsPage = page; }); } @@ -480,7 +480,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { } enableCurators() { - this.helpContentService.togglePages(this.community.communityId, [this.curatorsPage._id], true, this.properties.adminToolsAPIURL).subscribe(() => { + this.helpContentService.togglePages(this.community.communityId, [this.curatorsPage._id], true).subscribe(() => { this.curatorsPage.isEnabled = true; this._clearCacheService.purgeBrowserCache("Curators page enabled", this.community.communityId); UIkit.notification('Curators Page has been enabled successfully', { diff --git a/src/app/utils/validateEnabledPage.component.ts b/src/app/utils/validateEnabledPage.component.ts index d7b3b75..2f39ea9 100644 --- a/src/app/utils/validateEnabledPage.component.ts +++ b/src/app/utils/validateEnabledPage.component.ts @@ -8,7 +8,7 @@ import {ActivatedRoute, Router} from "@angular/router"; import {Title} from "@angular/platform-browser"; import {CommunityService} from "../openaireLibrary/connect/community/community.service"; import {AffiliationService} from "../openaireLibrary/connect/affiliations/affiliation.service"; -import {HelpContentService} from "../services/help-content.service"; +import {HelpContentService} from "../openaireLibrary/services/help-content.service"; import {ClearCacheService} from "../openaireLibrary/services/clear-cache.service"; import {Subscription} from "rxjs"; import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class"; @@ -74,7 +74,7 @@ export class ValidateEnabledPageComponent implements OnInit, OnDestroy { private getPageStatus() { - this.helpContentService.getCommunityPagesByRoute(this.community.communityId, this.pageRoute, this.properties.adminToolsAPIURL).subscribe((page) => { + this.helpContentService.getCommunityPagesByRoute(this.community.communityId, this.pageRoute).subscribe((page) => { this.page = page; }) } @@ -82,7 +82,7 @@ export class ValidateEnabledPageComponent implements OnInit, OnDestroy { enablePage() { this.loading = true; - this.helpContentService.togglePages(this.community.communityId, [this.page._id], true, this.properties.adminToolsAPIURL).subscribe(() => { + this.helpContentService.togglePages(this.community.communityId, [this.page._id], true).subscribe(() => { this.page.isEnabled = true; this._clearCacheService.purgeBrowserCache("Page enabled", this.community.communityId); NotificationHandler.rise(this.page.name + ' has been enabled successfully');