diff --git a/src/app/topic/indicators.component.ts b/src/app/topic/indicators.component.ts index 92c2f3d..bf929c7 100644 --- a/src/app/topic/indicators.component.ts +++ b/src/app/topic/indicators.component.ts @@ -502,7 +502,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV this.addNumberIndicatorPath(indicatorPath.url, indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath)); }); } else { - this.indicator = new Indicator('', '', 'number', 'small', false, false, []); + this.indicator = new Indicator('', '', 'number', 'small', true, true, []); this.numberIndicatorFb = this.fb.group({ _id: this.fb.control(this.indicator._id), name: this.fb.control(this.indicator.name), @@ -556,16 +556,16 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); }); } else { - this.indicator = new Indicator('', '', 'chart', 'small', false, false, []); + this.indicator = new Indicator('', '', 'chart', 'small', true, true, []); this.chartIndicatorFb = this.fb.group({ - _id: this.fb.control(null), - name: this.fb.control(''), - description: this.fb.control(''), - isPublic: this.fb.control(false), - isActive: this.fb.control(false), + _id: this.fb.control(this.indicator._id), + name: this.fb.control(this.indicator.name), + description: this.fb.control(this.indicator.description), + isPublic: this.fb.control(this.indicator.isPublic), + isActive: this.fb.control(this.indicator.isActive), indicatorPaths: this.fb.array([]), - width: this.fb.control('small', Validators.required), - defaultId: this.fb.control(null) + width: this.fb.control(this.indicator.width, Validators.required), + defaultId: this.fb.control(this.indicator.defaultId) }); this.addChartIndicatorPath(); }