-
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'TASK_LIST.MESSAGES.NONE' | translate }}
+
+
+
-
- {{ 'TASK_LIST.MESSAGES.NONE' | translate }}
-
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.spec.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.spec.ts
index 3a31825308..3f4610638c 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.spec.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.spec.ts
@@ -17,6 +17,7 @@
import { SimpleChange } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { MdProgressSpinnerModule } from '@angular/material';
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
import { DataTableModule } from 'ng2-alfresco-datatable';
import { DataRowEvent, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
@@ -87,7 +88,8 @@ describe('ActivitiTaskList', () => {
TestBed.configureTestingModule({
imports: [
CoreModule.forRoot(),
- DataTableModule
+ DataTableModule,
+ MdProgressSpinnerModule
],
declarations: [
ActivitiTaskList
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts
index 51e889e539..cc68b39373 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.component.ts
@@ -82,6 +82,8 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit {
currentInstanceId: string;
+ loadingFlag: boolean = true;
+
/**
* Toggles custom data source mode.
* When enabled the component reloads data from it's current source instead of the server side.
@@ -180,6 +182,7 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit {
}
private load(requestNode: TaskQueryRequestRepresentationModel) {
+ this.loadingFlag = true;
this.taskListService.getTotalTasks(requestNode).subscribe(
(res) => {
requestNode.size = res.total;
@@ -189,11 +192,14 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit {
this.renderInstances(instancesRow);
this.selectTask(requestNode.landingTaskId);
this.onSuccess.emit(response);
+ this.loadingFlag = false;
}, (error) => {
this.onError.emit(error);
+ this.loadingFlag = false;
});
}, (err) => {
this.onError.emit(err);
+ this.loadingFlag = false;
});
}
@@ -300,4 +306,8 @@ export class ActivitiTaskList implements OnChanges, AfterContentInit {
};
return new TaskQueryRequestRepresentationModel(requestNode);
}
+
+ isLoading() {
+ return this.loadingFlag;
+ }
}
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.css b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.css
index 908e599c81..88e06d2740 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.css
+++ b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.css
@@ -1,17 +1,13 @@
-alfresco-datatable >>> .column-header {
+adf-datatable >>> .column-header {
color: #232323;
font-size: 15px;
}
-alfresco-datatable >>> .data-cell {
+adf-datatable >>> .data-cell {
cursor: pointer !important;
}
-.no-attachment-message {
- border: 1px solid rgb(224, 224, 224);
- background: #fff;
- text-align: left;
- border-top: none;
- padding: 10px;
- text-align: center;
+.adf-attachment-list-loading-margin {
+ margin-left: calc((100% - 100px) / 2);
+ margin-right: calc((100% - 100px) / 2);
}
\ No newline at end of file
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.html b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.html
index 505b36183c..7ce9ce48ae 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.html
+++ b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.html
@@ -1,6 +1,7 @@
@@ -10,4 +11,14 @@
+
+
+
+
+
+
+
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.spec.ts b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.spec.ts
index db00745c06..3207c54747 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.spec.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.spec.ts
@@ -17,6 +17,7 @@
import { SimpleChange } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { MdProgressSpinnerModule } from '@angular/material';
import { By } from '@angular/platform-browser';
import { TranslateService } from '@ngx-translate/core';
import { ActivitiContentService } from 'ng2-activiti-form';
@@ -42,7 +43,8 @@ describe('TaskAttachmentList', () => {
TestBed.configureTestingModule({
imports: [
CoreModule.forRoot(),
- DataTableModule.forRoot()
+ DataTableModule.forRoot(),
+ MdProgressSpinnerModule
],
declarations: [
TaskAttachmentListComponent
@@ -163,14 +165,15 @@ describe('TaskAttachmentList', () => {
}));
it('should show the empty list component when the attachments list is empty', async(() => {
- component.taskId = '123';
getTaskRelatedContentSpy.and.returnValue(Observable.of({
'size': 0,
'total': 0,
'start': 0,
'data': []
}));
- fixture.detectChanges();
+ let change = new SimpleChange(null, '123', true);
+ component.ngOnChanges({'taskId': change});
+
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(fixture.nativeElement.querySelector('adf-empty-list .empty-list__this-space-is-empty').innerHTML).toEqual('ADF-DATATABLE.EMPTY.HEADER');
@@ -184,7 +187,6 @@ describe('TaskAttachmentList', () => {
beforeEach(async(() => {
component.taskId = '123';
- fixture.detectChanges();
fixture.whenStable().then(() => {
getTaskRelatedContentSpy.calls.reset();
});
@@ -210,7 +212,6 @@ describe('TaskAttachmentList', () => {
beforeEach(async(() => {
component.taskId = '123';
- fixture.detectChanges();
fixture.whenStable();
}));
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.ts
index ebb6961688..78930a9033 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/adf-task-attachment-list.component.ts
@@ -39,6 +39,7 @@ export class TaskAttachmentListComponent implements OnChanges {
error: EventEmitter
= new EventEmitter();
attachments: any[] = [];
+ loadingFlag: boolean = true;
constructor(private translateService: AlfrescoTranslationService,
private activitiContentService: ActivitiContentService,
@@ -76,6 +77,8 @@ export class TaskAttachmentListComponent implements OnChanges {
private loadAttachmentsByTaskId(taskId: string) {
if (taskId) {
+ this.loadingFlag = true;
+ this.reset();
this.activitiContentService.getTaskRelatedContent(taskId).subscribe(
(res: any) => {
let attachList = [];
@@ -90,9 +93,11 @@ export class TaskAttachmentListComponent implements OnChanges {
});
this.attachments = attachList;
this.success.emit(this.attachments);
+ this.loadingFlag = false;
},
(err) => {
this.error.emit(err);
+ this.loadingFlag = false;
});
}
}
@@ -175,4 +180,8 @@ export class TaskAttachmentListComponent implements OnChanges {
}
);
}
+
+ isLoading() {
+ return this.loadingFlag;
+ }
}