mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-242] Select the first in the list when the report is deleted (#1862)
* ADF-242 Select the first in the list when the report is deleted * Update README.md
This commit is contained in:
committed by
Eugenio Romano
parent
22bbffdb21
commit
e09d317d1e
@@ -37,6 +37,9 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
@Input()
|
||||
appId: string;
|
||||
|
||||
@Input()
|
||||
selectFirst: boolean = false;
|
||||
|
||||
@Output()
|
||||
reportClick: EventEmitter<ReportParametersModel> = new EventEmitter<ReportParametersModel>();
|
||||
|
||||
@@ -90,6 +93,9 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
res.forEach((report) => {
|
||||
this.reportObserver.next(report);
|
||||
});
|
||||
if (this.selectFirst) {
|
||||
this.selectFirstReport();
|
||||
}
|
||||
this.onSuccess.emit(res);
|
||||
}
|
||||
},
|
||||
@@ -143,6 +149,11 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
this.reportClick.emit(report);
|
||||
}
|
||||
|
||||
selectFirstReport() {
|
||||
this.selectReport(this.reports[0]);
|
||||
this.selectFirst = false;
|
||||
}
|
||||
|
||||
isSelected(report: any) {
|
||||
return this.currentReport === report ? true : false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user