[Monitor Dashboard|Trunk]
-Search pages: -updates for custom filter -add -remove custom filter parameters -Monitor component: - apply height sizes - put indicator title inside the card - add link to graph - add last update of statistics date - encode and handle filter parameters similar to search pages -Indicators: add height in the form git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@59980 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
e6b157914a
commit
f51535542e
|
@ -11,7 +11,7 @@
|
||||||
<dashboard-sidebar *ngIf="stakeholder && isFrontPage" [items]="sideBarItems"
|
<dashboard-sidebar *ngIf="stakeholder && isFrontPage" [items]="sideBarItems"
|
||||||
[activeItem]="activeTopic?activeTopic.alias:null" [showHeader]=true
|
[activeItem]="activeTopic?activeTopic.alias:null" [showHeader]=true
|
||||||
[specialMenuItem]="specialSideBarMenuItem"
|
[specialMenuItem]="specialSideBarMenuItem"
|
||||||
[searchParams]="createSearchParameters()"
|
[searchParams]="{}"
|
||||||
[headerUrl]="'https://' + (properties.environment == 'beta' ? 'beta.' : '') +
|
[headerUrl]="'https://' + (properties.environment == 'beta' ? 'beta.' : '') +
|
||||||
'monitor.openaire.eu'" queryParamsHandling="preserve"
|
'monitor.openaire.eu'" queryParamsHandling="preserve"
|
||||||
></dashboard-sidebar>
|
></dashboard-sidebar>
|
||||||
|
|
|
@ -262,7 +262,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.isPublicOrIsMember(this.stakeholder.visibility)) {
|
if(this.isPublicOrIsMember(this.stakeholder.visibility)) {
|
||||||
this.specialSideBarMenuItem = new MenuItem("search", "Search research outcomes", "", this.properties.searchLinkToResults, false, [], null, this.createSearchParameters());
|
this.specialSideBarMenuItem = new MenuItem("search", "Search research outcomes", "", this.properties.searchLinkToResults, false, [], null, {});
|
||||||
this.specialSideBarMenuItem.icon = '<span uk-icon="search"></span>';
|
this.specialSideBarMenuItem.icon = '<span uk-icon="search"></span>';
|
||||||
}else{
|
}else{
|
||||||
this.specialSideBarMenuItem =null;
|
this.specialSideBarMenuItem =null;
|
||||||
|
@ -371,17 +371,16 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
createSearchParameters() {
|
/* createSearchParameters() {
|
||||||
if (!this.stakeholder) {
|
if (!this.stakeholder) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if (this.stakeholder.type == "funder") {
|
if (this.stakeholder.type == "funder") {
|
||||||
return {"relfunder": encodeURIComponent("\"" + this.stakeholder.index_id + "||" + this.stakeholder.index_name + "||" + this.stakeholder.index_shortName + "\"")};
|
return {"relfunder": encodeURIComponent("\"" + this.stakeholder.index_id + "||" + this.stakeholder.index_name + "||" + this.stakeholder.index_shortName + "\"")};
|
||||||
} else if (this.stakeholder.type == "ri") {
|
} else if (this.stakeholder.type == "ri") {
|
||||||
// https://beta.explore.openaire.eu/search/find/research-outcomes?f0=q&fv0=&resultbestaccessright=%22Open%20Access%22&community=%22mes%7C%7CEuropean%20Marine%20Science%22&qf=true
|
|
||||||
return {"community": encodeURIComponent("\"" + this.stakeholder.index_id + "||" + this.stakeholder.index_name + "\"")};
|
return {"community": encodeURIComponent("\"" + this.stakeholder.index_id + "||" + this.stakeholder.index_name + "\"")};
|
||||||
} else if (this.stakeholder.type == "organization") {
|
} else if (this.stakeholder.type == "organization") {
|
||||||
return {"cf": true};
|
return {"cf": true};
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,8 +150,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="activeSubCategory">
|
<div *ngIf="activeSubCategory">
|
||||||
<div *ngFor="let chart of activeSubCategory.charts; let i = index;"
|
<div *ngFor="let chart of activeSubCategory.charts; let i = index;"
|
||||||
class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-bottom "
|
class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-middle "
|
||||||
uk-height-match="target: div > div > .chartTitle">
|
uk-height-match="target: div > div > div > div > .chartTitle">
|
||||||
|
|
||||||
<h3 *ngIf="chart.title && chart.title.length > 0 && countIndicatorsToShow(chart.indicators) > 0 "
|
<h3 *ngIf="chart.title && chart.title.length > 0 && countIndicatorsToShow(chart.indicators) > 0 "
|
||||||
class="uk-width-1-1 uk-margin-top">{{chart.title}}</h3>
|
class="uk-width-1-1 uk-margin-top">{{chart.title}}</h3>
|
||||||
|
@ -162,14 +162,14 @@
|
||||||
[class.uk-width-1-2@m]="indicator.width === 'medium'"
|
[class.uk-width-1-2@m]="indicator.width === 'medium'"
|
||||||
[class.uk-width-1-1]="indicator.width === 'large'" class="uk-margin-bottom">
|
[class.uk-width-1-1]="indicator.width === 'large'" class="uk-margin-bottom">
|
||||||
<div class="indicatorBox">
|
<div class="indicatorBox">
|
||||||
<h4 class="uk-margin-bottom chartTitle uk-flex uk-flex-bottom ">
|
|
||||||
<div>{{indicator.name + " "}}</div>
|
|
||||||
</h4>
|
|
||||||
<div class="uk-card uk-card-default"
|
<div class="uk-card uk-card-default"
|
||||||
[class.uk-disabled]="chartsActiveType.get(i + '-' + j).filtersApplied < countSelectedFilters()"
|
[class.uk-disabled]="chartsActiveType.get(i + '-' + j).filtersApplied < countSelectedFilters()"
|
||||||
[class.semiFiltered]="chartsActiveType.get(i + '-' + j).filtersApplied < countSelectedFilters()"
|
[class.semiFiltered]="chartsActiveType.get(i + '-' + j).filtersApplied < countSelectedFilters()"
|
||||||
>
|
>
|
||||||
<div class="uk-card-body uk-text-center">
|
<div class="uk-card-body uk-text-center">
|
||||||
|
<h4 class="uk-margin-bottom chartTitle uk-flex uk-flex-bottom ">
|
||||||
|
<div>{{indicator.name + " "}}</div>
|
||||||
|
</h4>
|
||||||
<div *ngIf="indicator.indicatorPaths.length > 1" class="uk-button-group">
|
<div *ngIf="indicator.indicatorPaths.length > 1" class="uk-button-group">
|
||||||
<button *ngFor="let indicatorPath of indicator.indicatorPaths;"
|
<button *ngFor="let indicatorPath of indicator.indicatorPaths;"
|
||||||
class="uk-button"
|
class="uk-button"
|
||||||
|
@ -183,12 +183,14 @@
|
||||||
{{countSelectedFilters()}}</div>
|
{{countSelectedFilters()}}</div>
|
||||||
<iframe *ngIf="chartsActiveType.get(i + '-' + j).source !== 'image'"
|
<iframe *ngIf="chartsActiveType.get(i + '-' + j).source !== 'image'"
|
||||||
[src]="chartsActiveType.get(i + '-' + j).safeResourceUrl"
|
[src]="chartsActiveType.get(i + '-' + j).safeResourceUrl"
|
||||||
class="uk-width-1-1 uk-height-medium"></iframe>
|
[class]="' uk-width-1-1 uk-height-' +
|
||||||
|
(indicator.height?indicator.height.toLowerCase():'medium')"></iframe>
|
||||||
<!-- {{chartsActiveType.get(i).safeResourceUrl}}-->
|
<!-- {{chartsActiveType.get(i).safeResourceUrl}}-->
|
||||||
<!-- <a [href]="chartsActiveType.get(i).safeResourceUrl" target="_blank" > ChartuURL</a>-->
|
<!-- <a [href]="chartsActiveType.get(i).safeResourceUrl" target="_blank" > ChartuURL</a>-->
|
||||||
<img *ngIf="chartsActiveType.get(i + '-' + j).source === 'image'"
|
<img *ngIf="chartsActiveType.get(i + '-' + j).source === 'image'"
|
||||||
[src]="chartsActiveType.get(i + '-' + j).safeResourceUrl"
|
[src]="chartsActiveType.get(i + '-' + j).safeResourceUrl"
|
||||||
class="uk-width-1-1 uk-height-medium">
|
[class]="' uk-width-1-1 uk-height-' +
|
||||||
|
(indicator.height?indicator.height.toLowerCase():'medium')">
|
||||||
<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>
|
<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -198,10 +200,19 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!loading && !privateStakeholder && (activeSubCategory || (activeTopic &&
|
<div *ngIf="!loading && !privateStakeholder && (activeSubCategory || (activeTopic &&
|
||||||
(activeTopic.categories == null || activeTopic.categories.length == 0)))"
|
(activeTopic.categories == null || activeTopic.categories.length == 0)))" class="uk-margin-small-top uk-flex">
|
||||||
class="uk-width-1-1 uk-text-center uk-text-muted">
|
<!-- Last Stats Date-->
|
||||||
<span>Send us your <a [href]="mailText" target="_self" (click)="mailMe()">feedback</a>.</span>
|
<div class="uk-width-2-3@m uk-width-1-2">
|
||||||
|
<img src="assets/common-assets/graph.svg" style="opacity: 0.4">
|
||||||
|
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
|
||||||
|
<span *ngIf="statsUpdateDate" class="uk-text-baseline uk-text-muted">
|
||||||
|
. Last update of statistics in OpenAIRE: {{statsUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<!--Feedback-->
|
||||||
|
<div class="uk-width-expand uk-text-right">
|
||||||
|
<span class="uk-text-muted">Send us your <a [href]="mailText" target="_self" (click)="mailMe()">feedback</a>.</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -30,6 +30,7 @@ import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperCla
|
||||||
import {Location} from "@angular/common";
|
import {Location} from "@angular/common";
|
||||||
import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
|
import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
|
||||||
import {properties} from "../../environments/environment";
|
import {properties} from "../../environments/environment";
|
||||||
|
import {IndexInfoService} from "../openaireLibrary/utils/indexInfo.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'monitor',
|
selector: 'monitor',
|
||||||
|
@ -71,7 +72,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
||||||
};
|
};
|
||||||
privateStakeholder = false;
|
privateStakeholder = false;
|
||||||
public keyword: FormControl;
|
public keyword: FormControl;
|
||||||
|
public statsUpdateDate: Date;
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
|
@ -85,6 +86,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
||||||
private layoutService: LayoutService,
|
private layoutService: LayoutService,
|
||||||
private seoService: SEOService,
|
private seoService: SEOService,
|
||||||
private cdr: ChangeDetectorRef,
|
private cdr: ChangeDetectorRef,
|
||||||
|
private indexInfoService: IndexInfoService,
|
||||||
private sanitizer: DomSanitizer, private _fb: FormBuilder, private router: Router) {
|
private sanitizer: DomSanitizer, private _fb: FormBuilder, private router: Router) {
|
||||||
this.errorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.errorMessages = new ErrorMessagesComponent();
|
this.errorMessages = new ErrorMessagesComponent();
|
||||||
|
@ -92,6 +94,13 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
|
if (typeof document !== 'undefined') {
|
||||||
|
this.subscriptions.push(this.indexInfoService.getStatsLastDate(this.properties).subscribe(lastIndexUpdate => {
|
||||||
|
if (lastIndexUpdate) {
|
||||||
|
this.statsUpdateDate = new Date(lastIndexUpdate);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
this.keyword = this._fb.control('');
|
this.keyword = this._fb.control('');
|
||||||
this.subscriptions.push(this.keyword.valueChanges.subscribe(value => {
|
this.subscriptions.push(this.keyword.valueChanges.subscribe(value => {
|
||||||
console.log("Keyword Changed!");
|
console.log("Keyword Changed!");
|
||||||
|
@ -196,7 +205,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
||||||
for (let filter of this.filters) {
|
for (let filter of this.filters) {
|
||||||
if (this.queryParams[filter.filterId]) {
|
if (this.queryParams[filter.filterId]) {
|
||||||
for (let value of filter.values) {
|
for (let value of filter.values) {
|
||||||
if (value.id == this.queryParams[filter.filterId]) {
|
if (value.id == StringUtils.URIDecode(StringUtils.unquote(this.queryParams[filter.filterId]))) {
|
||||||
value.selected = true;
|
value.selected = true;
|
||||||
filter.countSelectedValues = 1;
|
filter.countSelectedValues = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -364,7 +373,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (selected) {
|
if (selected) {
|
||||||
this.queryParams[$event.value.filterId] = selected;
|
this.queryParams[$event.value.filterId] = StringUtils.quote(StringUtils.URIEncode(selected));
|
||||||
} else {
|
} else {
|
||||||
delete this.queryParams[$event.value.filterId];
|
delete this.queryParams[$event.value.filterId];
|
||||||
}
|
}
|
||||||
|
@ -377,7 +386,8 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
private getfl0() {
|
private getfl0() {
|
||||||
if (this.queryParams["relfundinglevel0_id"] && this.filters.length > 0) {
|
if (this.queryParams["relfundinglevel0_id"] && this.filters.length > 0) {
|
||||||
return this.queryParams["relfundinglevel0_id"].split("::")[this.queryParams["relfundinglevel0_id"].split("::").length - 1];
|
let value = StringUtils.URIDecode(StringUtils.unquote(this.queryParams["relfundinglevel0_id"] ));
|
||||||
|
return value.split("::")[value.split("::").length - 1];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,17 +40,13 @@ export class MonitorAdvancedSearchDataprovidersComponent {
|
||||||
if (stakeholder.type === "organization") {
|
if (stakeholder.type === "organization") {
|
||||||
let value = stakeholder.index_id;
|
let value = stakeholder.index_id;
|
||||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
this.showSwitchSearchLink = true;
|
this.showSwitchSearchLink = true;
|
||||||
} else if (stakeholder.type === "funder") {
|
} else if (stakeholder.type === "funder") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||||
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
} else if (stakeholder.type === "ri") {
|
} else if (stakeholder.type === "ri") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
||||||
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
}
|
}
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUti
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'monitor-advanced-search-projects',
|
selector: 'monitor-advanced-search-projects',
|
||||||
|
@ -10,7 +11,9 @@ import {Subscriber} from "rxjs";
|
||||||
<div id="page_content">
|
<div id="page_content">
|
||||||
<search-projects *ngIf="initialized" [simpleView]="false"
|
<search-projects *ngIf="initialized" [simpleView]="false"
|
||||||
[customFilter]=customFilter [hasPrefix]="false"
|
[customFilter]=customFilter [hasPrefix]="false"
|
||||||
[includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink">
|
[includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink"
|
||||||
|
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/projects'"
|
||||||
|
>
|
||||||
</search-projects>
|
</search-projects>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -20,6 +23,7 @@ export class MonitorAdvancedSearchProjectsComponent {
|
||||||
customFilter: SearchCustomFilter = null;
|
customFilter: SearchCustomFilter = null;
|
||||||
initialized: boolean = false;
|
initialized: boolean = false;
|
||||||
showSwitchSearchLink:boolean = false;
|
showSwitchSearchLink:boolean = false;
|
||||||
|
properties;
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private stakeholderService: StakeholderService) {
|
private stakeholderService: StakeholderService) {
|
||||||
|
@ -34,6 +38,7 @@ export class MonitorAdvancedSearchProjectsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.properties = properties;
|
||||||
this.subscriptions.push(this.route.params.subscribe(params => {
|
this.subscriptions.push(this.route.params.subscribe(params => {
|
||||||
if (params['stakeholder']) {
|
if (params['stakeholder']) {
|
||||||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||||
|
@ -41,19 +46,14 @@ export class MonitorAdvancedSearchProjectsComponent {
|
||||||
if (stakeholder.type === "funder") {
|
if (stakeholder.type === "funder") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||||
this.customFilter = new SearchCustomFilter("Funder", "funder", value, "");
|
this.customFilter = new SearchCustomFilter("Funder", "funder", value, "");
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
this.showSwitchSearchLink = true;
|
this.showSwitchSearchLink = true;
|
||||||
} else if (stakeholder.type === "organization") {
|
} else if (stakeholder.type === "organization") {
|
||||||
let value = stakeholder.index_id;
|
let value = stakeholder.index_id;
|
||||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
this.showSwitchSearchLink = true;
|
this.showSwitchSearchLink = true;
|
||||||
} else if (stakeholder.type === "ri") {
|
} else if (stakeholder.type === "ri") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
||||||
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
}
|
}
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUti
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'monitor-advanced-search-results',
|
selector: 'monitor-advanced-search-results',
|
||||||
|
@ -11,14 +12,16 @@ import {Subscriber} from "rxjs";
|
||||||
<search-research-results *ngIf="initialized" resultType="result" [simpleView]="false"
|
<search-research-results *ngIf="initialized" resultType="result" [simpleView]="false"
|
||||||
[customFilter]=customFilter [hasPrefix]="false"
|
[customFilter]=customFilter [hasPrefix]="false"
|
||||||
[includeOnlyResultsAndFilter]="false"
|
[includeOnlyResultsAndFilter]="false"
|
||||||
[showSwitchSearchLink]="true"></search-research-results>
|
[showSwitchSearchLink]="true"
|
||||||
|
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/research-outcomes'"
|
||||||
|
></search-research-results>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class MonitorAdvancedSearchResearchResultsComponent {
|
export class MonitorAdvancedSearchResearchResultsComponent {
|
||||||
customFilter: SearchCustomFilter = null;
|
customFilter: SearchCustomFilter = null;
|
||||||
initialized: boolean = false;
|
initialized: boolean = false;
|
||||||
|
properties;
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private stakeholderService: StakeholderService) {
|
private stakeholderService: StakeholderService) {
|
||||||
|
@ -33,6 +36,7 @@ export class MonitorAdvancedSearchResearchResultsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.properties = properties;
|
||||||
this.subscriptions.push(this.route.params.subscribe(params => {
|
this.subscriptions.push(this.route.params.subscribe(params => {
|
||||||
if (params['stakeholder']) {
|
if (params['stakeholder']) {
|
||||||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||||
|
@ -40,18 +44,12 @@ export class MonitorAdvancedSearchResearchResultsComponent {
|
||||||
if (stakeholder.type === "funder") {
|
if (stakeholder.type === "funder") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||||
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
} else if (stakeholder.type === "organization") {
|
} else if (stakeholder.type === "organization") {
|
||||||
let value = stakeholder.index_id;
|
let value = stakeholder.index_id;
|
||||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
} else if (stakeholder.type === "ri") {
|
} else if (stakeholder.type === "ri") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
||||||
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
}
|
}
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,6 @@ export class MonitorSearchDataprovidersComponent {
|
||||||
} else if (stakeholder.type === "organization") {
|
} else if (stakeholder.type === "organization") {
|
||||||
let value = stakeholder.index_id;
|
let value = stakeholder.index_id;
|
||||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.showSwitchSearchLink = true;
|
|
||||||
} else if (stakeholder.type === "ri") {
|
} else if (stakeholder.type === "ri") {
|
||||||
this.navigateToError();
|
this.navigateToError();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUti
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'monitor-search-projects',
|
selector: 'monitor-search-projects',
|
||||||
|
@ -10,7 +11,8 @@ import {Subscriber} from "rxjs";
|
||||||
<div id="page_content">
|
<div id="page_content">
|
||||||
<search-projects *ngIf="initialized"
|
<search-projects *ngIf="initialized"
|
||||||
[customFilter]=customFilter [hasPrefix]="false"
|
[customFilter]=customFilter [hasPrefix]="false"
|
||||||
[includeOnlyResultsAndFilter]="false" >
|
[includeOnlyResultsAndFilter]="false"
|
||||||
|
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/projects'">
|
||||||
</search-projects>
|
</search-projects>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -19,7 +21,7 @@ import {Subscriber} from "rxjs";
|
||||||
export class MonitorSearchProjectsComponent {
|
export class MonitorSearchProjectsComponent {
|
||||||
customFilter: SearchCustomFilter = null;
|
customFilter: SearchCustomFilter = null;
|
||||||
initialized: boolean = false;
|
initialized: boolean = false;
|
||||||
|
properties
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private stakeholderService: StakeholderService) {
|
private stakeholderService: StakeholderService) {
|
||||||
|
@ -34,6 +36,7 @@ export class MonitorSearchProjectsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.properties = properties;
|
||||||
this.subscriptions.push(this.route.params.subscribe(params => {
|
this.subscriptions.push(this.route.params.subscribe(params => {
|
||||||
if (params['stakeholder']) {
|
if (params['stakeholder']) {
|
||||||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||||
|
@ -41,13 +44,9 @@ export class MonitorSearchProjectsComponent {
|
||||||
if (stakeholder.type === "funder") {
|
if (stakeholder.type === "funder") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||||
this.customFilter = new SearchCustomFilter("Funder", "funder", value, "");
|
this.customFilter = new SearchCustomFilter("Funder", "funder", value, "");
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
} else if (stakeholder.type === "organization") {
|
} else if (stakeholder.type === "organization") {
|
||||||
let value = stakeholder.index_id;
|
let value = stakeholder.index_id;
|
||||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
} else if (stakeholder.type === "ri") {
|
} else if (stakeholder.type === "ri") {
|
||||||
this.navigateToError();
|
this.navigateToError();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUti
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'monitor-search-results',
|
selector: 'monitor-search-results',
|
||||||
|
@ -11,14 +12,16 @@ import {Subscriber} from "rxjs";
|
||||||
<search-research-results *ngIf="initialized" resultType="result"
|
<search-research-results *ngIf="initialized" resultType="result"
|
||||||
[customFilter]=customFilter [hasPrefix]="false"
|
[customFilter]=customFilter [hasPrefix]="false"
|
||||||
[includeOnlyResultsAndFilter]="false"
|
[includeOnlyResultsAndFilter]="false"
|
||||||
[showSwitchSearchLink]="true"></search-research-results>
|
[showSwitchSearchLink]="true"
|
||||||
|
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/research-outcomes'"
|
||||||
|
></search-research-results>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
export class MonitorSearchResearchResultsComponent {
|
export class MonitorSearchResearchResultsComponent {
|
||||||
customFilter: SearchCustomFilter = null;
|
customFilter: SearchCustomFilter = null;
|
||||||
initialized: boolean = false;
|
initialized: boolean = false;
|
||||||
|
properties;
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private stakeholderService: StakeholderService) {
|
private stakeholderService: StakeholderService) {
|
||||||
|
@ -33,6 +36,7 @@ export class MonitorSearchResearchResultsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.properties = properties;
|
||||||
this.subscriptions.push(this.route.params.subscribe(params => {
|
this.subscriptions.push(this.route.params.subscribe(params => {
|
||||||
if (params['stakeholder']) {
|
if (params['stakeholder']) {
|
||||||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||||
|
@ -40,18 +44,12 @@ export class MonitorSearchResearchResultsComponent {
|
||||||
if (stakeholder.type === "funder") {
|
if (stakeholder.type === "funder") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||||
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
} else if (stakeholder.type === "organization") {
|
} else if (stakeholder.type === "organization") {
|
||||||
let value = stakeholder.index_id;
|
let value = stakeholder.index_id;
|
||||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
} else if (stakeholder.type === "ri") {
|
} else if (stakeholder.type === "ri") {
|
||||||
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
||||||
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
||||||
this.customFilter.isHiddenFilter = false;
|
|
||||||
this.customFilter.promptToAddFilter = true;
|
|
||||||
}
|
}
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,10 +185,12 @@
|
||||||
<iframe *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source !== 'image' &&
|
<iframe *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source !== 'image' &&
|
||||||
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
||||||
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
[src]="safeUrls.get(indicatorUtils.getFullUrl(stakeholder, indicator.indicatorPaths[0]))"
|
||||||
class="uk-width-1-1 uk-height-medium"></iframe>
|
[class]="' uk-width-1-1 uk-height-' +
|
||||||
|
(indicator.height?indicator.height.toLowerCase():'medium')"></iframe>
|
||||||
<!-- <div>Uncomment for iframes preview</div>-->
|
<!-- <div>Uncomment for iframes preview</div>-->
|
||||||
<div *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source === 'image'">
|
<div *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source === 'image'">
|
||||||
<img class="uk-width-1-1 uk-height-medium" [src]="indicator.indicatorPaths[0].url">
|
<img [class]="' uk-width-1-1 uk-height-' +
|
||||||
|
(indicator.height?indicator.height.toLowerCase():'medium')" [src]="indicator.indicatorPaths[0].url">
|
||||||
</div>
|
</div>
|
||||||
<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>
|
<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
@ -343,7 +345,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div dashboard-input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('width')"
|
<div dashboard-input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('width')"
|
||||||
type="select" [options]="indicatorUtils.indicatorSizes"
|
type="select" [options]="indicatorUtils.indicatorSizes"
|
||||||
label="Chart Size">
|
label="Chart width">
|
||||||
|
</div>
|
||||||
|
<div dashboard-input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('height')"
|
||||||
|
type="select" [options]="indicatorUtils.indicatorSizes"
|
||||||
|
label="Chart height">
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="chartIndicatorPaths" formArrayName="indicatorPaths" class="uk-width-1-1">
|
<div *ngIf="chartIndicatorPaths" formArrayName="indicatorPaths" class="uk-width-1-1">
|
||||||
<div *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index;"
|
<div *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index;"
|
||||||
|
|
|
@ -660,13 +660,14 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
indicatorPaths: this.fb.array([], Validators.required),
|
indicatorPaths: this.fb.array([], Validators.required),
|
||||||
type: this.fb.control(this.indicator.type),
|
type: this.fb.control(this.indicator.type),
|
||||||
width: this.fb.control(this.indicator.width),
|
width: this.fb.control(this.indicator.width),
|
||||||
|
height: this.fb.control(this.indicator.height),
|
||||||
defaultId: this.fb.control(this.indicator.defaultId)
|
defaultId: this.fb.control(this.indicator.defaultId)
|
||||||
});
|
});
|
||||||
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
||||||
this.addNumberIndicatorPath(this.statisticsService.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), indicatorPath.parameters, indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath));
|
this.addNumberIndicatorPath(this.statisticsService.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), indicatorPath.parameters, indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.indicator = new Indicator('', '', '', 'number', 'small', "PUBLIC", []);
|
this.indicator = new Indicator('', '', '', 'number', 'small', 'small', "PUBLIC", []);
|
||||||
this.numberIndicatorFb = this.fb.group({
|
this.numberIndicatorFb = this.fb.group({
|
||||||
_id: this.fb.control(this.indicator._id),
|
_id: this.fb.control(this.indicator._id),
|
||||||
name: this.fb.control(this.indicator.name, Validators.required),
|
name: this.fb.control(this.indicator.name, Validators.required),
|
||||||
|
@ -676,6 +677,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
indicatorPaths: this.fb.array([], Validators.required),
|
indicatorPaths: this.fb.array([], Validators.required),
|
||||||
type: this.fb.control(this.indicator.type),
|
type: this.fb.control(this.indicator.type),
|
||||||
width: this.fb.control(this.indicator.width),
|
width: this.fb.control(this.indicator.width),
|
||||||
|
height: this.fb.control(this.indicator.height),
|
||||||
defaultId: this.fb.control(this.indicator.defaultId)
|
defaultId: this.fb.control(this.indicator.defaultId)
|
||||||
});
|
});
|
||||||
this.addNumberIndicatorPath();
|
this.addNumberIndicatorPath();
|
||||||
|
@ -718,6 +720,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
visibility: this.fb.control(this.indicator.visibility),
|
visibility: this.fb.control(this.indicator.visibility),
|
||||||
indicatorPaths: this.fb.array([]),
|
indicatorPaths: this.fb.array([]),
|
||||||
width: this.fb.control(this.indicator.width),
|
width: this.fb.control(this.indicator.width),
|
||||||
|
height: this.fb.control(this.indicator.height),
|
||||||
defaultId: this.fb.control(this.indicator.defaultId)
|
defaultId: this.fb.control(this.indicator.defaultId)
|
||||||
});
|
});
|
||||||
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
||||||
|
@ -726,7 +729,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
|
indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.indicator = new Indicator('', '', '', 'chart', 'medium', "PUBLIC", []);
|
this.indicator = new Indicator('', '', '', 'chart', 'medium', 'medium', "PUBLIC", []);
|
||||||
this.chartIndicatorFb = this.fb.group({
|
this.chartIndicatorFb = this.fb.group({
|
||||||
_id: this.fb.control(this.indicator._id),
|
_id: this.fb.control(this.indicator._id),
|
||||||
name: this.fb.control(this.indicator.name),
|
name: this.fb.control(this.indicator.name),
|
||||||
|
@ -735,6 +738,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
visibility: this.fb.control(this.indicator.visibility),
|
visibility: this.fb.control(this.indicator.visibility),
|
||||||
indicatorPaths: this.fb.array([]),
|
indicatorPaths: this.fb.array([]),
|
||||||
width: this.fb.control(this.indicator.width, Validators.required),
|
width: this.fb.control(this.indicator.width, Validators.required),
|
||||||
|
height: this.fb.control(this.indicator.height, Validators.required),
|
||||||
defaultId: this.fb.control(this.indicator.defaultId)
|
defaultId: this.fb.control(this.indicator.defaultId)
|
||||||
});
|
});
|
||||||
this.addChartIndicatorPath();
|
this.addChartIndicatorPath();
|
||||||
|
|
|
@ -512,12 +512,12 @@ export class IndicatorUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.debug(values);
|
// console.debug(values);
|
||||||
return values.length > 1;
|
return values.length > 1;
|
||||||
}
|
}
|
||||||
generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type:IndicatorType, addParameters:boolean = true ): Indicator {
|
generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type:IndicatorType, addParameters:boolean = true ): Indicator {
|
||||||
let indicator: Indicator = new Indicator(form.name, form.description, form.additionalDescription, type,
|
let indicator: Indicator = new Indicator(form.name, form.description, form.additionalDescription, type,
|
||||||
form.width, form.visibility, indicatorPaths, form.defaultId);
|
form.width, form.height, form.visibility, indicatorPaths, form.defaultId);
|
||||||
indicator._id = form._id;
|
indicator._id = form._id;
|
||||||
form.indicatorPaths.forEach((indicatorPath, index) => {
|
form.indicatorPaths.forEach((indicatorPath, index) => {
|
||||||
indicator.indicatorPaths[index].type = indicatorPath.type;
|
indicator.indicatorPaths[index].type = indicatorPath.type;
|
||||||
|
|
Loading…
Reference in New Issue