[ADF-1958] Process Attachment list - The empty list should be a simpl… (#2798)

* [ADF-1958] Process Attachment list - The empty list should be a simple template

* changed the default empty list to a simple template

* changed process-attachment.component.html so that the user can pass custom empty tempate

* [ADF-1958] Process Attachment list - The empty list should be a simple template

* changed the default empty list to a simple template

* changed process-attachment.component.html so that the user can pass custom empty tempate

* removed some unused variables

* [ADF-1958] Process Attachment list - The empty list should be a simple template

* changed the default empty list to a simple template

* changed process-attachment.component.html so that the user can pass custom empty tempate
This commit is contained in:
madhukar23
2018-01-04 00:39:11 +05:30
committed by Maurizio Vitale
parent 771cea1f11
commit 77822b8494
8 changed files with 139 additions and 50 deletions

View File

@@ -15,16 +15,20 @@
* limitations under the License.
*/
import { ContentService, ThumbnailService } from '@alfresco/adf-core';
import { Component, EventEmitter, Input, NgZone, OnChanges, Output, SimpleChanges } from '@angular/core';
import { ContentService, EmptyListComponent , ThumbnailService } from '@alfresco/adf-core';
import { AfterContentInit, ContentChild, Component, EventEmitter, Input, NgZone, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { ProcessContentService } from '@alfresco/adf-core';
@Component({
selector: 'adf-process-attachment-list',
styleUrls: ['./process-attachment-list.component.scss'],
templateUrl: './process-attachment-list.component.html'
templateUrl: './process-attachment-list.component.html',
encapsulation: ViewEncapsulation.None
})
export class ProcessAttachmentListComponent implements OnChanges {
export class ProcessAttachmentListComponent implements OnChanges, AfterContentInit {
@ContentChild(EmptyListComponent)
emptyTemplate: EmptyListComponent;
@Input()
processInstanceId: string;
@@ -41,8 +45,7 @@ export class ProcessAttachmentListComponent implements OnChanges {
@Output()
error: EventEmitter<any> = new EventEmitter<any>();
@Input()
emptyListImageUrl: string = './assets/images/empty_doc_lib.svg';
hasCustomTemplate: boolean = false;
attachments: any[] = [];
isLoading: boolean = true;
@@ -59,6 +62,12 @@ export class ProcessAttachmentListComponent implements OnChanges {
}
}
ngAfterContentInit() {
if (this.emptyTemplate) {
this.hasCustomTemplate = true;
}
}
reset() {
this.attachments = [];
}
@@ -69,6 +78,10 @@ export class ProcessAttachmentListComponent implements OnChanges {
});
}
hasCutomEmptyTemplate() {
return !!this.emptyTemplate;
}
add(content: any): void {
this.ngZone.run(() => {
this.attachments.push({