Replace loadingFlag with isLoading (#2074)

This commit is contained in:
Maurizio Vitale
2017-07-11 22:02:41 +01:00
committed by Eugenio Romano
parent 61a81b3948
commit 689eb42f72
10 changed files with 28 additions and 48 deletions

View File

@@ -5,10 +5,10 @@
<div> <div>
<adf-datatable <adf-datatable
[data]="data" [data]="data"
[actions]="true" [actions]="true"
[loading]="isLoading()" [loading]="isLoading"
(showRowActionsMenu)="onShowRowActionsMenu($event)" (showRowActionsMenu)="onShowRowActionsMenu($event)"
(executeRowAction)="onExecuteRowAction($event)"> (executeRowAction)="onExecuteRowAction($event)">
<loading-content-template> <loading-content-template>

View File

@@ -61,7 +61,7 @@ export class ActivitiProcessInstanceVariables implements OnInit, OnChanges {
variableValue: string; variableValue: string;
variableScope: string; variableScope: string;
loadingFlag: boolean = true; isLoading: boolean = true;
/** /**
* Constructor * Constructor
@@ -146,16 +146,16 @@ export class ActivitiProcessInstanceVariables implements OnInit, OnChanges {
private getProcessInstanceVariables(processInstanceId: string) { private getProcessInstanceVariables(processInstanceId: string) {
if (processInstanceId) { if (processInstanceId) {
this.loadingFlag = true; this.isLoading = true;
this.activitiProcess.getProcessInstanceVariables(processInstanceId).subscribe( this.activitiProcess.getProcessInstanceVariables(processInstanceId).subscribe(
(res: ProcessInstanceVariable[]) => { (res: ProcessInstanceVariable[]) => {
let instancesRow = this.createDataRow(res); let instancesRow = this.createDataRow(res);
this.renderInstances(instancesRow); this.renderInstances(instancesRow);
this.loadingFlag = false; this.isLoading = false;
}, },
(err) => { (err) => {
this.error.emit(err); this.error.emit(err);
this.loadingFlag = false; this.isLoading = false;
} }
); );
} else { } else {
@@ -275,8 +275,4 @@ export class ActivitiProcessInstanceVariables implements OnInit, OnChanges {
{ id: 'edit', title: 'Edit' } { id: 'edit', title: 'Edit' }
]; ];
} }
isLoading() {
return this.loadingFlag;
}
} }

View File

@@ -3,7 +3,7 @@
<div> <div>
<adf-datatable <adf-datatable
[data]="data" [data]="data"
[loading]="isLoading()" [loading]="isLoading"
(rowClick)="onRowClick($event)"> (rowClick)="onRowClick($event)">
<loading-content-template> <loading-content-template>
<ng-template> <ng-template>

View File

@@ -62,7 +62,7 @@ export class ActivitiProcessInstanceListComponent implements OnChanges, AfterCon
onError: EventEmitter<any> = new EventEmitter<any>(); onError: EventEmitter<any> = new EventEmitter<any>();
currentInstanceId: string; currentInstanceId: string;
loadingFlag: boolean = true; isLoading: boolean = true;
private defaultSchema: DataColumn[] = [ private defaultSchema: DataColumn[] = [
{ type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true }, { type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true },
@@ -141,7 +141,7 @@ export class ActivitiProcessInstanceListComponent implements OnChanges, AfterCon
} }
private load(requestNode: ProcessFilterRequestRepresentation) { private load(requestNode: ProcessFilterRequestRepresentation) {
this.loadingFlag = true; this.isLoading = true;
this.processService.getProcessInstances(requestNode) this.processService.getProcessInstances(requestNode)
.subscribe( .subscribe(
(response) => { (response) => {
@@ -149,11 +149,11 @@ export class ActivitiProcessInstanceListComponent implements OnChanges, AfterCon
this.renderInstances(instancesRow); this.renderInstances(instancesRow);
this.selectFirst(); this.selectFirst();
this.onSuccess.emit(response); this.onSuccess.emit(response);
this.loadingFlag = false; this.isLoading = false;
}, },
error => { error => {
this.onError.emit(error); this.onError.emit(error);
this.loadingFlag = false; this.isLoading = false;
}); });
} }
@@ -279,8 +279,4 @@ export class ActivitiProcessInstanceListComponent implements OnChanges, AfterCon
}; };
return new ProcessFilterRequestRepresentation(requestNode); return new ProcessFilterRequestRepresentation(requestNode);
} }
isLoading() {
return this.loadingFlag;
}
} }

View File

@@ -1,7 +1,7 @@
<adf-datatable <adf-datatable
[rows]="attachments" [rows]="attachments"
[actions]="true" [actions]="true"
[loading]="isLoading()" [loading]="isLoading"
(rowDblClick)="openContent($event)" (rowDblClick)="openContent($event)"
(showRowActionsMenu)="onShowRowActionsMenu($event)" (showRowActionsMenu)="onShowRowActionsMenu($event)"
(executeRowAction)="onExecuteRowAction($event)"> (executeRowAction)="onExecuteRowAction($event)">

View File

@@ -39,7 +39,7 @@ export class ActivitiProcessAttachmentListComponent implements OnChanges {
error: EventEmitter<any> = new EventEmitter<any>(); error: EventEmitter<any> = new EventEmitter<any>();
attachments: any[] = []; attachments: any[] = [];
loadingFlag: boolean = true; isLoading: boolean = true;
constructor(private translateService: AlfrescoTranslationService, constructor(private translateService: AlfrescoTranslationService,
private activitiContentService: ActivitiContentService, private activitiContentService: ActivitiContentService,
@@ -78,7 +78,7 @@ export class ActivitiProcessAttachmentListComponent implements OnChanges {
private loadAttachmentsByProcessInstanceId(processInstanceId: string) { private loadAttachmentsByProcessInstanceId(processInstanceId: string) {
if (processInstanceId) { if (processInstanceId) {
this.reset(); this.reset();
this.loadingFlag = true; this.isLoading = true;
this.activitiContentService.getProcessRelatedContent(processInstanceId).subscribe( this.activitiContentService.getProcessRelatedContent(processInstanceId).subscribe(
(res: any) => { (res: any) => {
res.data.forEach(content => { res.data.forEach(content => {
@@ -91,11 +91,11 @@ export class ActivitiProcessAttachmentListComponent implements OnChanges {
}); });
}); });
this.success.emit(this.attachments); this.success.emit(this.attachments);
this.loadingFlag = false; this.isLoading = false;
}, },
(err) => { (err) => {
this.error.emit(err); this.error.emit(err);
this.loadingFlag = false; this.isLoading = false;
}); });
} }
} }
@@ -178,8 +178,4 @@ export class ActivitiProcessAttachmentListComponent implements OnChanges {
} }
); );
} }
isLoading() {
return this.loadingFlag;
}
} }

View File

@@ -3,7 +3,7 @@
<div> <div>
<adf-datatable <adf-datatable
[data]="data" [data]="data"
[loading]="isLoading()" [loading]="isLoading"
(rowClick)="onRowClick($event)"> (rowClick)="onRowClick($event)">
<loading-content-template> <loading-content-template>
<ng-template> <ng-template>

View File

@@ -82,7 +82,7 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit {
currentInstanceId: string; currentInstanceId: string;
loadingFlag: boolean = true; isLoading: boolean = true;
/** /**
* Toggles custom data source mode. * Toggles custom data source mode.
@@ -182,7 +182,7 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit {
} }
private load(requestNode: TaskQueryRequestRepresentationModel) { private load(requestNode: TaskQueryRequestRepresentationModel) {
this.loadingFlag = true; this.isLoading = true;
this.taskListService.getTotalTasks(requestNode).subscribe( this.taskListService.getTotalTasks(requestNode).subscribe(
(res) => { (res) => {
requestNode.size = res.total; requestNode.size = res.total;
@@ -192,14 +192,14 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit {
this.renderInstances(instancesRow); this.renderInstances(instancesRow);
this.selectTask(requestNode.landingTaskId); this.selectTask(requestNode.landingTaskId);
this.onSuccess.emit(response); this.onSuccess.emit(response);
this.loadingFlag = false; this.isLoading = false;
}, (error) => { }, (error) => {
this.onError.emit(error); this.onError.emit(error);
this.loadingFlag = false; this.isLoading = false;
}); });
}, (err) => { }, (err) => {
this.onError.emit(err); this.onError.emit(err);
this.loadingFlag = false; this.isLoading = false;
}); });
} }
@@ -306,8 +306,4 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit {
}; };
return new TaskQueryRequestRepresentationModel(requestNode); return new TaskQueryRequestRepresentationModel(requestNode);
} }
isLoading() {
return this.loadingFlag;
}
} }

View File

@@ -1,7 +1,7 @@
<adf-datatable <adf-datatable
[rows]="attachments" [rows]="attachments"
[actions]="true" [actions]="true"
[loading]="isLoading()" [loading]="isLoading"
(rowDblClick)="openContent($event)" (rowDblClick)="openContent($event)"
(showRowActionsMenu)="onShowRowActionsMenu($event)" (showRowActionsMenu)="onShowRowActionsMenu($event)"
(executeRowAction)="onExecuteRowAction($event)"> (executeRowAction)="onExecuteRowAction($event)">

View File

@@ -39,7 +39,7 @@ export class TaskAttachmentListComponent implements OnChanges {
error: EventEmitter<any> = new EventEmitter<any>(); error: EventEmitter<any> = new EventEmitter<any>();
attachments: any[] = []; attachments: any[] = [];
loadingFlag: boolean = true; isLoading: boolean = true;
constructor(private translateService: AlfrescoTranslationService, constructor(private translateService: AlfrescoTranslationService,
private activitiContentService: ActivitiContentService, private activitiContentService: ActivitiContentService,
@@ -77,7 +77,7 @@ export class TaskAttachmentListComponent implements OnChanges {
private loadAttachmentsByTaskId(taskId: string) { private loadAttachmentsByTaskId(taskId: string) {
if (taskId) { if (taskId) {
this.loadingFlag = true; this.isLoading = true;
this.reset(); this.reset();
this.activitiContentService.getTaskRelatedContent(taskId).subscribe( this.activitiContentService.getTaskRelatedContent(taskId).subscribe(
(res: any) => { (res: any) => {
@@ -93,11 +93,11 @@ export class TaskAttachmentListComponent implements OnChanges {
}); });
this.attachments = attachList; this.attachments = attachList;
this.success.emit(this.attachments); this.success.emit(this.attachments);
this.loadingFlag = false; this.isLoading = false;
}, },
(err) => { (err) => {
this.error.emit(err); this.error.emit(err);
this.loadingFlag = false; this.isLoading = false;
}); });
} }
} }
@@ -180,8 +180,4 @@ export class TaskAttachmentListComponent implements OnChanges {
} }
); );
} }
isLoading() {
return this.loadingFlag;
}
} }