diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index c20dd4f..cd782d4 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit c20dd4fa23d743671d733788957784aa72166720 +Subproject commit cd782d4a68a67dcba4d5d1bbce7ee737ad1f3871 diff --git a/src/app/pages/content-providers/add-content-providers.component.html b/src/app/pages/content-providers/add-content-providers.component.html index a9f23a9..c3461ff 100644 --- a/src/app/pages/content-providers/add-content-providers.component.html +++ b/src/app/pages/content-providers/add-content-providers.component.html @@ -68,10 +68,10 @@
- - + +
diff --git a/src/app/pages/content-providers/criteria/criteria.component.html b/src/app/pages/content-providers/criteria/criteria.component.html index 21e26fd..6f4fbc2 100644 --- a/src/app/pages/content-providers/criteria/criteria.component.html +++ b/src/app/pages/content-providers/criteria/criteria.component.html @@ -3,7 +3,7 @@ -
+
diff --git a/src/app/pages/customization/customization.component.html b/src/app/pages/customization/customization.component.html index 856fbf5..65dfa0f 100644 --- a/src/app/pages/customization/customization.component.html +++ b/src/app/pages/customization/customization.component.html @@ -57,8 +57,8 @@
Backgrounds
-
Note: Custom background style settings will override any identity settings that effect the - visualisation of a background. +
Note: Custom background style settings will override any settings that affect the + visualisation of backgrounds.
Quick look @@ -78,8 +78,8 @@
Buttons
-
Note: Custom background style settings will override any identity settings that effect the - visualisation of a background. +
Note: Custom buttons style settings will override any settings that affect the + visualisation of buttons.
Quick look @@ -102,7 +102,7 @@
Identity
-
Note: Custom identity style settings will effect the visualisation of the whole gateway. That +
Note: Custom identity style settings will affect the visualisation of the whole gateway. That includes buttons, links, tabs, backgrounds, etc.
diff --git a/src/app/pages/projects/remove-projects.component.ts b/src/app/pages/projects/remove-projects.component.ts index 3d5c37b..eff19ef 100644 --- a/src/app/pages/projects/remove-projects.component.ts +++ b/src/app/pages/projects/remove-projects.component.ts @@ -284,7 +284,7 @@ export class RemoveProjectsComponent implements OnInit { } public selectAll(){ - if(this.selectedIndexes.length < this.communitySearchUtils.totalResults) { + if(this.selectedIndexes.length < this.previewCommunityProjects.length) { this.selectedIndexes = Array.from(Array(this.previewCommunityProjects.length).keys()); }else{ this.selectedIndexes = []; 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/subjects/subjects-edit-form/subjects-edit-form.component.ts b/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts index aa852a0..b71aa27 100644 --- a/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts +++ b/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts @@ -295,34 +295,13 @@ export class SubjectsEditFormComponent implements OnInit { public saveAllSubjects() { let selectedSdg = this.sdgSelection.getSelectedSubjects().map(a => a.id); let selectedFos = this.fosSelection.getSelectedSubjects().map(a => a.id); - let requests = [ - ...this.saveSubjects(this.community.subjects, this.displayedSubjects, 'subjects'), - ...this.saveSubjects(this.community.sdg, selectedSdg, 'sdg'), - ...this.saveSubjects(this.community.fos, selectedFos, 'fos') - ]; - this.subscriptions.push(forkJoin(requests).subscribe(res => { + this.subscriptions.push(this._subjectsService.updateSubjects(this.communityId ,this.displayedSubjects, selectedFos, selectedSdg).subscribe(res => { + this.community.subjects = this.displayedSubjects; + this.community.fos = selectedFos; + this.community.sdg = selectedSdg this.afterUpdateActions(res, "updated"); - })); - } + })) - public saveSubjects(subjects, displayedSubjects, type: string) { - if (this.communityId != null && this.communityId !== '') { - this.loading = true; - const subjectsToDeleteAr = this.getSubjectsExistOnlyInFirst(subjects, displayedSubjects); - const subjectsToAddAr = this.getSubjectsExistOnlyInFirst(displayedSubjects, subjects); - const subjectsToDelete = this.getNonEmptyItems(subjectsToDeleteAr); - const subjectsToAdd = this.getNonEmptyItems(subjectsToAddAr); - let requests = []; - if (subjectsToDelete.length > 0) { - requests.push(this._subjectsService.removeSubjects( - this.properties.communityAPI + this.communityId + '/' + type, subjectsToDelete)) - } - if (subjectsToAdd.length > 0) { - requests.push(this._subjectsService.addSubjects( - this.properties.communityAPI + this.communityId + '/' + type, subjectsToAdd)) - } - return requests; - } } handleUpdateError(message: string, error = null) { @@ -334,15 +313,6 @@ export class SubjectsEditFormComponent implements OnInit { } afterUpdateActions(response, message: string) { - response.forEach(res => { - if (res.subjects) { - this.community.subjects = res.subjects; - } else if (res.sdg) { - this.community.sdg = res.sdg; - } else if (res.fos) { - this.community.fos = res.fos; - } - }); this._communityService.updateSubjects(this.community.subjects, this.community.fos, this.community.sdg); this._clearCacheService.purgeBrowserCache("Subjects " + message, this.communityId); NotificationHandler.rise('Subjects successfully ' + message + '!') diff --git a/src/app/pages/subjects/subjects.service.ts b/src/app/pages/subjects/subjects.service.ts index 2950cb6..184f720 100644 --- a/src/app/pages/subjects/subjects.service.ts +++ b/src/app/pages/subjects/subjects.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; import {HttpClient, HttpHeaders} from "@angular/common/http"; import {map} from "rxjs/operators"; +import {properties} from "../../../environments/environment"; @Injectable() export class SubjectsService { @@ -9,34 +10,10 @@ export class SubjectsService { } - addSubjects(url: string, subjects: any) { + updateSubjects(communityId: string, subjects: any, fos, sdgs) { let headers = new HttpHeaders({'Content-Type': 'application/json'}); - - const body = JSON.stringify(subjects); - - return this.http.post(url, body, {headers: headers}) - // .do(request => console.log("Insert Response:"+request.status)) - //.map(res => res.json()) - .pipe(map(res => { - res['method'] = 'post'; - return res; - })); + const body = JSON.stringify({subjects: subjects, fos: fos, sdg: sdgs}); + return this.http.post(properties.communityAPI + communityId , body, {headers: headers}); } - removeSubjects(url: string, subjects: any) { - //const headers = new Headers({'Content-Type': 'application/json'}); - let headers = new HttpHeaders({'Content-Type': 'application/json'}); - - const body = JSON.stringify(subjects); - //const options = new RequestOptions({headers: headers, body: body}); - - //return this.http.delete(url, options) - return this.http.request('delete', url, { body: body, headers: headers}) - // .do(request => console.log("Delete Response:"+request.status)) - //.map(res => res.json()) - .pipe(map(res => { - res['method'] = 'delete'; - return res; - })); - } } 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 2b843f0..1e70ea0 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'); diff --git a/src/assets/common-assets b/src/assets/common-assets index eb0051d..a88e24a 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit eb0051dc347cdaa44476048dea9f6b61200f257f +Subproject commit a88e24accc23599b43577994011e424eb693e817 diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index 55765bf..b4d09b7 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 55765bf0829910661a55337e0e7ca7b1262b7298 +Subproject commit b4d09b7cd942893c238d4152eeac1bbc822a0b13