[ADF-1458] wrongly named input attribute - renamed disabled into disable (#2270)

* [ADF-1458] wrongly named input attribute - renamed disabled into disable

* [ADF 1458] renamed disabled attribute in disable
This commit is contained in:
Vito
2017-09-01 13:39:09 -07:00
committed by Mario Romano
parent 893252dd7a
commit 1f66cf8c56
6 changed files with 24 additions and 24 deletions

View File

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

View File

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