Compare commits

...

2 Commits

3 changed files with 51 additions and 35 deletions

View File

@ -6,11 +6,10 @@
{{pluginObject.title}}<span class="uk-text-primary">.</span>
</h2>
</div>
<slider-container [total]="activeCards.length" [navigation]="'progress'" [period]="6000" [infinite]="true" [parent]="parent">
<slider-column type="nav" class="slider-nav">
<slider-container [total]="activeCards.length" [navigation]="'progress'" [period]="6000" [infinite]="true" [parent]="parent">
<ng-container *ngIf="activeCards.length > 0">
<slider-column type="nav" class="slider-nav" style="min-height: 300px">
<ng-container *ngFor="let card of activeCards; let i = index">
<ng-container *ngIf="card.show">
<slider-nav-item [start]="i">
<div class="uk-text-primary">{{card.tag}}</div>
<div class="uk-margin-remove uk-text-large uk-text-bold">
@ -22,7 +21,6 @@
{{url.linkText}}
</a>
</slider-nav-item>
</ng-container>
</ng-container>
</slider-column>
<slider-column type="slider">
@ -31,14 +29,13 @@
+ 'connect.openaire.eu/assets/connect-assets/home/tablet.png'"
alt="ipad" loading="lazy">
</slider-item>
<ng-container *ngFor="let card of pluginObject.cardInfoArray; let i = index">
<ng-container *ngIf="card.show">
<ng-container *ngFor="let card of activeCards; let i = index">
<slider-item type="slide" [start]="i">
<img [src]="card.image" [alt]="card.tag" loading="lazy">
</slider-item>
</ng-container>
</ng-container>
</slider-column>
</ng-container>
</slider-container>
</div>
</div>

View File

@ -21,7 +21,7 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
activeChartSectionIndex: number = 0;
stakeholder = null;
@Input() pluginObject: PluginStats;
profiles;
constructor(protected _route: ActivatedRoute,
protected _router: Router,
protected _meta: Meta,
@ -45,32 +45,48 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(communityInfo => {
if (communityInfo) {
this.loading = true;
this.stakeholder = PluginStats.getMockStakeholder();
this.stakeholder.index_id = communityInfo.communityId
this.stakeholder.index_name = communityInfo.title;
this.stakeholder.index_shortName = communityInfo.shortTitle;
this.title = this.stakeholder.name;
this.description = this.stakeholder.name;
this.loading = true;
this.activeTopic = null;
this.activeCategory = null;
this.activeSubCategory = null;
this.numberResults = new Map<string, number>();
this.chartsActiveType = new Map<string, IndicatorPath>();
this.setView({});
let ids = [];
for (let section of this.activeSubCategory.charts) {
for (let indicator of section.indicators) {
ids.push(indicator._id)
this.subscriptions.push(this.http.get(this.properties.monitorStatsFrameUrl+"/schema/profiles").subscribe((profiles:any[]) => {
this.profiles = profiles.map( (profile) => profile.name);
let profile = PluginStats.getDefaultProfile();
if(this.profiles.indexOf("monitor_"+communityInfo.communityId.replace("-","_"))!=-1){
profile = this.profiles[this.profiles.indexOf("monitor_"+communityInfo.communityId.replace("-","_"))];
}else if(communityInfo.type == "ri" && this.profiles.indexOf("monitor_ris_tail")!=-1){
profile = "monitor_ris_tail";
}
}
this.init(communityInfo, profile);
}, error => {
let profile =
this.init(communityInfo, PluginStats.getDefaultProfile());
}))
}
}));
}
public init(communityInfo, profile){
console.log(profile)
this.loading = true;
this.stakeholder = PluginStats.getMockStakeholder();
this.stakeholder.statsProfile = profile;
this.stakeholder.index_id = communityInfo.communityId
this.stakeholder.index_name = communityInfo.title;
this.stakeholder.index_shortName = communityInfo.shortTitle;
this.title = this.stakeholder.name;
this.description = this.stakeholder.name;
this.loading = true;
this.activeTopic = null;
this.activeCategory = null;
this.activeSubCategory = null;
this.numberResults = new Map<string, number>();
this.chartsActiveType = new Map<string, IndicatorPath>();
this.setView({});
let ids = [];
for (let section of this.activeSubCategory.charts) {
for (let indicator of section.indicators) {
ids.push(indicator._id)
}
}
}
public showSection(section: Section): boolean {
for (let indicator of section.indicators) {
if (this.showIndicator(indicator)) {

File diff suppressed because one or more lines are too long