Merge branch 'development' into dev-eromano-bundle

This commit is contained in:
Mario Romano
2016-12-15 10:40:01 +00:00
committed by GitHub
17 changed files with 174 additions and 34 deletions

View File

@@ -47,6 +47,9 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges {
@Output()
onError = new EventEmitter();
@Output()
onEdit = new EventEmitter();
@Output()
onFormValueChanged = new EventEmitter();
@@ -63,6 +66,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges {
private dropDownSub;
private reportParamsSub;
private paramOpts;
private isEditable: boolean = false;
constructor(private translate: AlfrescoTranslationService,
private analyticsService: AnalyticsService,
@@ -210,4 +214,25 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges {
this.reportParamsSub.unsubscribe();
}
}
public editEnable() {
this.isEditable = true;
}
public editDisable() {
this.isEditable = false;
}
public editTitle() {
this.reportParamsSub = this.analyticsService.updateReport(this.reportParameters.id, this.reportParameters.name).subscribe(
(res: ReportParametersModel) => {
this.editDisable();
this.onEdit.emit(this.reportParameters.name);
},
(err: any) => {
console.log(err);
this.onError.emit(err);
}
);
}
}