[ACA-1442] improved notifications and delete/restore (#393)

* remove notifications from files component

* remove notifications from favorites page

* remove irrelevant tests

* snackbar effects

* snackbar theme

* improve permanent delete messaging

* cleanup tests

* strongly typed node delete directive, node actions

* strongly-typed directives

* test fixes

* redux dev tools, migrate permanent delete directive

* reload trashcan on service events

* delete and restore nodes, snackbar effects with undo

* wire viewer with store and effects

* test fixes

* migrate events

* fix spelling

* bug fixes

* use notification effects on restore node

* remove fdescribe

* node-versions using snackbar actions

* dispatch snackbars from node-move directive

* store-enabled create folder

* reduce dependency on ContentService for list reloads

* favorites use unified preview api for files

* simplify preview for shared files

* remove test
This commit is contained in:
Denys Vuika
2018-06-11 06:33:37 +01:00
committed by GitHub
parent c6cae392e2
commit e34e9ee726
47 changed files with 1393 additions and 1164 deletions

View File

@@ -29,7 +29,7 @@ import { Router, ActivatedRoute, Params } from '@angular/router';
import { MinimalNodeEntity, MinimalNodeEntryEntity, PathElementEntity, NodePaging, PathElement } from 'alfresco-js-api';
import {
UploadService, FileUploadEvent, NodesApiService,
ContentService, AlfrescoApiService, UserPreferencesService, NotificationService
AlfrescoApiService, UserPreferencesService
} from '@alfresco/adf-core';
import { BrowsingFilesService } from '../../common/services/browsing-files.service';
@@ -58,9 +58,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
private uploadService: UploadService,
private contentManagementService: ContentManagementService,
private browsingFilesService: BrowsingFilesService,
private contentService: ContentService,
private apiService: AlfrescoApiService,
private notificationService: NotificationService,
public permission: NodePermissionService,
preferences: UserPreferencesService) {
super(preferences, router, route, store);
@@ -69,7 +67,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
ngOnInit() {
super.ngOnInit();
const { route, contentManagementService, contentService, nodeActionsService, uploadService } = this;
const { route, contentManagementService, nodeActionsService, uploadService } = this;
const { data } = route.snapshot;
this.title = data.title;
@@ -99,11 +97,11 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
this.subscriptions = this.subscriptions.concat([
nodeActionsService.contentCopied.subscribe((nodes) => this.onContentCopied(nodes)),
contentService.folderCreate.subscribe(() => this.documentList.reload()),
contentService.folderEdit.subscribe(() => this.documentList.reload()),
contentManagementService.nodeDeleted.subscribe(() => this.documentList.reload()),
contentManagementService.nodeMoved.subscribe(() => this.documentList.reload()),
contentManagementService.nodeRestored.subscribe(() => this.documentList.reload()),
contentManagementService.folderCreated.subscribe(() => this.documentList.reload()),
contentManagementService.folderEdited.subscribe(() => this.documentList.reload()),
contentManagementService.nodesDeleted.subscribe(() => this.documentList.reload()),
contentManagementService.nodesMoved.subscribe(() => this.documentList.reload()),
contentManagementService.nodesRestored.subscribe(() => this.documentList.reload()),
uploadService.fileUploadComplete.subscribe(file => this.onFileUploadedEvent(file)),
uploadService.fileUploadDeleted.subscribe((file) => this.onFileUploadedEvent(file))
]);
@@ -253,11 +251,4 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
}
return false;
}
openSnackMessage(event: any) {
this.notificationService.openSnackMessage(
event,
4000
);
}
}