[develop | DONE | CHANGED] change paths for files to use help-content.service from openaireLibrary, remove unused parameters from functions

This commit is contained in:
Alex Martzios 2024-09-19 10:51:28 +03:00
parent 63062eb5a7
commit 400cda2022
4 changed files with 12 additions and 20 deletions

@ -1 +1 @@
Subproject commit 49528c98746591fe519c49944119274fbb97efb3
Subproject commit 8f646a883fb9d2f36163a6f1e8040df98b0c9347

View File

@ -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,

View File

@ -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 <b>saved successfully</b>', {
@ -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 <b>enabled successfully</b>', {

View File

@ -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 <b>enabled successfully</b>');