[ADF-459] Copy & move further features (#2187)

* Adding current folder to list by default

* Fix documentlist component's rowFilter and imageResolver

* Adding rowfilter to not show the current node in the list

* Removing unpermitted nodes from the selectable ones (not visually)

* Restore documentlist original behaviour (rowFilter and imageResolver)

* Select event interface works with array from this point on

* Introducing the one and only, mighty Breadcrumb

* Breadcrumb position fix

* Extract hightlight transform functionality from highlight pipe

* Highlight part I.

* Showing breadcrumb with the new redesigned functionality

* Rebase fix

* Error and success callback for the new content actions

* Tests for HighlightDirective

* Update documentation

* Until proper pagination we use this temporary fix

* Fix node unselection on folder change

* Fix accessibility support in dropdown breadcrumb
This commit is contained in:
Popovics András
2017-08-08 16:41:20 +01:00
committed by Mario Romano
parent a8024bbdf5
commit e93a771366
24 changed files with 793 additions and 184 deletions

View File

@@ -17,7 +17,7 @@
import { Injectable } from '@angular/core';
import { MinimalNodeEntity } from 'alfresco-js-api';
import { AlfrescoContentService, AlfrescoTranslationService, NotificationService } from 'ng2-alfresco-core';
import { AlfrescoContentService } from 'ng2-alfresco-core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Rx';
import { ContentActionHandler } from '../models/content-action.model';
@@ -29,18 +29,15 @@ import { NodeActionsService } from './node-actions.service';
export class DocumentActionsService {
permissionEvent: Subject<PermissionModel> = new Subject<PermissionModel>();
error: Subject<Error> = new Subject<Error>();
success: Subject<string> = new Subject<string>();
private handlers: { [id: string]: ContentActionHandler; } = {};
constructor(private translateService: AlfrescoTranslationService,
private notificationService: NotificationService,
private nodeActionsService: NodeActionsService,
constructor(private nodeActionsService: NodeActionsService,
private documentListService?: DocumentListService,
private contentService?: AlfrescoContentService) {
this.setupActionHandlers();
if (translateService) {
translateService.addTranslationFolder('ng2-alfresco-documentlist', 'assets/ng2-alfresco-documentlist');
}
}
getHandler(key: string): ContentActionHandler {
@@ -99,25 +96,12 @@ export class DocumentActionsService {
private prepareHandlers(actionObservable, type: string, action: string, target?: any, permission?: string): void {
actionObservable.subscribe(
(fileOperationMessage) => {
this.notificationService.openSnackMessage(fileOperationMessage, 3000);
if (target && typeof target.reload === 'function') {
target.reload();
}
this.success.next(fileOperationMessage);
},
(errorStatusCode) => {
switch (errorStatusCode) {
case 403:
this.permissionEvent.next(new PermissionModel({type, action, permission}));
break;
case 409:
let conflictError: any = this.translateService.get('OPERATION.ERROR.CONFLICT');
this.notificationService.openSnackMessage(conflictError.value, 3000);
break;
default:
let unknownError: any = this.translateService.get('OPERATION.ERROR.UNKNOWN');
this.notificationService.openSnackMessage(unknownError.value, 3000);
}
}
this.error.next.bind(this.error)
);
}