mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user