mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Mario Romano
parent
a8024bbdf5
commit
e93a771366
@@ -137,6 +137,8 @@
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.COPY' | translate}}"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="copy">
|
||||
</content-action>
|
||||
<content-action
|
||||
@@ -145,6 +147,8 @@
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.MOVE' | translate}}"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="move">
|
||||
</content-action>
|
||||
<content-action
|
||||
@@ -163,6 +167,8 @@
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.COPY' | translate}}"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="copy">
|
||||
</content-action>
|
||||
<content-action
|
||||
@@ -171,6 +177,8 @@
|
||||
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.MOVE' | translate}}"
|
||||
permission="update"
|
||||
[disableWithNoPermission]="true"
|
||||
(error)="onContentActionError($event)"
|
||||
(success)="onContentActionSuccess($event)"
|
||||
handler="move">
|
||||
</content-action>
|
||||
<content-action
|
||||
|
@@ -20,7 +20,7 @@ import { MdDialog } from '@angular/material';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import {
|
||||
AlfrescoApiService, AlfrescoContentService, FileUploadCompleteEvent,
|
||||
AlfrescoApiService, AlfrescoContentService, AlfrescoTranslationService, FileUploadCompleteEvent,
|
||||
FolderCreatedEvent, NotificationService, SiteModel, UploadService
|
||||
} from 'ng2-alfresco-core';
|
||||
import { DocumentListComponent, PermissionStyleModel } from 'ng2-alfresco-documentlist';
|
||||
@@ -89,6 +89,7 @@ export class FilesComponent implements OnInit {
|
||||
private uploadService: UploadService,
|
||||
private contentService: AlfrescoContentService,
|
||||
private dialog: MdDialog,
|
||||
private translateService: AlfrescoTranslationService,
|
||||
@Optional() private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
@@ -155,6 +156,29 @@ export class FilesComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
onContentActionError(errors) {
|
||||
const errorStatusCode = JSON.parse(errors.message).error.statusCode;
|
||||
let translatedErrorMessage: any;
|
||||
|
||||
switch (errorStatusCode) {
|
||||
case 403:
|
||||
translatedErrorMessage = this.translateService.get('OPERATION.ERROR.PERMISSION');
|
||||
break;
|
||||
case 409:
|
||||
translatedErrorMessage = this.translateService.get('OPERATION.ERROR.CONFLICT');
|
||||
break;
|
||||
default:
|
||||
translatedErrorMessage = this.translateService.get('OPERATION.ERROR.UNKNOWN');
|
||||
}
|
||||
|
||||
this.notificationService.openSnackMessage(translatedErrorMessage.value, 4000);
|
||||
}
|
||||
|
||||
onContentActionSuccess(message) {
|
||||
let translatedMessage: any = this.translateService.get(message);
|
||||
this.notificationService.openSnackMessage(translatedMessage.value, 4000);
|
||||
}
|
||||
|
||||
onCreateFolderClicked(event: Event) {
|
||||
let dialogRef = this.dialog.open(CreateFolderDialogComponent);
|
||||
dialogRef.afterClosed().subscribe(folderName => {
|
||||
|
Reference in New Issue
Block a user