Merge develop into angular-18

This commit is contained in:
Konstantinos Triantafyllou 2024-09-24 13:16:00 +03:00
commit 94a22202bf
12 changed files with 34 additions and 95 deletions

@ -1 +1 @@
Subproject commit c20dd4fa23d743671d733788957784aa72166720
Subproject commit cd782d4a68a67dcba4d5d1bbce7ee737ad1f3871

View File

@ -68,10 +68,10 @@
</div>
</div>
<div class="uk-margin-small-top">
<paging-no-load [currentPage]="openaireSearchUtils.page"
[totalResults]="openaireSearchUtils.totalResults" [size]="resultsPerPage"
(pageChange)="goTo($event)" customClasses="uk-flex-right@m uk-flex-center">
</paging-no-load>
<no-load-paging [type]="openaireContentProviders.length === 1?openAIREEntities.DATASOURCE:openAIREEntities.DATASOURCES"
[page]="openaireSearchUtils.page" [pageSize]="resultsPerPage" (pageChange)="goTo($event.value)"
[totalResults]="openaireSearchUtils.totalResults">
</no-load-paging>
</div>
</ng-container>
</div>

View File

@ -3,7 +3,7 @@
<loading></loading>
</div>
<ng-container *ngIf="!loading">
<div class="criteria uk-overflow-auto uk-position-relative" [ngStyle]="{'height.px': criteriaHeight?criteriaHeight:null}">
<div class="criteria uk-position-relative uk-margin-large-bottom" >
<div *ngIf="criteria.length == 0" class="uk-text-center uk-position-center">
<ng-content select="[no-criteria]"></ng-content>
</div>

View File

@ -57,8 +57,8 @@
<div *ngIf="menuSelected.id == 'backgrounds'" class=" uk-padding-small ">
<div class="customizationMenuItems uk-margin-small">
<div class="uk-h4">Backgrounds</div>
<div>Note: Custom background style settings will override any identity settings that effect the
visualisation of a background.
<div>Note: Custom background style settings will override any settings that affect the
visualisation of backgrounds.
</div>
<div class="uk-margin-large-top uk-margin-small-bottom uk-h5"> Quick look
@ -78,8 +78,8 @@
<div *ngIf="menuSelected.id == 'buttons'" class=" uk-padding-small ">
<div class="customizationMenuItems uk-margin-small">
<div class="uk-h4">Buttons</div>
<div>Note: Custom background style settings will override any identity settings that effect the
visualisation of a background.
<div>Note: Custom buttons style settings will override any settings that affect the
visualisation of buttons.
</div>
<div class="uk-margin-large-top uk-margin-small-bottom uk-h5"> Quick look
@ -102,7 +102,7 @@
<div class=" customizationMenuItems uk-margin-small">
<div class="uk-h4">Identity</div>
<div>Note: Custom identity style settings will effect the visualisation of the whole gateway. That
<div>Note: Custom identity style settings will affect the visualisation of the whole gateway. That
includes <span class="uk-text-bold">buttons, links, tabs, backgrounds, etc.</span></div>
</div>

View File

@ -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 = [];

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

@ -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 + '!')

View File

@ -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;
}));
}
}

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>');

@ -1 +1 @@
Subproject commit eb0051dc347cdaa44476048dea9f6b61200f257f
Subproject commit a88e24accc23599b43577994011e424eb693e817

@ -1 +1 @@
Subproject commit 55765bf0829910661a55337e0e7ca7b1262b7298
Subproject commit b4d09b7cd942893c238d4152eeac1bbc822a0b13