[Dashboard|Trunk]

Indicators description: update the logic for the 2 descriptions show and enable description based on the type of the profile and if it is inherited or not


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@59926 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Argiro Kokogiannaki 2020-11-20 10:52:17 +00:00
parent 178a17cbbf
commit ca80593e4e
2 changed files with 14 additions and 12 deletions

View File

@ -237,13 +237,14 @@
<div *ngIf="numberIndicatorFb" class="uk-padding-small" [formGroup]="numberIndicatorFb">
<div class="uk-grid" uk-grid>
<div dashboard-input class="uk-width-1-1" [formInput]="numberIndicatorFb.get('name')" label="Title"></div>
<div dashboard-input class="uk-width-1-1"
<div dashboard-input class="uk-width-1-1" *ngIf="stakeholder.defaultId !=-1 && ( (indicator.description &&
indicator.description.length > 0) || !stakeholder.defaultId)"
[formInput]="numberIndicatorFb.get('description')"
label="Description" type="textarea">
label="Profile description" type="textarea">
</div>
<div dashboard-input *ngIf="isCurator || indicator.defaultId" class="uk-width-1-1"
<div dashboard-input class="uk-width-1-1" *ngIf="stakeholder.defaultId"
[formInput]="numberIndicatorFb.get('additionalDescription')"
label="Additional information" type="textarea">
label="Description" type="textarea">
</div>
<div dashboard-input class="uk-width-1-2@m" [formInput]="numberIndicatorFb.get('visibility')"
@ -340,13 +341,14 @@
<div *ngIf="chartIndicatorFb" class="uk-padding-small" [formGroup]="chartIndicatorFb">
<div class="uk-grid" uk-grid>
<div dashboard-input class="uk-width-1-1" [formInput]="chartIndicatorFb.get('name')" label="Title"></div>
<div dashboard-input class="uk-width-1-1"
<div dashboard-input class="uk-width-1-1" *ngIf="stakeholder.defaultId !=-1 && ( (indicator.description &&
indicator.description.length > 0) || !stakeholder.defaultId)"
[formInput]="chartIndicatorFb.get('description')"
label="Description" type="textarea">
label="Default Description" type="textarea">
</div>
<div dashboard-input *ngIf="isCurator || indicator.defaultId" class="uk-width-1-1"
<div dashboard-input *ngIf="stakeholder.defaultId" class="uk-width-1-1"
[formInput]="chartIndicatorFb.get('additionalDescription')"
label="Additional information" type="textarea">
label="Description" type="textarea">
</div>
<div dashboard-input class="uk-width-1-2@m" [formInput]="chartIndicatorFb.get('visibility')"
label="Status" [options]="stakeholderUtils.visibility" type="select">

View File

@ -682,7 +682,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
}
if (this.indicator.defaultId) {
setTimeout(() => {
this.numberIndicatorFb.get('additionalDescription').disable();
this.numberIndicatorFb.get('description').disable();
}, 0);
}
this.editNumberModal.cancelButtonText = 'Cancel';
@ -741,7 +741,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
}
if (this.indicator.defaultId) {
setTimeout(() => {
this.chartIndicatorFb.get('additionalDescription').disable();
this.chartIndicatorFb.get('description').disable();
}, 0);
}
this.editChartModal.cancelButtonText = 'Cancel';
@ -760,11 +760,11 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
saveIndicator() {
this.editing = true;
if (this.indicator.type === 'chart') {
this.chartIndicatorFb.get('additionalDescription').enable();
this.chartIndicatorFb.get('description').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.numberIndicatorFb.get('description').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);
}