Merge pull request 'Production release June 2024 [Monitor Dashboard, Irish Monitor]' (#45) from develop into master

Reviewed-on: #45
This commit is contained in:
Konstantinos Triantafyllou 2024-06-20 11:31:06 +02:00
commit 4396999ce0
13 changed files with 67 additions and 81 deletions

View File

@ -13,7 +13,7 @@
searching for {{openaireEntities.PROJECTS.toLowerCase()}} to add them in the Basket
</div>
</div>
<div *ngIf=" openaireResultsStatus != errorCodes.LOADING && this.funderOptions.length > 1 && !this.selectedFunder">
<div *ngIf=" openaireResultsStatus != errorCodes.LOADING && this.funderOptions.length > 1 && !this.selectedFunder && openaireResultsNum <= 0 ">
<div class="uk-text-center uk-text-large uk-text-meta uk-margin-large-top">Select funder or search for projects to proceed
</div>
</div>

View File

@ -36,7 +36,7 @@ export class ClaimProjectsSearchFormComponent {
public projects:string[];
public warningMessage = "";
openaireResults:ClaimEntity[] = [];
openaireResultsNum: number ;
openaireResultsNum: number = -1;
openaireResultsPage : number = 1;
openaireResultsStatus:number = this.errorCodes.NONE;
page : number = 1;
@ -91,6 +91,7 @@ export class ClaimProjectsSearchFormComponent {
this.selectedFunder = value;
this.isNoProjectFunder = this.selectedFunder && this.selectedFunder.number == 1;
this.openaireResults = [];
this.openaireResultsNum = -1;
if(this.isNoProjectFunder){
this.showResults = true;
this.search(1,1);

View File

@ -366,6 +366,11 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
let lastUpdateDateStr = Dates.getDateToString(lastUpdateDate);
let claimDate = new Date(claim.date);
let claimDateStr = Dates.getDateToString(claimDate);
//TODO remove when organization links are integrated in Graph ------>
if(claim.sourceType == 'organization'){
return false;
}
// remove until here <-------
if (claimDateStr < lastUpdateDateStr) {
return true;
} else {

View File

@ -1,5 +1,5 @@
import {Component, OnInit, QueryList, ViewChildren} from "@angular/core";
import {ManageStakeholders} from "../../monitor/entities/stakeholder";
import {ManageStakeholders, StakeholderType} from "../../monitor/entities/stakeholder";
import {Session} from "../../login/utils/helper.class";
import {StakeholderBaseComponent} from "../utils/stakeholder-base.component";
import {StakeholderService} from "../../monitor/services/stakeholder.service";
@ -75,7 +75,7 @@ export class ManageAllComponent extends StakeholderBaseComponent implements OnIn
* Filters
*/
public keyword: string;
public type: string = 'all';
public type: StakeholderType | 'all' = 'all';
public types: Option[] = [{value: 'all', label: 'All'}].concat(this.stakeholderUtils.types);
@ViewChildren(ManageStakeholdersComponent) manageStakeholdersList: QueryList<ManageStakeholdersComponent>;

View File

@ -565,12 +565,11 @@
<div *ngIf="getParameter(i, 'yAxisTitle')" input class="uk-width-1-3@s"
[formInput]="getParameter(i, 'yAxisTitle').get('value')"
placeholder="Y-Axis Title"></div>
<div *ngIf="getParameter(i, 'data_title_0')" input class="uk-width-1-3@s"
[formInput]="getParameter(i, 'data_title_0').get('value')"
placeholder="Data Title"></div>
<div *ngIf="getParameter(i, 'data_title_1')" input class="uk-width-1-3@s"
[formInput]="getParameter(i, 'data_title_1').get('value')"
placeholder="Data Title"></div>
<ng-container *ngIf="isLegendEnabled(indicator, i)">
<div *ngFor="let dataTitle of dataTitles(i); let j=index" input class="uk-width-1-3@s"
[formInput]="getParameter(i, dataTitle).get('value')"
[placeholder]="'Data Title ' + (j + 1)"></div>
</ng-container>
<div *ngIf="getParameter(i, 'start_year')" input class="uk-width-1-3@s"
[formInput]="getParameter(i, 'start_year').get('value')"
placeholder="Year (From)"></div>

View File

@ -380,26 +380,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
}
}
public getNumberClassBySize(size: IndicatorSize) {
if (size === 'small') {
return 'uk-width-medium@m uk-width-1-1';
} else if (size === 'medium') {
return 'uk-width-1-4@l uk-width-1-2@m uk-width-1-1';
} else {
return 'uk-width-1-2@l uk-width-1-1@m uk-width-1-1';
}
}
public getChartClassBySize(size: IndicatorSize) {
if (size === 'small') {
return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1';
} else if (size === 'medium') {
return 'uk-width-1-2@l uk-width-1-1';
} else {
return 'uk-width-1-1';
}
}
public addJsonPath(index: number) {
if (index == 0 && this.getJsonPath(index).getRawValue()[index].indexOf(",") != -1) {
//if in the first path there are more than one paths comma separated, split them and autogenerate the forms
@ -487,6 +467,19 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
return this.getParameters(index, type).controls.filter(control => control.value.key === key)[0] as UntypedFormControl;
}
public dataTitles(index: number): string[] {
let formControl: UntypedFormControl;
let i = 0;
let dataTitles: string[] = [];
formControl = this.getParameter(index, 'data_title_' + i);
while(formControl != null) {
dataTitles.push('data_title_' + i);
i++;
formControl = this.getParameter(index, 'data_title_' + i);
}
return dataTitles;
}
private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) {
return this.sanitizer.bypassSecurityTrustResourceUrl(
this.indicatorUtils.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)));
@ -1283,30 +1276,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
}));
}
migrateFromOldImportJsonFile(charts) {
// first section contains numbers
// second contains charts
let hasNumbers = false;
for (let chart of charts) {
if (chart['type'] == 'number') {
hasNumbers = true;
break;
}
}
let chartsSection = (hasNumbers ? 1 : 0); // no numbers: first sections contains charts
for (let chart of charts) {
if (chart['sectionIndex'] == null) {
chart['sectionIndex'] = chart['type'] == 'chart' ? chartsSection : 0;
}
if (chart.url && chart.jsonPath) {
chart.indicatorPaths = [{url: chart.url, jsonPath: chart.jsonPath}];
} else if(chart.url) {
chart.indicatorPaths = [{url: chart.url}];
}
}
return charts;
}
importIndicatorsAndSave(stakeholder: Stakeholder, charts: any[]) {
let sectionsToSave: Section[] = [];
let countIndicators = 0;
@ -1321,7 +1290,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
}
// name description additionalDescription, height, width, visibility
let duplicates = 0;
charts = this.migrateFromOldImportJsonFile(charts);
for (let chart of charts) {
chart.visibility = this.showVisibility ? chart.visibility : this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities);
if (!sectionsToSave[chart['sectionIndex']]) {
@ -1579,4 +1547,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
get isEditable(): boolean {
return this.stakeholder.copy || this.stakeholder.defaultId == null || this.stakeholder.defaultId == '-1';
}
isLegendEnabled(indicator, i){
let chartObject = JSON.parse(indicator.indicatorPaths[i].chartObject, indicator.indicatorPaths[i].chartObject)
return !chartObject || !chartObject.chartDescription.legend || chartObject.chartDescription.legend.enabled
}
}

View File

@ -53,7 +53,7 @@ export interface StakeholderCategory {
export class StakeholderConfiguration {
public static ENTITIES: Entities = new Entities();
public static STAKEHOLDER_CATEGORIES: StakeholderCategory[] = [
public static STAKEHOLDER_CATEGORIES: StakeholderCategory[] = (properties.environment !== 'production')?[
{name: 'All', plural: 'All', value: 'all'},
{name: 'Template', plural: 'Templates', value: 'templates'},
{name: 'Standalone', plural: 'Standalone', value: 'standalone'},
@ -61,7 +61,12 @@ export class StakeholderConfiguration {
{name: 'Integrated ', plural: 'Integrated', value: 'dependent',
tooltip: 'A profile that doesn\'t have his own ' + StakeholderConfiguration.ENTITIES.stakeholder +
', but can be integrated into another ' + StakeholderConfiguration.ENTITIES.stakeholder + '.'}
]:[
{name: 'All', plural: 'All', value: 'all'},
{name: 'Template', plural: 'Templates', value: 'templates'},
{name: 'Profiles', plural: 'Profiles', value: 'standalone'},
];
public static TYPES: Option[] = [
{value: 'funder', label: StakeholderConfiguration.ENTITIES.funder},
{value: 'ri', label: StakeholderConfiguration.ENTITIES.ri},
@ -578,10 +583,11 @@ export class IndicatorUtils {
}
newJsonObject[this.getDescriptionObjectName(newJsonObject)]["colors"][queryIndex] = inActiveColors[queryIndex];
filterApplied = true;
} else if (filterType == "start_year" || filterType == "end_year") {
}
if (filterType == "start_year" || filterType == "end_year") {
//if has date filter already
// if (filterType == "start_year" && parseInt(filterValue) > parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) {
queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
//queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
// } else if (filterType == "end_year" && parseInt(filterValue) < parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) {
queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue;
// }

View File

@ -2,6 +2,8 @@ import {Directive} from "@angular/core";
import {BaseComponent} from "../../sharedComponents/base/base.component";
import {IndicatorUtils, StakeholderUtils} from "./indicator-utils";
import {ConnectHelper} from "../../connect/connectHelper";
import {IndicatorSize} from "../../monitor/entities/stakeholder";
import {statsToolParser} from "./cache-indicators/cache-indicators";
@Directive()
export abstract class StakeholderBaseComponent extends BaseComponent {
@ -51,4 +53,24 @@ export abstract class StakeholderBaseComponent extends BaseComponent {
export abstract class IndicatorStakeholderBaseComponent extends StakeholderBaseComponent {
indicatorUtils: IndicatorUtils = new IndicatorUtils();
public getNumberClassBySize(size: IndicatorSize): string {
if (size === 'small') {
return 'uk-width-medium';
} else if (size === 'medium') {
return 'uk-width-max-content';
} else {
return 'uk-width-max-content';
}
}
public getChartClassBySize(size: IndicatorSize): string {
if (size === 'small') {
return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1';
} else if (size === 'medium') {
return 'uk-width-1-2@l uk-width-1-1';
} else {
return 'uk-width-1-1';
}
}
}

View File

@ -30,6 +30,7 @@ export class BrowseStakeholderBaseComponent<T> extends StakeholderBaseComponent
parameters = {};
keywordControl: FormControl;
hasPublications: boolean = true;
hasOpenAccess: boolean = true;
/* Services */
protected layoutService: LayoutService;

View File

@ -386,26 +386,6 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
return indicators.filter(indicator => this.hasPermission(indicator.visibility)).length;
}
public getNumberClassBySize(size: IndicatorSize) {
if (size === 'small') {
return 'uk-width-medium@m uk-width-1-1';
} else if (size === 'medium') {
return 'uk-width-1-4@l uk-width-1-2@m uk-width-1-1';
} else {
return 'uk-width-1-2@l uk-width-1-1@m uk-width-1-1';
}
}
public getChartClassBySize(size: IndicatorSize): string {
if (size === 'small') {
return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1';
} else if (size === 'medium') {
return 'uk-width-1-2@l uk-width-1-1';
} else {
return 'uk-width-1-1';
}
}
public printReport() {
window.print();
}

View File

@ -129,7 +129,7 @@ export class StakeholderService {
}
getStakeholders(url: string, type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> {
return this.http.get<Stakeholder[]>(url + '/stakeholder' + ((type) ? ('?type=' + type) : '') + ((!type && defaultId) ? ('?defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => {
return this.http.get<Stakeholder[]>(url + '/stakeholder' + ((type) ? ('?type=' + type) : (defaultId?'?defaultId=' + defaultId:'')) + ((type && defaultId) ? ('&defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => {
return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders));
}));
}

View File

@ -70,7 +70,6 @@ export class AdvancedSearchInputComponent implements AfterContentInit, OnDestroy
init() {
this.inputs.forEach(input => {
input.inputClass = 'advanced-search';
input.selectArrow = null;
});
}

View File

@ -233,7 +233,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
}, 200);
}
});
}, {threshold: 0.1});
}, {threshold: this.scrollThreshold});
this.tabs.forEach(tab => {
let element = document.getElementById(tab.id.toString());
if (element) {