fix "ng lint" command (#5012)

* update to latest js-api

* fix the "ng lint" command

* fix linting issues

* fix lint issues

* lint fixes

* code fixes

* fix html

* fix html

* update tests

* test fixes

* update tests

* fix tests and api

* fix code
This commit is contained in:
Denys Vuika
2019-08-29 16:35:30 +01:00
committed by Eugenio Romano
parent 140c64b79f
commit edc0945f39
162 changed files with 537 additions and 530 deletions

View File

@@ -96,7 +96,7 @@
role="gridcell"
class=" adf-datatable-cell adf-datatable-cell--{{col.type || 'text'}} {{col.cssClass}}"
[attr.title]="col.title | translate"
[attr.data-automation-id]="getAutomationValue(row, col)"
[attr.data-automation-id]="getAutomationValue(row)"
[attr.aria-selected]="row.isSelected ? true : false"
[attr.aria-label]="col.title ? (col.title | translate) : null"
tabindex="0"

View File

@@ -33,7 +33,7 @@ class FakeDataRow implements DataRow {
isDropTarget = false;
isSelected = true;
hasValue(key: any) {
hasValue() {
return true;
}
@@ -374,7 +374,7 @@ describe('DataTable', () => {
dataTable.ngOnChanges({});
dataTable.rowClick.subscribe((event) => {
dataTable.rowClick.subscribe(() => {
expect(rows[0].isSelected).toBeFalsy();
expect(rows[1].isSelected).toBeTruthy();
done();
@@ -396,7 +396,7 @@ describe('DataTable', () => {
dataTable.ngOnChanges({});
dataTable.rowClick.subscribe((event) => {
dataTable.rowClick.subscribe(() => {
expect(rows[0].isSelected).toBeFalsy();
expect(rows[1].isSelected).toBeTruthy();
done();
@@ -463,7 +463,7 @@ describe('DataTable', () => {
const rows = dataTable.data.getRows();
dataTable.ngOnChanges({});
dataTable.rowClick.subscribe((event) => {
dataTable.rowClick.subscribe(() => {
expect(rows[0].isSelected).toBeTruthy();
expect(rows[1].isSelected).toBeFalsy();
done();
@@ -827,49 +827,49 @@ describe('DataTable', () => {
it('should use special material url scheme', () => {
const column = <DataColumn> {};
const row = {
getValue: function (key: string) {
const row: any = {
getValue: function () {
return 'material-icons://android';
}
};
expect(dataTable.isIconValue(<DataRow> row, column)).toBeTruthy();
expect(dataTable.isIconValue(row, column)).toBeTruthy();
});
it('should not use special material url scheme', () => {
const column = <DataColumn> {};
const row = {
getValue: function (key: string) {
const row: any = {
getValue: function () {
return 'http://www.google.com';
}
};
expect(dataTable.isIconValue(<DataRow> row, column)).toBeFalsy();
expect(dataTable.isIconValue(row, column)).toBeFalsy();
});
it('should parse icon value', () => {
const column = <DataColumn> {};
const row = {
getValue: function (key: string) {
const row: any = {
getValue: function () {
return 'material-icons://android';
}
};
expect(dataTable.asIconValue(<DataRow> row, column)).toBe('android');
expect(dataTable.asIconValue(row, column)).toBe('android');
});
it('should not parse icon value', () => {
const column = <DataColumn> {};
const row = {
getValue: function (key: string) {
const row: any = {
getValue: function () {
return 'http://www.google.com';
}
};
expect(dataTable.asIconValue(<DataRow> row, column)).toBe(null);
expect(dataTable.asIconValue(row, column)).toBe(null);
});
it('should parse icon values to a valid i18n key', () => {
@@ -966,8 +966,8 @@ describe('DataTable', () => {
});
const column = <DataColumn> {};
const row = <DataRow> {
getValue: function (key: string) {
const row: any = {
getValue: function () {
return 'id';
}
};

View File

@@ -701,7 +701,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
});
}
getAutomationValue(row: DataRow, col: DataColumn) {
getAutomationValue(row: DataRow): any {
const name = this.getNameColumnValue();
return name ? row.getValue(name.key) : '';
}

View File

@@ -36,7 +36,7 @@ export class ObjectDataRow implements DataRow {
return this.getValue(key) !== undefined;
}
imageErrorResolver(event: Event): string {
imageErrorResolver(): string {
return '';
}
}