[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"
|
||||
[activeItem]="activeTopic?activeTopic.alias:null" [showHeader]=true
|
||||
[specialMenuItem]="specialSideBarMenuItem"
|
||||
[searchParams]="createSearchParameters()"
|
||||
[searchParams]="{}"
|
||||
[headerUrl]="'https://' + (properties.environment == 'beta' ? 'beta.' : '') +
|
||||
'monitor.openaire.eu'" queryParamsHandling="preserve"
|
||||
></dashboard-sidebar>
|
||||
|
|
|
@ -262,7 +262,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
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>';
|
||||
}else{
|
||||
this.specialSideBarMenuItem =null;
|
||||
|
@ -371,17 +371,16 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
return true;
|
||||
}
|
||||
|
||||
createSearchParameters() {
|
||||
/* createSearchParameters() {
|
||||
if (!this.stakeholder) {
|
||||
return {};
|
||||
}
|
||||
if (this.stakeholder.type == "funder") {
|
||||
return {"relfunder": encodeURIComponent("\"" + this.stakeholder.index_id + "||" + this.stakeholder.index_name + "||" + this.stakeholder.index_shortName + "\"")};
|
||||
} 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 + "\"")};
|
||||
} else if (this.stakeholder.type == "organization") {
|
||||
return {"cf": true};
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -150,8 +150,8 @@
|
|||
</div>
|
||||
<div *ngIf="activeSubCategory">
|
||||
<div *ngFor="let chart of activeSubCategory.charts; let i = index;"
|
||||
class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-bottom "
|
||||
uk-height-match="target: div > div > .chartTitle">
|
||||
class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-middle "
|
||||
uk-height-match="target: div > div > div > div > .chartTitle">
|
||||
|
||||
<h3 *ngIf="chart.title && chart.title.length > 0 && countIndicatorsToShow(chart.indicators) > 0 "
|
||||
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-1]="indicator.width === 'large'" class="uk-margin-bottom">
|
||||
<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"
|
||||
[class.uk-disabled]="chartsActiveType.get(i + '-' + j).filtersApplied < countSelectedFilters()"
|
||||
[class.semiFiltered]="chartsActiveType.get(i + '-' + j).filtersApplied < countSelectedFilters()"
|
||||
>
|
||||
<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">
|
||||
<button *ngFor="let indicatorPath of indicator.indicatorPaths;"
|
||||
class="uk-button"
|
||||
|
@ -183,12 +183,14 @@
|
|||
{{countSelectedFilters()}}</div>
|
||||
<iframe *ngIf="chartsActiveType.get(i + '-' + j).source !== 'image'"
|
||||
[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}}-->
|
||||
<!-- <a [href]="chartsActiveType.get(i).safeResourceUrl" target="_blank" > ChartuURL</a>-->
|
||||
<img *ngIf="chartsActiveType.get(i + '-' + j).source === 'image'"
|
||||
[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>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -198,10 +200,19 @@
|
|||
</div>
|
||||
</div>
|
||||
<div *ngIf="!loading && !privateStakeholder && (activeSubCategory || (activeTopic &&
|
||||
(activeTopic.categories == null || activeTopic.categories.length == 0)))"
|
||||
class="uk-width-1-1 uk-text-center uk-text-muted">
|
||||
<span>Send us your <a [href]="mailText" target="_self" (click)="mailMe()">feedback</a>.</span>
|
||||
|
||||
(activeTopic.categories == null || activeTopic.categories.length == 0)))" class="uk-margin-small-top uk-flex">
|
||||
<!-- Last Stats Date-->
|
||||
<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>
|
||||
|
|
|
@ -30,6 +30,7 @@ import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperCla
|
|||
import {Location} from "@angular/common";
|
||||
import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
|
||||
import {properties} from "../../environments/environment";
|
||||
import {IndexInfoService} from "../openaireLibrary/utils/indexInfo.service";
|
||||
|
||||
@Component({
|
||||
selector: 'monitor',
|
||||
|
@ -71,7 +72,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
};
|
||||
privateStakeholder = false;
|
||||
public keyword: FormControl;
|
||||
|
||||
public statsUpdateDate: Date;
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private _router: Router,
|
||||
|
@ -85,6 +86,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
private layoutService: LayoutService,
|
||||
private seoService: SEOService,
|
||||
private cdr: ChangeDetectorRef,
|
||||
private indexInfoService: IndexInfoService,
|
||||
private sanitizer: DomSanitizer, private _fb: FormBuilder, private router: Router) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.errorMessages = new ErrorMessagesComponent();
|
||||
|
@ -92,6 +94,13 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
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.subscriptions.push(this.keyword.valueChanges.subscribe(value => {
|
||||
console.log("Keyword Changed!");
|
||||
|
@ -196,7 +205,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
for (let filter of this.filters) {
|
||||
if (this.queryParams[filter.filterId]) {
|
||||
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;
|
||||
filter.countSelectedValues = 1;
|
||||
break;
|
||||
|
@ -364,7 +373,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
}
|
||||
if (selected) {
|
||||
this.queryParams[$event.value.filterId] = selected;
|
||||
this.queryParams[$event.value.filterId] = StringUtils.quote(StringUtils.URIEncode(selected));
|
||||
} else {
|
||||
delete this.queryParams[$event.value.filterId];
|
||||
}
|
||||
|
@ -377,7 +386,8 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
|
||||
private getfl0() {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -40,17 +40,13 @@ export class MonitorAdvancedSearchDataprovidersComponent {
|
|||
if (stakeholder.type === "organization") {
|
||||
let value = stakeholder.index_id;
|
||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
this.showSwitchSearchLink = true;
|
||||
} else if (stakeholder.type === "funder") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
} else if (stakeholder.type === "ri") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
||||
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
}
|
||||
this.initialized = true;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUti
|
|||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
||||
import {Subscriber} from "rxjs";
|
||||
import {properties} from "../../../../environments/environment";
|
||||
|
||||
@Component({
|
||||
selector: 'monitor-advanced-search-projects',
|
||||
|
@ -10,7 +11,9 @@ import {Subscriber} from "rxjs";
|
|||
<div id="page_content">
|
||||
<search-projects *ngIf="initialized" [simpleView]="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>
|
||||
</div>
|
||||
`
|
||||
|
@ -20,6 +23,7 @@ export class MonitorAdvancedSearchProjectsComponent {
|
|||
customFilter: SearchCustomFilter = null;
|
||||
initialized: boolean = false;
|
||||
showSwitchSearchLink:boolean = false;
|
||||
properties;
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private stakeholderService: StakeholderService) {
|
||||
|
@ -34,6 +38,7 @@ export class MonitorAdvancedSearchProjectsComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.properties = properties;
|
||||
this.subscriptions.push(this.route.params.subscribe(params => {
|
||||
if (params['stakeholder']) {
|
||||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||
|
@ -41,19 +46,14 @@ export class MonitorAdvancedSearchProjectsComponent {
|
|||
if (stakeholder.type === "funder") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||
this.customFilter = new SearchCustomFilter("Funder", "funder", value, "");
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
this.showSwitchSearchLink = true;
|
||||
} else if (stakeholder.type === "organization") {
|
||||
let value = stakeholder.index_id;
|
||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
this.showSwitchSearchLink = true;
|
||||
} else if (stakeholder.type === "ri") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
||||
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
}
|
||||
this.initialized = true;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUti
|
|||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
||||
import {Subscriber} from "rxjs";
|
||||
import {properties} from "../../../../environments/environment";
|
||||
|
||||
@Component({
|
||||
selector: 'monitor-advanced-search-results',
|
||||
|
@ -11,14 +12,16 @@ import {Subscriber} from "rxjs";
|
|||
<search-research-results *ngIf="initialized" resultType="result" [simpleView]="false"
|
||||
[customFilter]=customFilter [hasPrefix]="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>
|
||||
`
|
||||
})
|
||||
export class MonitorAdvancedSearchResearchResultsComponent {
|
||||
customFilter: SearchCustomFilter = null;
|
||||
initialized: boolean = false;
|
||||
|
||||
properties;
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private stakeholderService: StakeholderService) {
|
||||
|
@ -33,6 +36,7 @@ export class MonitorAdvancedSearchResearchResultsComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.properties = properties;
|
||||
this.subscriptions.push(this.route.params.subscribe(params => {
|
||||
if (params['stakeholder']) {
|
||||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||
|
@ -40,18 +44,12 @@ export class MonitorAdvancedSearchResearchResultsComponent {
|
|||
if (stakeholder.type === "funder") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
} else if (stakeholder.type === "organization") {
|
||||
let value = stakeholder.index_id;
|
||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
} else if (stakeholder.type === "ri") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
||||
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
}
|
||||
this.initialized = true;
|
||||
}
|
||||
|
|
|
@ -42,8 +42,6 @@ export class MonitorSearchDataprovidersComponent {
|
|||
} else if (stakeholder.type === "organization") {
|
||||
let value = stakeholder.index_id;
|
||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.showSwitchSearchLink = true;
|
||||
} else if (stakeholder.type === "ri") {
|
||||
this.navigateToError();
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUti
|
|||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
||||
import {Subscriber} from "rxjs";
|
||||
import {properties} from "../../../../environments/environment";
|
||||
|
||||
@Component({
|
||||
selector: 'monitor-search-projects',
|
||||
|
@ -10,7 +11,8 @@ import {Subscriber} from "rxjs";
|
|||
<div id="page_content">
|
||||
<search-projects *ngIf="initialized"
|
||||
[customFilter]=customFilter [hasPrefix]="false"
|
||||
[includeOnlyResultsAndFilter]="false" >
|
||||
[includeOnlyResultsAndFilter]="false"
|
||||
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/projects'">
|
||||
</search-projects>
|
||||
</div>
|
||||
`
|
||||
|
@ -19,7 +21,7 @@ import {Subscriber} from "rxjs";
|
|||
export class MonitorSearchProjectsComponent {
|
||||
customFilter: SearchCustomFilter = null;
|
||||
initialized: boolean = false;
|
||||
|
||||
properties
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private stakeholderService: StakeholderService) {
|
||||
|
@ -34,6 +36,7 @@ export class MonitorSearchProjectsComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.properties = properties;
|
||||
this.subscriptions.push(this.route.params.subscribe(params => {
|
||||
if (params['stakeholder']) {
|
||||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||
|
@ -41,13 +44,9 @@ export class MonitorSearchProjectsComponent {
|
|||
if (stakeholder.type === "funder") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||
this.customFilter = new SearchCustomFilter("Funder", "funder", value, "");
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
} else if (stakeholder.type === "organization") {
|
||||
let value = stakeholder.index_id;
|
||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
} else if (stakeholder.type === "ri") {
|
||||
this.navigateToError();
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUti
|
|||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
|
||||
import {Subscriber} from "rxjs";
|
||||
import {properties} from "../../../../environments/environment";
|
||||
|
||||
@Component({
|
||||
selector: 'monitor-search-results',
|
||||
|
@ -11,14 +12,16 @@ import {Subscriber} from "rxjs";
|
|||
<search-research-results *ngIf="initialized" resultType="result"
|
||||
[customFilter]=customFilter [hasPrefix]="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>
|
||||
`,
|
||||
})
|
||||
export class MonitorSearchResearchResultsComponent {
|
||||
customFilter: SearchCustomFilter = null;
|
||||
initialized: boolean = false;
|
||||
|
||||
properties;
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private stakeholderService: StakeholderService) {
|
||||
|
@ -33,6 +36,7 @@ export class MonitorSearchResearchResultsComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.properties = properties;
|
||||
this.subscriptions.push(this.route.params.subscribe(params => {
|
||||
if (params['stakeholder']) {
|
||||
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||
|
@ -40,18 +44,12 @@ export class MonitorSearchResearchResultsComponent {
|
|||
if (stakeholder.type === "funder") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
|
||||
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
} else if (stakeholder.type === "organization") {
|
||||
let value = stakeholder.index_id;
|
||||
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
} else if (stakeholder.type === "ri") {
|
||||
let value = stakeholder.index_id+"||"+stakeholder.index_name;
|
||||
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
|
||||
this.customFilter.isHiddenFilter = false;
|
||||
this.customFilter.promptToAddFilter = true;
|
||||
}
|
||||
this.initialized = true;
|
||||
}
|
||||
|
|
|
@ -185,10 +185,12 @@
|
|||
<iframe *ngIf="indicator.indicatorPaths[0] && indicator.indicatorPaths[0].source !== 'image' &&
|
||||
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 *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>
|
||||
<ng-container *ngTemplateOutlet="description; context: {indicator:indicator}"></ng-container>
|
||||
</div>
|
||||
|
@ -343,7 +345,11 @@
|
|||
</div>
|
||||
<div dashboard-input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('width')"
|
||||
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 *ngIf="chartIndicatorPaths" formArrayName="indicatorPaths" class="uk-width-1-1">
|
||||
<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),
|
||||
type: this.fb.control(this.indicator.type),
|
||||
width: this.fb.control(this.indicator.width),
|
||||
height: this.fb.control(this.indicator.height),
|
||||
defaultId: this.fb.control(this.indicator.defaultId)
|
||||
});
|
||||
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));
|
||||
});
|
||||
} else {
|
||||
this.indicator = new Indicator('', '', '', 'number', 'small', "PUBLIC", []);
|
||||
this.indicator = new Indicator('', '', '', 'number', 'small', 'small', "PUBLIC", []);
|
||||
this.numberIndicatorFb = this.fb.group({
|
||||
_id: this.fb.control(this.indicator._id),
|
||||
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),
|
||||
type: this.fb.control(this.indicator.type),
|
||||
width: this.fb.control(this.indicator.width),
|
||||
height: this.fb.control(this.indicator.height),
|
||||
defaultId: this.fb.control(this.indicator.defaultId)
|
||||
});
|
||||
this.addNumberIndicatorPath();
|
||||
|
@ -718,6 +720,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
visibility: this.fb.control(this.indicator.visibility),
|
||||
indicatorPaths: this.fb.array([]),
|
||||
width: this.fb.control(this.indicator.width),
|
||||
height: this.fb.control(this.indicator.height),
|
||||
defaultId: this.fb.control(this.indicator.defaultId)
|
||||
});
|
||||
this.indicator.indicatorPaths.forEach(indicatorPath => {
|
||||
|
@ -726,7 +729,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
|||
indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath);
|
||||
});
|
||||
} else {
|
||||
this.indicator = new Indicator('', '', '', 'chart', 'medium', "PUBLIC", []);
|
||||
this.indicator = new Indicator('', '', '', 'chart', 'medium', 'medium', "PUBLIC", []);
|
||||
this.chartIndicatorFb = this.fb.group({
|
||||
_id: this.fb.control(this.indicator._id),
|
||||
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),
|
||||
indicatorPaths: this.fb.array([]),
|
||||
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)
|
||||
});
|
||||
this.addChartIndicatorPath();
|
||||
|
|
|
@ -512,12 +512,12 @@ export class IndicatorUtils {
|
|||
}
|
||||
}
|
||||
}
|
||||
console.debug(values);
|
||||
// console.debug(values);
|
||||
return values.length > 1;
|
||||
}
|
||||
generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type:IndicatorType, addParameters:boolean = true ): Indicator {
|
||||
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;
|
||||
form.indicatorPaths.forEach((indicatorPath, index) => {
|
||||
indicator.indicatorPaths[index].type = indicatorPath.type;
|
||||
|
|
Loading…
Reference in New Issue