From 79d00f7f35bdbd25f3d2e15ec92ffb2639437ebb Mon Sep 17 00:00:00 2001 From: Konstantinos Triantafyllou Date: Sun, 15 Dec 2019 22:02:39 +0000 Subject: [PATCH] [Monitor Dashboard | Trunk]: Fix a bug with indicator edit form. Change hr -> Chart Settings git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57889 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/topic/indicators.component.html | 6 ++++-- src/app/topic/indicators.component.ts | 15 +++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/app/topic/indicators.component.html b/src/app/topic/indicators.component.html index 4e81311..7badbc9 100644 --- a/src/app/topic/indicators.component.html +++ b/src/app/topic/indicators.component.html @@ -253,7 +253,9 @@ label="Chart Size"> -
+
+ Chart Settings +
@@ -297,7 +299,7 @@
-
{ - if (this.indicatorPaths.at(index).valid) { - let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value.url), value.url); + this.urlSubscriptions.push(this.indicatorPaths.at(index).get('url').valueChanges.subscribe(value => { + if (this.indicatorPaths.at(index).get('url').valid) { + let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value), value); let parameters = this.getParametersAsFormArray(indicatorPath); (this.indicatorPaths.at(index) as FormGroup).setControl('parameters', parameters); if (!this.indicator.indicatorPaths[index]) { @@ -420,7 +420,14 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV } hasDifference(index: number): boolean { - return this.indicator.indicatorPaths[index].safeResourceUrl.toString() !== + let hasDifference = false; + this.indicatorPaths.at(index).value.parameters.forEach((parameter) => { + if(parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { + hasDifference = true; + return; + } + }); + return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !== this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString(); }