mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
committed by
Eugenio Romano
parent
26c5982a1a
commit
a7a48e8b2b
@@ -34,13 +34,13 @@ export class ObjectDataTableAdapter implements DataTableAdapter {
|
||||
rowsChanged: Subject<Array<DataRow>>;
|
||||
|
||||
static generateSchema(data: any[]) {
|
||||
let schema = [];
|
||||
const schema = [];
|
||||
|
||||
if (data && data.length) {
|
||||
let rowToExaminate = data[0];
|
||||
const rowToExaminate = data[0];
|
||||
|
||||
if (typeof rowToExaminate === 'object') {
|
||||
for (let key in rowToExaminate) {
|
||||
for (const key in rowToExaminate) {
|
||||
if (rowToExaminate.hasOwnProperty(key)) {
|
||||
schema.push({
|
||||
type: 'text',
|
||||
@@ -72,7 +72,7 @@ export class ObjectDataTableAdapter implements DataTableAdapter {
|
||||
});
|
||||
|
||||
// Sort by first sortable or just first column
|
||||
let sortable = this._columns.filter((column) => column.sortable);
|
||||
const sortable = this._columns.filter((column) => column.sortable);
|
||||
if (sortable.length > 0) {
|
||||
this.sort(sortable[0].key, 'asc');
|
||||
}
|
||||
@@ -107,7 +107,7 @@ export class ObjectDataTableAdapter implements DataTableAdapter {
|
||||
throw new Error('Column not found');
|
||||
}
|
||||
|
||||
let value = row.getValue(col.key);
|
||||
const value = row.getValue(col.key);
|
||||
|
||||
if (col.type === 'icon') {
|
||||
const icon = row.getValue(col.key);
|
||||
@@ -148,7 +148,7 @@ export class ObjectDataTableAdapter implements DataTableAdapter {
|
||||
}
|
||||
|
||||
sort(key?: string, direction?: string): void {
|
||||
let sorting = this._sorting || new DataSorting();
|
||||
const sorting = this._sorting || new DataSorting();
|
||||
if (key) {
|
||||
sorting.key = key;
|
||||
sorting.direction = direction || 'asc';
|
||||
|
Reference in New Issue
Block a user