Fix monitor page with new multi indicator paths

This commit is contained in:
Konstantinos Triantafyllou 2024-04-05 20:44:16 +03:00
parent b9d825fb40
commit 3e90b38251
4 changed files with 22 additions and 18 deletions

@ -1 +1 @@
Subproject commit dc1679c56534a505836bc505c75adc3c7ac77fda Subproject commit e91830f2f8c1182c6e728f87a03af3a2932d816e

View File

@ -115,34 +115,39 @@
<div *ngIf="getSectionDescription(chart)" class="uk-width-1-1 uk-margin-bottom">{{getSectionDescription(chart)}}</div> <div *ngIf="getSectionDescription(chart)" class="uk-width-1-1 uk-margin-bottom">{{getSectionDescription(chart)}}</div>
<h6 *ngIf="chart.title && isMobile && !tabs" class="uk-width-1-1">{{getSectionTitle(chart)}}</h6> <h6 *ngIf="chart.title && isMobile && !tabs" class="uk-width-1-1">{{getSectionTitle(chart)}}</h6>
<ng-template ngFor [ngForOf]="chart.indicators" let-indicator let-j="index"> <ng-template ngFor [ngForOf]="chart.indicators" let-indicator let-j="index">
<div *ngIf="hasPermission(indicator.visibility) && chartsActiveType.get(activeChartSectionIndex + '-' + j)" <div *ngIf="hasPermission(indicator.visibility)"
[ngClass]="getChartClassBySize(indicator.width)"> [ngClass]="getChartClassBySize(indicator.width)">
<div class="uk-card uk-card-default uk-position-relative" <div class="uk-card uk-card-default uk-position-relative"
[class.semiFiltered]="chartsActiveType.get(activeChartSectionIndex + '-' + j).filtersApplied < countSelectedFilters()"> [class.semiFiltered]="getActiveIndicatorPath(indicator).filtersApplied < countSelectedFilters()">
<div class="uk-card-body uk-text-center uk-margin-small-bottom"> <div class="uk-card-body uk-margin-small-bottom">
<h6 class="uk-margin-bottom chartTitle uk-flex uk-flex-bottom"> <h6 class="uk-margin-bottom chartTitle uk-flex uk-flex-bottom">
{{indicator.name + " "}} {{indicator.name + " "}}
</h6> </h6>
<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;" <ul class="uk-subnav uk-subnav-pill uk-subnav-small">
class="uk-button" <li *ngFor="let indicatorPath of indicator.indicatorPaths; let i=index"
(click)="setActiveChart(activeChartSectionIndex, j, indicatorPath.type)" class="uk-flex uk-margin-small-top"
[class.uk-button-secondary]="chartsActiveType.get(activeChartSectionIndex + '-' + j).url === indicatorPath.url"> [class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
{{indicatorPath.type}} <a (click)="indicator.activePath = i">
</button> <span>
{{indicatorPath.parameters.title ? indicatorPath.parameters.title : '--' }}
</span>
</a>
</li>
</ul>
</div> </div>
<iframe [class.uk-blend-multiply]="!isFullscreen" <iframe [class.uk-blend-multiply]="!isFullscreen"
*ngIf=" !properties.disableFrameLoad && chartsActiveType.get(activeChartSectionIndex + '-' + j).source !== 'image'" *ngIf=" !properties.disableFrameLoad && getActiveIndicatorPath(indicator).source !== 'image'"
[src]="chartsActiveType.get(activeChartSectionIndex + '-' + j).safeResourceUrl" [src]="getActiveIndicatorPath(indicator).safeResourceUrl"
class="uk-width-1-1" allowfullscreen="true" mozallowfullscreen="true" class="uk-width-1-1" allowfullscreen="true" mozallowfullscreen="true"
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"></iframe> [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"></iframe>
<div *ngIf="properties.disableFrameLoad && chartsActiveType.get(activeChartSectionIndex + '-' + j).source !== 'image'"> <div *ngIf="properties.disableFrameLoad && getActiveIndicatorPath(indicator).source !== 'image'">
<img class="uk-width-1-1 uk-blend-multiply" <img class="uk-width-1-1 uk-blend-multiply"
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')" [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
src="assets/chart-placeholder.png"> src="assets/chart-placeholder.png">
</div> </div>
<img *ngIf="chartsActiveType.get(activeChartSectionIndex + '-' + j).source === 'image'" <img *ngIf="getActiveIndicatorPath(indicator).source === 'image'"
[src]="chartsActiveType.get(activeChartSectionIndex + '-' + j).safeResourceUrl" [src]="getActiveIndicatorPath(indicator).safeResourceUrl"
class="uk-width-1-1 uk-blend-multiply" class="uk-width-1-1 uk-blend-multiply"
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"> [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')">
</div> </div>
@ -194,7 +199,7 @@
</button> </button>
</div> </div>
<div class="clipboard-wrapper uk-margin-top uk-margin-bottom"> <div class="clipboard-wrapper uk-margin-top uk-margin-bottom">
<pre id="embed_content_id" class="uk-padding-small"><code>&lt;iframe width="500" height="500" <br> src="{{chartsActiveType.get(activeChartSectionIndex + '-' + j).safeResourceUrl.changingThisBreaksApplicationSecurity}}"<br> allowfullscreen="true" mozallowfullscreen="true"&gt;<br>&lt;/iframe&gt;</code></pre> <pre id="embed_content_id" class="uk-padding-small"><code>&lt;iframe width="500" height="500" <br> src="{{getActiveIndicatorPath(indicator).safeResourceUrl.changingThisBreaksApplicationSecurity}}"<br> allowfullscreen="true" mozallowfullscreen="true"&gt;<br>&lt;/iframe&gt;</code></pre>
</div> </div>
<div class="uk-flex uk-flex-right"> <div class="uk-flex uk-flex-right">
<a class="uk-link-reset copy clipboard_btn" <a class="uk-link-reset copy clipboard_btn"

View File

@ -71,7 +71,6 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
this.activeCategory = null; this.activeCategory = null;
this.activeSubCategory = null; this.activeSubCategory = null;
this.numberResults = new Map<string, number>(); this.numberResults = new Map<string, number>();
this.chartsActiveType = new Map<string, IndicatorPath>();
this.subscriptions.push(this._route.queryParams.subscribe(queryParams => { this.subscriptions.push(this._route.queryParams.subscribe(queryParams => {
this.handleQueryParams(queryParams, params); this.handleQueryParams(queryParams, params);
this.setMetadata(); this.setMetadata();

@ -1 +1 @@
Subproject commit 954a1fe8af0653740882c7db4b9bf92b8f9000f4 Subproject commit 43ed7e267915bcae7f3ab03fab8c98136810f269