mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
committed by
Eugenio Romano
parent
140c64b79f
commit
edc0945f39
@@ -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"
|
||||
|
@@ -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';
|
||||
}
|
||||
};
|
||||
|
@@ -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) : '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user