diff --git a/src/app/common/common.module.ts b/src/app/common/common.module.ts
index 5e008c78c..45997390f 100644
--- a/src/app/common/common.module.ts
+++ b/src/app/common/common.module.ts
@@ -24,8 +24,6 @@ import { AdfModule } from '../adf.module';
import { MaterialModule } from './material.module';
import { FolderDialogComponent } from './dialogs/folder-dialog.component';
-
-import { FolderCreateDirective } from './directives/folder-create.directive';
import { FolderEditDirective } from './directives/folder-edit.directive';
import { NodeCopyDirective } from './directives/node-copy.directive';
import { NodeDeleteDirective } from './directives/node-delete.directive';
@@ -52,8 +50,6 @@ export function modules() {
export function declarations() {
return [
FolderDialogComponent,
-
- FolderCreateDirective,
FolderEditDirective,
NodeCopyDirective,
NodeDeleteDirective,
diff --git a/src/app/common/directives/folder-create.directive.spec.ts b/src/app/common/directives/folder-create.directive.spec.ts
deleted file mode 100644
index a77ef95da..000000000
--- a/src/app/common/directives/folder-create.directive.spec.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-/*!
- * @license
- * Copyright 2017 Alfresco Software, Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { TestBed, ComponentFixture } from '@angular/core/testing';
-import { By } from '@angular/platform-browser';
-import { Component } from '@angular/core';
-import { Observable } from 'rxjs/Rx';
-import { MatDialogModule, MatDialog } from '@angular/material';
-
-import { FolderCreateDirective } from './folder-create.directive';
-import { ContentManagementService } from '../services/content-management.service';
-
-@Component({
- template: '
'
-})
-class TestComponent {
- parentNode = '';
-}
-
-describe('FolderCreateDirective', () => {
- let fixture: ComponentFixture;
- let element;
- let node: any;
- let dialog: MatDialog;
- let contentService: ContentManagementService;
- let dialogRefMock;
-
- const event: any = {
- type: 'click',
- preventDefault: () => null
- };
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- imports: [ MatDialogModule ],
- declarations: [
- TestComponent,
- FolderCreateDirective
- ]
- ,
- providers: [
- ContentManagementService
- ]
- });
-
- fixture = TestBed.createComponent(TestComponent);
- element = fixture.debugElement.query(By.directive(FolderCreateDirective));
- dialog = TestBed.get(MatDialog);
- contentService = TestBed.get(ContentManagementService);
- });
-
- beforeEach(() => {
- node = { entry: { id: 'nodeId' } };
-
- dialogRefMock = {
- afterClosed: val => Observable.of(val)
- };
-
- spyOn(dialog, 'open').and.returnValue(dialogRefMock);
- });
-
- it('emits createFolder event when input value is not undefined', () => {
- spyOn(dialogRefMock, 'afterClosed').and.returnValue(Observable.of(node));
-
- contentService.createFolder.subscribe((val) => {
- expect(val).toBe(node);
- });
-
- element.triggerEventHandler('click', event);
- fixture.detectChanges();
- });
-
- it('does not emits createFolder event when input value is undefined', () => {
- spyOn(dialogRefMock, 'afterClosed').and.returnValue(Observable.of(null));
- spyOn(contentService.createFolder, 'next');
-
- element.triggerEventHandler('click', event);
- fixture.detectChanges();
-
- expect(contentService.createFolder.next).not.toHaveBeenCalled();
- });
-});
diff --git a/src/app/common/directives/folder-create.directive.ts b/src/app/common/directives/folder-create.directive.ts
deleted file mode 100644
index 36d6a67f7..000000000
--- a/src/app/common/directives/folder-create.directive.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-/*!
- * @license
- * Copyright 2017 Alfresco Software, Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { Directive, HostListener, Input } from '@angular/core';
-import { MatDialog, MatDialogConfig } from '@angular/material';
-
-import { MinimalNodeEntryEntity } from 'alfresco-js-api';
-
-import { FolderDialogComponent } from '../dialogs/folder-dialog.component';
-import { ContentManagementService } from '../services/content-management.service';
-
-@Directive({
- selector: '[app-create-folder]'
-})
-export class FolderCreateDirective {
- static DIALOG_WIDTH: number = 400;
-
- @Input('app-create-folder')
- parentNodeId: string;
-
- @HostListener('click', [ '$event' ])
- onClick(event) {
- event.preventDefault();
- this.openDialog();
- }
-
- constructor(
- public dialogRef: MatDialog,
- public content: ContentManagementService
- ) {}
-
- private get dialogConfig(): MatDialogConfig {
- const { DIALOG_WIDTH: width } = FolderCreateDirective;
- const { parentNodeId } = this;
-
- return {
- data: { parentNodeId },
- width: `${width}px`
- };
- }
-
- private openDialog(): void {
- const { dialogRef, dialogConfig, content } = this;
- const dialogInstance = dialogRef.open(FolderDialogComponent, dialogConfig);
-
- dialogInstance.afterClosed().subscribe((node: MinimalNodeEntryEntity) => {
- if (node) {
- content.createFolder.next(node);
- }
- });
- }
-}
diff --git a/src/app/components/sidenav/sidenav.component.html b/src/app/components/sidenav/sidenav.component.html
index 43fdaa621..73973dbfd 100644
--- a/src/app/components/sidenav/sidenav.component.html
+++ b/src/app/components/sidenav/sidenav.component.html
@@ -8,8 +8,8 @@