[Monitor Dashboard | Trunk]: Fix chart indicator modal form

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@59752 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantinos Triantafyllou 2020-11-03 11:12:34 +00:00
parent 29537d917d
commit 7fdd099582
2 changed files with 7 additions and 11 deletions

View File

@ -330,9 +330,9 @@
type="select" [options]="indicatorUtils.indicatorSizes"
label="Chart Size">
</div>
<ng-template [ngIf]="chartIndicatorPaths" formArrayName="indicatorPaths">
<ng-template ngFor [ngForOf]="chartIndicatorPaths.controls" let-indicatorPath let-i="index"
[formGroup]="toFormGroup(indicatorPath)">
<div *ngIf="chartIndicatorPaths" formArrayName="indicatorPaths" class="uk-width-1-1">
<div *ngFor="let indicatorPath of chartIndicatorPaths.controls; let i=index;"
[formGroup]="indicatorPath" class="uk-grid" uk-grid>
<div dashboard-input class="uk-width-1-1"
[title]="indicatorPath.get('url').disabled?'Default chart URLs cannot change':''"
[formInput]="indicatorPath.get('url')"
@ -340,7 +340,7 @@
<div *ngIf="urlParameterizedMessage.length > 0" class="uk-alert-warning uk-alert uk-width-1-1">
{{urlParameterizedMessage}}
</div>
<ng-template formArrayName="parameters">
<div formArrayName="parameters" class="uk-grid uk-width-1-1" uk-grid>
<div *ngIf="getParameter(i, 'title')" class="uk-width-1-1">
<div dashboard-input
[formInput]="getParameter(i, 'title').get('value')"
@ -386,7 +386,7 @@
<div dashboard-input [formInput]="getParameter(i, 'end_year').get('value')"
label="Year (To)"></div>
</div>
</ng-template>
</div>
<div *ngIf="indicator && indicator.indicatorPaths[i] && indicator.indicatorPaths[i].safeResourceUrl"
class="uk-margin-medium-top uk-position-relative uk-width-1-1 uk-flex uk-flex-center">
<div *ngIf="(hasDifference(i)) && !indicatorPath.invalid"
@ -408,8 +408,8 @@
<img class="uk-width-1-1 uk-height-large" [src]="indicator.indicatorPaths[i].url">
</div>
</div>
</ng-template>
</ng-template>
</div>
</div>
</div>
</div>
</modal-alert>

View File

@ -372,10 +372,6 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
return this.chartIndicatorFb.get('indicatorPaths') as FormArray;
}
public toFormGroup(value: any): FormGroup {
return value as FormGroup
}
public addJsonPath(index: number) {
if(index==0 && this.getJsonPath(index).getRawValue()[index].indexOf(",")!=-1){
//if in the first path there are more than one paaths comma separated, split them and autogenerate the forms