enable prefer-const rule for tslint, fix issues (#4409)

* enable prefer-const rule for tslint, fix issues

* Update content-node-selector.component.spec.ts

* Update content-node-selector.component.spec.ts

* fix const

* fix lint issues

* update tests

* update tests

* update tests

* fix code

* fix page class
This commit is contained in:
Denys Vuika
2019-03-25 12:19:33 +00:00
committed by Eugenio Romano
parent 26c5982a1a
commit a7a48e8b2b
581 changed files with 5435 additions and 5402 deletions

View File

@@ -120,7 +120,7 @@ describe('PermissionDisplayComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
let options: any = fixture.debugElement.queryAll(By.css('mat-option'));
const options: any = fixture.debugElement.queryAll(By.css('mat-option'));
expect(options).not.toBeNull();
expect(options.length).toBe(4);
expect(options[0].nativeElement.innerText).toContain('SiteCollaborator');
@@ -145,7 +145,7 @@ describe('PermissionDisplayComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
let options: any = fixture.debugElement.queryAll(By.css('mat-option'));
const options: any = fixture.debugElement.queryAll(By.css('mat-option'));
expect(options).not.toBeNull();
expect(options.length).toBe(5);
expect(options[0].nativeElement.innerText).toContain('Contributor');
@@ -178,7 +178,7 @@ describe('PermissionDisplayComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
let options: any = fixture.debugElement.queryAll(By.css('mat-option'));
const options: any = fixture.debugElement.queryAll(By.css('mat-option'));
expect(options).not.toBeNull();
expect(options.length).toBe(5);
options[3].triggerEventHandler('click', {});

View File

@@ -69,16 +69,16 @@ export class PermissionListComponent implements OnInit {
}
private getPermissionList(node: Node): PermissionDisplayModel[] {
let allPermissions: PermissionDisplayModel[] = [];
const allPermissions: PermissionDisplayModel[] = [];
if (node.permissions.locallySet) {
node.permissions.locallySet.map((permissionElement: PermissionElement) => {
let permission = new PermissionDisplayModel(permissionElement);
const permission = new PermissionDisplayModel(permissionElement);
allPermissions.push(permission);
});
}
if (node.permissions.inherited) {
node.permissions.inherited.map((permissionElement: PermissionElement) => {
let permissionInherited = new PermissionDisplayModel(permissionElement);
const permissionInherited = new PermissionDisplayModel(permissionElement);
permissionInherited.isInherited = true;
allPermissions.push(permissionInherited);
});
@@ -87,7 +87,7 @@ export class PermissionListComponent implements OnInit {
}
saveNewRole(event: any, permissionRow: PermissionDisplayModel) {
let updatedPermissionRole: PermissionElement = this.buildUpdatedPermission(event.value, permissionRow);
const updatedPermissionRole: PermissionElement = this.buildUpdatedPermission(event.value, permissionRow);
this.nodePermissionService.updatePermissionRole(this.actualNode, updatedPermissionRole)
.subscribe((node: Node) => {
this.update.emit(updatedPermissionRole);
@@ -95,7 +95,7 @@ export class PermissionListComponent implements OnInit {
}
private buildUpdatedPermission(newRole: string, permissionRow: PermissionDisplayModel): PermissionElement {
let permissionRole: PermissionElement = {};
const permissionRole: PermissionElement = {};
permissionRole.accessStatus = permissionRow.accessStatus;
permissionRole.name = newRole;
permissionRole.authorityId = permissionRow.authorityId;