mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1711] The <adf-task-attachment-list component displays drag-and-drop area that is not working (#2658)
* [ADF-1711] The <adf-task-attachment-list component displays drag-and-drop area that is not working * Made the drag and drop area working in demo shell for task attachment * Provided a way to pass custom no content template for drag and drop to the user * Updated the task-attachment README file for the user to know how to use drag and drop component with task-attachment component * [ADF-1711] The <adf-task-attachment-list component displays drag-and-drop area that is not working * Made the drag and drop area working in demo shell for task attachment * Provided a way to pass custom no content template for drag and drop to the user * Updated the task-attachment README file for the user to know how to use drag and drop component with task-attachment component
This commit is contained in:
committed by
Eugenio Romano
parent
bf6d0284e0
commit
aa8b2a28f3
@@ -85,10 +85,20 @@
|
||||
</div>
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<adf-task-attachment-list
|
||||
[taskId]="currentTaskId"
|
||||
(attachmentClick)="onContentClick($event)">
|
||||
</adf-task-attachment-list>
|
||||
<adf-upload-drag-area
|
||||
[parentId]="currentTaskId"
|
||||
[showNotificationBar]="false">
|
||||
<adf-task-attachment-list #taskAttachList
|
||||
[taskId]="currentTaskId">
|
||||
<div adf-empty-list>
|
||||
<div adf-empty-list-header class="adf-empty-list-header"> {{'ADF_TASK_LIST.ATTACHMENT.EMPTY.HEADER' | translate}} </div>
|
||||
<div adf-empty-list-body>
|
||||
<div fxHide.lt-md="true" class="adf-empty-list-drag_drop">{{'ADF_TASK_LIST.ATTACHMENT.EMPTY.DRAG-AND-DROP.TITLE' | translate}}</div>
|
||||
<div fxHide.lt-md="true" class="adf-empty-list__any-files-here-to-add"> {{'ADF_TASK_LIST.ATTACHMENT.EMPTY.DRAG-AND-DROP.SUBTITLE' | translate}} </div>
|
||||
</div>
|
||||
</div>
|
||||
</adf-task-attachment-list>
|
||||
</adf-upload-drag-area>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
@@ -49,10 +49,12 @@ import {
|
||||
TaskDetailsEvent,
|
||||
TaskFiltersComponent,
|
||||
TaskListComponent,
|
||||
TaskListService
|
||||
TaskListService,
|
||||
TaskAttachmentListComponent,
|
||||
ProcessUploadService
|
||||
} from '@alfresco/adf-process-services';
|
||||
import { LogService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, UploadService } from '@alfresco/adf-core';
|
||||
import {
|
||||
DataSorting,
|
||||
ObjectDataRow,
|
||||
@@ -69,6 +71,9 @@ const currentTaskIdNew = '__NEW__';
|
||||
selector: 'adf-activiti',
|
||||
templateUrl: './activiti.component.html',
|
||||
styleUrls: ['./activiti.component.scss'],
|
||||
providers: [
|
||||
{ provide: UploadService, useClass: ProcessUploadService }
|
||||
],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ActivitiComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
@@ -79,6 +84,9 @@ export class ActivitiComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
@ViewChild(TaskListComponent)
|
||||
taskList: TaskListComponent;
|
||||
|
||||
@ViewChild(TaskAttachmentListComponent)
|
||||
taskAttachList: TaskAttachmentListComponent;
|
||||
|
||||
@ViewChild(ProcessFiltersComponent)
|
||||
activitiprocessfilter: ProcessFiltersComponent;
|
||||
|
||||
@@ -147,7 +155,8 @@ export class ActivitiComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
formRenderingService: FormRenderingService,
|
||||
formService: FormService) {
|
||||
formService: FormService,
|
||||
private uploadService: UploadService) {
|
||||
this.dataTasks = new ObjectDataTableAdapter();
|
||||
this.dataTasks.setSorting(new DataSorting('created', 'desc'));
|
||||
|
||||
@@ -247,6 +256,7 @@ export class ActivitiComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
this.currentProcessInstanceId = null;
|
||||
});
|
||||
this.layoutType = AppsListComponent.LAYOUT_GRID;
|
||||
this.uploadService.fileUploadComplete.subscribe(value => this.onTaskFileUploadComplete(value.data));
|
||||
|
||||
}
|
||||
|
||||
@@ -480,4 +490,8 @@ export class ActivitiComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
this.taskList.reload();
|
||||
this.currentTaskId = null;
|
||||
}
|
||||
|
||||
onTaskFileUploadComplete(content: any) {
|
||||
this.taskAttachList.add(content);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user