[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

@@ -58,13 +58,11 @@ describe('FilesComponent', () => {
let fixture;
let component: FilesComponent;
let contentManagementService: ContentManagementService;
let alfrescoContentService: ContentService;
let uploadService: UploadService;
let nodesApi: NodesApiService;
let router: Router;
let browsingFilesService: BrowsingFilesService;
let nodeActionsService: NodeActionsService;
let notificationService: NotificationService;
beforeEach(async(() => {
TestBed.configureTestingModule({
@@ -122,9 +120,7 @@ describe('FilesComponent', () => {
uploadService = TestBed.get(UploadService);
nodesApi = TestBed.get(NodesApiService);
router = TestBed.get(Router);
alfrescoContentService = TestBed.get(ContentService);
browsingFilesService = TestBed.get(BrowsingFilesService);
notificationService = TestBed.get(NotificationService);
nodeActionsService = TestBed.get(NodeActionsService);
});
}));
@@ -243,31 +239,31 @@ describe('FilesComponent', () => {
});
it('should call refresh onCreateFolder event', () => {
alfrescoContentService.folderCreate.next();
contentManagementService.folderCreated.next();
expect(component.documentList.reload).toHaveBeenCalled();
});
it('should call refresh editFolder event', () => {
alfrescoContentService.folderEdit.next();
contentManagementService.folderEdited.next();
expect(component.documentList.reload).toHaveBeenCalled();
});
it('should call refresh deleteNode event', () => {
contentManagementService.nodeDeleted.next();
contentManagementService.nodesDeleted.next();
expect(component.documentList.reload).toHaveBeenCalled();
});
it('should call refresh moveNode event', () => {
contentManagementService.nodeMoved.next();
contentManagementService.nodesMoved.next();
expect(component.documentList.reload).toHaveBeenCalled();
});
it('should call refresh restoreNode event', () => {
contentManagementService.nodeRestored.next();
contentManagementService.nodesRestored.next();
expect(component.documentList.reload).toHaveBeenCalled();
});
@@ -453,16 +449,4 @@ describe('FilesComponent', () => {
expect(component.isSiteContainer(mock)).toBe(true);
});
});
describe('openSnackMessage', () => {
it('should call notification service', () => {
const message = 'notification message';
spyOn(notificationService, 'openSnackMessage');
component.openSnackMessage(message);
expect(notificationService.openSnackMessage).toHaveBeenCalledWith(message, 4000);
});
});
});