[Monitor Dashboard | Trunk]: Add indicator path remove for loop
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@60234 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
ecba49c727
commit
5db6152749
|
@ -542,7 +542,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
source: this.fb.control(source, Validators.required)
|
source: this.fb.control(source, Validators.required)
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
for (let index = 0; index < this.numberIndicatorPaths.length; index++) {
|
let index = this.numberIndicatorPaths.length - 1;
|
||||||
if (this.numberIndicatorPaths.at(index).get('url').valid) {
|
if (this.numberIndicatorPaths.at(index).get('url').valid) {
|
||||||
this.validateJsonPath(index);
|
this.validateJsonPath(index);
|
||||||
}
|
}
|
||||||
|
@ -604,7 +604,6 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
this.numberIndicatorPaths.at(index).get('source').disable();
|
this.numberIndicatorPaths.at(index).get('source').disable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public addChartIndicatorPath(value: string = '', parameters: FormArray = new FormArray([]), disableUrl: boolean = false, type: string = null) {
|
public addChartIndicatorPath(value: string = '', parameters: FormArray = new FormArray([]), disableUrl: boolean = false, type: string = null) {
|
||||||
this.chartIndicatorPaths.push(this.fb.group({
|
this.chartIndicatorPaths.push(this.fb.group({
|
||||||
|
@ -613,12 +612,10 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
type: this.fb.control(type)
|
type: this.fb.control(type)
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
let index = this.chartIndicatorPaths.length - 1;
|
||||||
if (disableUrl) {
|
if (disableUrl) {
|
||||||
for (let index = 0; index < this.chartIndicatorPaths.length; index++) {
|
|
||||||
this.chartIndicatorPaths.at(index).get('url').disable();
|
this.chartIndicatorPaths.at(index).get('url').disable();
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for (let index = 0; index < this.chartIndicatorPaths.length; index++) {
|
|
||||||
this.urlSubscriptions.push(this.chartIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
|
this.urlSubscriptions.push(this.chartIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
|
||||||
if (this.chartIndicatorPaths.at(index).get('url').valid) {
|
if (this.chartIndicatorPaths.at(index).get('url').valid) {
|
||||||
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value), value, this.chartIndicatorPaths.at(index).get('type').value, this.stakeholder);
|
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value), value, this.chartIndicatorPaths.at(index).get('type').value, this.stakeholder);
|
||||||
|
@ -645,9 +642,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
|
||||||
} else {
|
} else {
|
||||||
this.urlParameterizedMessage = null;
|
this.urlParameterizedMessage = null;
|
||||||
}
|
}
|
||||||
})
|
}));
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue