mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-523] Fix delete operation in the search component (#2020)
* Search delete permission notification fix * Support content deletion inside search results * Forgotten broken test fix. * Update alfresco-document-list READDME.md * Update alfresco-document-list READDME.md II * Adding TOC to README.md * Build fix * Fix the build for now and ever!
This commit is contained in:
committed by
Eugenio Romano
parent
87c1921034
commit
7cbefb1355
@@ -18,7 +18,8 @@
|
||||
import { Component, EventEmitter, Input, Output, Optional, OnChanges, SimpleChanges, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { AlfrescoSearchService, SearchOptions } from './../services/alfresco-search.service';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { AlfrescoTranslationService, NotificationService } from 'ng2-alfresco-core';
|
||||
import { PermissionModel } from 'ng2-alfresco-documentlist';
|
||||
import { NodePaging, Pagination } from 'alfresco-js-api';
|
||||
|
||||
@Component({
|
||||
@@ -66,6 +67,7 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit {
|
||||
|
||||
constructor(private searchService: AlfrescoSearchService,
|
||||
private translateService: AlfrescoTranslationService,
|
||||
private notificationService: NotificationService,
|
||||
@Optional() private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
@@ -107,7 +109,7 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit {
|
||||
private displaySearchResults(searchTerm) {
|
||||
if (searchTerm && this.searchService) {
|
||||
let searchOpts: SearchOptions = {
|
||||
include: ['path'],
|
||||
include: ['path', 'allowableOperations'],
|
||||
skipCount: this.skipCount,
|
||||
rootNodeId: this.rootNodeId,
|
||||
nodeType: this.resultType,
|
||||
@@ -147,4 +149,13 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit {
|
||||
this.skipCount = event.skipCount;
|
||||
this.displaySearchResults(this.searchTerm);
|
||||
}
|
||||
|
||||
public onContentDelete(entry: any) {
|
||||
this.displaySearchResults(this.searchTerm);
|
||||
}
|
||||
|
||||
public handlePermission(permission: PermissionModel): void {
|
||||
let permissionErrorMessage: any = this.translateService.get('PERMISSON.LACKOF', permission);
|
||||
this.notificationService.openSnackMessage(permissionErrorMessage.value, 3000);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user