[ADF-1458] revert changes applied for upload button (#2286)

* [ADF-1458] reverting changes from ADF-1458

* [ADF-1458] reapply default value to disabled

* [ADF-1458] revert changes on README

* [ADF-1458] update readme added more check for node permission checking

* [ADF-1458] reverting changes to tests

* [ADF-1458] revert changes for test directive
This commit is contained in:
Vito
2017-09-04 08:37:37 -07:00
committed by Mario Romano
parent 62e50e8fbf
commit 4e50c4e2d6
6 changed files with 23 additions and 23 deletions

View File

@@ -23,7 +23,7 @@ import { NodePermissionDirective, NodePermissionSubject } from './node-permissio
selector: 'adf-text-subject'
})
class TestComponent implements NodePermissionSubject {
disable: boolean = false;
disabled: boolean = false;
}
describe('NodePermissionDirective', () => {
@@ -126,13 +126,13 @@ describe('NodePermissionDirective', () => {
spyOn(contentService, 'hasPermission').and.returnValue(false);
let testComponent = new TestComponent();
testComponent.disable = false;
testComponent.disabled = false;
const directive = new NodePermissionDirective(null, null, contentService, testComponent);
directive.nodes = <any> [{}, {}];
directive.updateElement();
expect(testComponent.disable).toBeTruthy();
expect(testComponent.disabled).toBeTruthy();
});
it('enables decorated component', () => {
@@ -140,13 +140,13 @@ describe('NodePermissionDirective', () => {
spyOn(contentService, 'hasPermission').and.returnValue(true);
let testComponent = new TestComponent();
testComponent.disable = true;
testComponent.disabled = true;
const directive = new NodePermissionDirective(null, null, contentService, testComponent);
directive.nodes = <any> [{}, {}];
directive.updateElement();
expect(testComponent.disable).toBeFalsy();
expect(testComponent.disabled).toBeFalsy();
});
});
});

View File

@@ -21,7 +21,7 @@ import { EXTENDIBLE_COMPONENT } from './../interface/injection.tokens';
import { AlfrescoContentService } from './../services/alfresco-content.service';
export interface NodePermissionSubject {
disable: boolean;
disabled: boolean;
}
@Directive({
@@ -74,7 +74,7 @@ export class NodePermissionDirective implements OnChanges, AfterViewInit {
private enable(): void {
if (this.parentComponent) {
this.parentComponent.disable = false;
this.parentComponent.disabled = false;
} else {
this.enableElement();
}
@@ -82,7 +82,7 @@ export class NodePermissionDirective implements OnChanges, AfterViewInit {
private disable(): void {
if (this.parentComponent) {
this.parentComponent.disable = true;
this.parentComponent.disabled = true;
} else {
this.disableElement();
}