diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.css b/demo-shell-ng2/app/components/activiti/activiti-demo.component.css
index 771705f19e..405cbb56f3 100644
--- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.css
+++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.css
@@ -24,3 +24,17 @@
text-align: left;
margin-bottom: 5px;
}
+
+.adf-no-form-container {
+ text-align: center;
+ font-weight: 600;
+ font-size: 18px;
+ font-family: Muli;
+ padding: 16px;
+}
+
+.action-header {
+ border: 1px solid rgb(224, 224, 224);
+ background: #fff;
+ text-align: left;
+}
diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.html b/demo-shell-ng2/app/components/activiti/activiti-demo.component.html
index 06ac847d31..d1270b6feb 100644
--- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.html
+++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.html
@@ -73,10 +73,25 @@
Attachments
-
-
+
diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts
index e8f1fe1afc..d314bf0428 100644
--- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts
+++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts
@@ -21,7 +21,8 @@ import {
ActivitiFilters,
ActivitiTaskList,
FilterRepresentationModel,
- TaskDetailsEvent
+ TaskDetailsEvent,
+ TaskAttachmentListComponent
} from 'ng2-activiti-tasklist';
import {
ActivitiProcessFilters,
@@ -60,6 +61,9 @@ export class ActivitiDemoComponent implements AfterViewInit {
@ViewChild(ActivitiTaskList)
taskList: ActivitiTaskList;
+ @ViewChild(TaskAttachmentListComponent)
+ taskAttachList: TaskAttachmentListComponent;
+
@ViewChild(ActivitiProcessFilters)
activitiprocessfilter: ActivitiProcessFilters;
@@ -100,6 +104,7 @@ export class ActivitiDemoComponent implements AfterViewInit {
sub: Subscription;
blobFile: any;
flag: boolean = true;
+ createTaskAttach: boolean = false;
dataTasks: ObjectDataTableAdapter;
dataProcesses: ObjectDataTableAdapter;
@@ -157,15 +162,15 @@ export class ActivitiDemoComponent implements AfterViewInit {
this.sub.unsubscribe();
}
- onTaskFilterClick(filter: FilterRepresentationModel) {
+ onTaskFilterClick(filter: FilterRepresentationModel): void {
this.applyTaskFilter(filter);
}
- onReportClick(event: any) {
+ onReportClick(event: any): void {
this.report = event;
}
- onSuccessTaskFilterList(event: any) {
+ onSuccessTaskFilterList(event: any): void {
this.applyTaskFilter(this.activitifilter.getCurrentFilter());
}
@@ -176,7 +181,7 @@ export class ActivitiDemoComponent implements AfterViewInit {
}
}
- onStartTaskSuccess(event: any) {
+ onStartTaskSuccess(event: any): void {
this.activitifilter.selectFilterWithTask(event.id);
this.currentTaskId = event.id;
}
@@ -185,88 +190,88 @@ export class ActivitiDemoComponent implements AfterViewInit {
this.currentTaskId = this.taskList.getCurrentId();
}
- onProcessFilterClick(event: FilterProcessRepresentationModel) {
+ onProcessFilterClick(event: FilterProcessRepresentationModel): void {
this.currentProcessInstanceId = null;
this.processFilter = event;
}
- onSuccessProcessFilterList() {
+ onSuccessProcessFilterList(): void {
this.processFilter = this.activitiprocessfilter.getCurrentFilter();
}
- onSuccessProcessList(event: any) {
+ onSuccessProcessList(event: any): void {
this.currentProcessInstanceId = this.processList.getCurrentId();
}
- onTaskRowClick(taskId) {
+ onTaskRowClick(taskId): void {
this.currentTaskId = taskId;
}
- onProcessRowClick(processInstanceId) {
+ onProcessRowClick(processInstanceId): void {
this.currentProcessInstanceId = processInstanceId;
}
- onEditReport(name: string) {
+ onEditReport(name: string): void {
this.analyticsreportlist.reload();
}
- onReportSaved(reportId) {
+ onReportSaved(reportId): void {
this.analyticsreportlist.reload(reportId);
}
- onReportDeleted() {
+ onReportDeleted(): void {
this.analyticsreportlist.reload();
this.analyticsreportlist.selectReport(null);
}
- navigateStartProcess() {
+ navigateStartProcess(): void {
this.resetProcessFilters();
this.reloadProcessFilters();
this.currentProcessInstanceId = currentProcessIdNew;
}
- onStartProcessInstance(instance: ProcessInstance) {
+ onStartProcessInstance(instance: ProcessInstance): void {
this.currentProcessInstanceId = instance.id;
this.activitiStartProcess.reset();
this.resetProcessFilters();
}
- isStartProcessMode() {
+ isStartProcessMode(): boolean {
return this.currentProcessInstanceId === currentProcessIdNew;
}
- processCancelled(data: any) {
+ processCancelled(data: any): void {
this.currentProcessInstanceId = null;
this.processList.reload();
}
- onSuccessNewProcess(data: any) {
+ onSuccessNewProcess(data: any): void {
this.processList.reload();
}
- onFormCompleted(form) {
+ onFormCompleted(form): void {
this.taskList.reload();
this.currentTaskId = null;
}
- onFormContentClick(content: any) {
+ onFormContentClick(content: any): void {
this.fileShowed = true;
this.content = content.contentBlob;
this.contentName = content.name;
}
- onAttachmentClick(content: any) {
+ onAttachmentClick(content: any): void {
this.fileShowed = true;
this.content = content.contentBlob;
this.contentName = content.name;
}
- onTaskCreated(data: any) {
+ onTaskCreated(data: any): void {
this.currentTaskId = data.parentTaskId;
this.taskList.reload();
}
- onTaskDeleted(data: any) {
+ onTaskDeleted(data: any): void {
this.taskList.reload();
}
@@ -290,11 +295,11 @@ export class ActivitiDemoComponent implements AfterViewInit {
});
}
- onShowProcessDiagram(event: any) {
+ onShowProcessDiagram(event: any): void {
this.router.navigate(['/activiti/diagram/' + event.value]);
}
- onProcessDetailsTaskClick(event: TaskDetailsEvent) {
+ onProcessDetailsTaskClick(event: TaskDetailsEvent): void {
event.preventDefault();
this.activeTab = 'tasks';
@@ -310,20 +315,33 @@ export class ActivitiDemoComponent implements AfterViewInit {
this.currentTaskId = taskId;
}
- private resetProcessFilters() {
+ private resetProcessFilters(): void {
this.processFilter = null;
}
- private reloadProcessFilters() {
+ private reloadProcessFilters(): void {
this.activitiprocessfilter.selectFilter(null);
}
- onRowClick(event) {
+ onRowClick(event): void {
console.log(event);
}
- onRowDblClick(event) {
+ onRowDblClick(event): void {
console.log(event);
}
+ onCreateTaskSuccess(): void {
+ this.taskAttachList.reload();
+ this.toggleCreateTakAttach();
+ }
+
+ toggleCreateTakAttach(): void {
+ this.createTaskAttach = !this.createTaskAttach;
+ }
+
+ isCreateTaskAttachVisible(): boolean {
+ return this.createTaskAttach;
+ }
+
}
diff --git a/ng2-components/ng2-activiti-tasklist/README.md b/ng2-components/ng2-activiti-tasklist/README.md
index b9dd95d991..4f1a17d9ee 100644
--- a/ng2-components/ng2-activiti-tasklist/README.md
+++ b/ng2-components/ng2-activiti-tasklist/README.md
@@ -464,9 +464,9 @@ This component displays attached documents on a specified task
This component displays Upload Component(Drag and Click) to upload the attachment to a specified task
```html
-
+(success)="YOUR_CREATE_ATTACHMENT_SUCCESS_HANDLER">
```

diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.css b/ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.css
similarity index 100%
rename from ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.css
rename to ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.css
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.html b/ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.html
similarity index 50%
rename from ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.html
rename to ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.html
index e1d5f20345..97b00ef106 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.html
+++ b/ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.html
@@ -1,15 +1,15 @@
- Drop Files Here...
+ {{ 'TASK_DETAILS.BUTTON.DRAG-ATTACHMENT' | translate }}
-
\ No newline at end of file
+
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.spec.ts b/ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.spec.ts
similarity index 97%
rename from ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.spec.ts
rename to ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.spec.ts
index aca833d26e..5b9bbf1d78 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.spec.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.spec.ts
@@ -22,7 +22,7 @@ import { Observable } from 'rxjs/Rx';
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
import { ActivitiContentService } from 'ng2-activiti-form';
-import { ActivitiCreateTaskAttachmentComponent } from './activiti-create-task-attachment.component';
+import { ActivitiCreateTaskAttachmentComponent } from './adf-create-task-attachment.component';
describe('Activiti Task Create Attachment', () => {
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.ts
similarity index 91%
rename from ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.ts
rename to ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.ts
index 5160aea40a..72d8010380 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/adf-create-task-attachment.component.ts
@@ -20,9 +20,9 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core';
import { ActivitiContentService } from 'ng2-activiti-form';
@Component({
- selector: 'activiti-create-task-attachment',
- styleUrls: ['./activiti-create-task-attachment.component.css'],
- templateUrl: './activiti-create-task-attachment.component.html'
+ selector: 'adf-create-task-attachment',
+ styleUrls: ['./adf-create-task-attachment.component.css'],
+ templateUrl: './adf-create-task-attachment.component.html'
})
export class ActivitiCreateTaskAttachmentComponent implements OnChanges {
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 66f827cf35..0abe5fcf29 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
@@ -55,10 +55,14 @@ export class TaskAttachmentListComponent implements OnChanges {
}
}
- reset () {
+ reset(): void {
this.attachments = [];
}
+ reload(): void {
+ this.loadAttachmentsByTaskId(this.taskId);
+ }
+
private loadAttachmentsByTaskId(taskId: string) {
if (taskId) {
this.reset();
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/index.ts b/ng2-components/ng2-activiti-tasklist/src/components/index.ts
index ce820f1b0b..fcf5c34c79 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/index.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/index.ts
@@ -27,4 +27,4 @@ export * from './activiti-filters.component';
export * from './activiti-task-details.component';
export * from './activiti-start-task.component';
export * from './activiti-people-search.component';
-export * from './activiti-create-task-attachment.component';
+export * from './adf-create-task-attachment.component';
diff --git a/ng2-components/ng2-activiti-tasklist/src/i18n/en.json b/ng2-components/ng2-activiti-tasklist/src/i18n/en.json
index 87528d901e..f356102189 100644
--- a/ng2-components/ng2-activiti-tasklist/src/i18n/en.json
+++ b/ng2-components/ng2-activiti-tasklist/src/i18n/en.json
@@ -18,7 +18,9 @@
},
"BUTTON": {
"COMPLETE": "Complete",
- "CLAIM": "Claim"
+ "CLAIM": "Claim",
+ "DRAG-ATTACHMENT": "Drop Files Here...",
+ "UPLOAD-ATTACHMENT": "Upload Attachment"
},
"MESSAGES": {
"NONE": "No task details found.",