mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +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:
parent
22bbffdb21
commit
e09d317d1e
@ -149,6 +149,7 @@
|
||||
<hr>
|
||||
<analytics-report-list
|
||||
[appId]="appId"
|
||||
[selectFirst]="selectFirstReport"
|
||||
(reportClick)="onReportClick($event)"
|
||||
#analyticsreportlist>
|
||||
</analytics-report-list>
|
||||
|
@ -79,6 +79,7 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
appId: number = null;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
selectFirstReport: boolean = false;
|
||||
|
||||
content: Blob;
|
||||
contentName: string;
|
||||
@ -213,14 +214,8 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
}
|
||||
|
||||
onReportDeleted() {
|
||||
this.selectFirstReport = true;
|
||||
this.analyticsreportlist.reload();
|
||||
this.selectFirstElementInReportList();
|
||||
}
|
||||
|
||||
selectFirstElementInReportList() {
|
||||
if (!this.analyticsreportlist.isReportsEmpty()) {
|
||||
this.analyticsreportlist.selectReport(this.analyticsreportlist.reports[0]);
|
||||
}
|
||||
}
|
||||
|
||||
navigateStartProcess() {
|
||||
|
@ -178,9 +178,11 @@ platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
|
||||
#### Options
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `layoutType` | {string} | required | Define the layout of the apps. There are two possible values: GRID or LIST. LIST is the default value|
|
||||
| Name | Type | Required | Default | Description |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `appId` | {string} | optional | | The application id |
|
||||
| `layoutType` | {string} | required | | Define the layout of the apps. There are two possible values: GRID or LIST. LIST is the default value|
|
||||
| `selectFirst` | {boolean} | optional | false | Change the value to true if you want select the first item in the list as default|
|
||||
|
||||
## Basic usage example Activiti Analytics
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user