[Monitor Dashboard | Trunk]: Disable additional description if is not default profile

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@59776 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantinos Triantafyllou 2020-11-05 08:20:18 +00:00
parent f6319eac64
commit 80c88075b9
1 changed files with 12 additions and 0 deletions

View File

@ -633,6 +633,11 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
});
this.addNumberIndicatorPath();
}
if(this.indicator.defaultId) {
setTimeout(() => {
this.numberIndicatorFb.get('additionalDescription').disable();
}, 0);
}
this.editNumberModal.cancelButtonText = 'Cancel';
this.editNumberModal.okButtonLeft = false;
this.editNumberModal.alertMessage = false;
@ -686,6 +691,11 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
});
this.addChartIndicatorPath();
}
if(this.indicator.defaultId) {
setTimeout(() => {
this.chartIndicatorFb.get('additionalDescription').disable();
}, 0);
}
this.editChartModal.cancelButtonText = 'Cancel';
this.editChartModal.okButtonLeft = false;
this.editChartModal.alertMessage = false;
@ -702,9 +712,11 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
saveIndicator() {
this.editing = true;
if (this.indicator.type === 'chart') {
this.chartIndicatorFb.get('additionalDescription').enable();
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type, true);
this.section = this.charts.find(section => section._id === this.section._id);
} else {
this.numberIndicatorFb.get('additionalDescription').enable();
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type, false);
this.section = this.numbers.find(section => section._id === this.section._id);
}