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-… (#2716)
* [ADF-1711] The <adf-task-attachment-list component displays drag-and-drop area that is not working * fix test for remove upload deprecated properties * remove duplicate identifier
This commit is contained in:
committed by
Maurizio Vitale
parent
083f40192c
commit
dd7a6565e3
@@ -3,8 +3,7 @@
|
||||
<div class="adf-no-form-container">
|
||||
<adf-upload-drag-area
|
||||
[parentId]="processInstanceId"
|
||||
[disabled]="isCompletedProcess()"
|
||||
[showNotificationBar]="false">
|
||||
[disabled]="isCompletedProcess()">
|
||||
<adf-process-attachment-list #processAttachList
|
||||
*ngIf="processInstanceId"
|
||||
[disabled]="isCompletedProcess()"
|
||||
|
@@ -17,16 +17,13 @@
|
||||
|
||||
import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessInstance, ProcessService ,
|
||||
ProcessAttachmentListComponent, ProcessUploadService } from '@alfresco/adf-process-services';
|
||||
ProcessAttachmentListComponent } from '@alfresco/adf-process-services';
|
||||
import { UploadService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-process-attachments',
|
||||
templateUrl: './process-attachments.component.html',
|
||||
styleUrls: ['./process-attachments.component.css'],
|
||||
providers: [
|
||||
{provide: UploadService, useClass: ProcessUploadService}
|
||||
]
|
||||
styleUrls: ['./process-attachments.component.css']
|
||||
})
|
||||
|
||||
export class ProcessAttachmentsComponent implements OnInit, OnChanges {
|
||||
|
@@ -50,7 +50,6 @@ import {
|
||||
TaskFiltersComponent,
|
||||
TaskListComponent,
|
||||
TaskListService,
|
||||
TaskAttachmentListComponent,
|
||||
ProcessUploadService
|
||||
} from '@alfresco/adf-process-services';
|
||||
import { LogService } from '@alfresco/adf-core';
|
||||
@@ -72,8 +71,8 @@ const currentTaskIdNew = '__NEW__';
|
||||
templateUrl: './process-service.component.html',
|
||||
styleUrls: ['./process-service.component.scss'],
|
||||
providers: [
|
||||
{ provide: UploadService, useClass: ProcessUploadService }
|
||||
],
|
||||
{ provide: UploadService, useClass: ProcessUploadService }
|
||||
],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
@@ -84,9 +83,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
@ViewChild(TaskListComponent)
|
||||
taskList: TaskListComponent;
|
||||
|
||||
@ViewChild(TaskAttachmentListComponent)
|
||||
taskAttachList: TaskAttachmentListComponent;
|
||||
|
||||
@ViewChild(ProcessFiltersComponent)
|
||||
activitiprocessfilter: ProcessFiltersComponent;
|
||||
|
||||
@@ -155,8 +151,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
formRenderingService: FormRenderingService,
|
||||
formService: FormService,
|
||||
private uploadService: UploadService) {
|
||||
formService: FormService) {
|
||||
this.dataTasks = new ObjectDataTableAdapter();
|
||||
this.dataTasks.setSorting(new DataSorting('created', 'desc'));
|
||||
|
||||
@@ -256,8 +251,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.currentProcessInstanceId = null;
|
||||
});
|
||||
this.layoutType = AppsListComponent.LAYOUT_GRID;
|
||||
this.uploadService.fileUploadComplete.subscribe(value => this.onTaskFileUploadComplete(value.data));
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -378,10 +371,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.processList.reload();
|
||||
}
|
||||
|
||||
onSuccessNewProcess(data: any): void {
|
||||
this.processList.reload();
|
||||
}
|
||||
|
||||
onFormCompleted(form): void {
|
||||
this.currentTaskId = null;
|
||||
this.taskPagination.totalItems--;
|
||||
@@ -482,16 +471,9 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.logService.log(event);
|
||||
}
|
||||
|
||||
isTaskCompleted(): boolean {
|
||||
return this.activitidetails.isCompletedTask();
|
||||
}
|
||||
|
||||
onAssignTask() {
|
||||
this.taskList.reload();
|
||||
this.currentTaskId = null;
|
||||
}
|
||||
|
||||
onTaskFileUploadComplete(content: any) {
|
||||
this.taskAttachList.add(content);
|
||||
}
|
||||
}
|
||||
|
@@ -1,13 +1,12 @@
|
||||
<div id="attachment-task-list" *ngIf="taskId">
|
||||
<div class="adf-no-form-container">
|
||||
<adf-upload-drag-area
|
||||
[parentId]="currentTaskId"
|
||||
[showNotificationBar]="false">
|
||||
[parentId]="taskId">
|
||||
|
||||
<adf-task-attachment-list #taskAttachList
|
||||
[disabled]="isCompletedTask()"
|
||||
(attachmentClick)="onAttachmentClick($event)"
|
||||
[taskId]="currentTaskId">
|
||||
[taskId]="taskId">
|
||||
<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>
|
||||
|
@@ -16,26 +16,23 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessUploadService, TaskListService, TaskAttachmentListComponent } from '@alfresco/adf-process-services';
|
||||
import { TaskListService, TaskAttachmentListComponent } from '@alfresco/adf-process-services';
|
||||
import { UploadService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-attachments',
|
||||
templateUrl: './task-attachments.component.html',
|
||||
styleUrls: ['./task-attachments.component.css'],
|
||||
providers: [
|
||||
{ provide: UploadService, useClass: ProcessUploadService }
|
||||
]
|
||||
styleUrls: ['./task-attachments.component.css']
|
||||
})
|
||||
|
||||
export class TaskAttachmentsComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
||||
|
||||
@ViewChild(TaskAttachmentListComponent)
|
||||
taskAttachList: TaskAttachmentListComponent;
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
content: Blob;
|
||||
contentName: string;
|
||||
@@ -73,4 +70,5 @@ export class TaskAttachmentsComponent implements OnInit, OnChanges {
|
||||
isCompletedTask(): boolean {
|
||||
return this.taskDetails && this.taskDetails.endDate !== undefined && this.taskDetails.endDate !== null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user