Skip to content

Commit 12e4fe3

Browse files
committed
[ACS-10280]: cleans up redundant property
1 parent 2de7ab1 commit 12e4fe3

File tree

4 files changed

+0
-61
lines changed

4 files changed

+0
-61
lines changed

lib/content-services/src/lib/document-list/data/share-datatable-adapter.spec.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -493,16 +493,4 @@ describe('ShareDataTableAdapter', () => {
493493
expect(adapter.getRowByNodeId('fake-node-id-2')).toEqual(fakeShareDataRows[1]);
494494
});
495495
});
496-
497-
it('should initialize with allowFocusOnRows as true by default', () => {
498-
const adapter = new ShareDataTableAdapter(thumbnailService, contentService, null);
499-
expect(adapter.allowFocusOnRows).toBe(true);
500-
});
501-
502-
it('should set allowFocusOnRows value', () => {
503-
const adapter = new ShareDataTableAdapter(thumbnailService, contentService, null);
504-
expect(adapter.allowFocusOnRows).toBe(true);
505-
adapter.setAllowFocusOnTableRows(false);
506-
expect(adapter.allowFocusOnRows).toBe(false);
507-
});
508496
});

lib/content-services/src/lib/document-list/data/share-datatable-adapter.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export class ShareDataTableAdapter implements DataTableAdapter {
3838
permissionsStyle: PermissionStyleModel[];
3939
selectedRow: DataRow;
4040
allowDropFiles: boolean;
41-
allowFocusOnRows = true;
4241

4342
set sortingMode(value: string) {
4443
let newValue = (value || 'client').toLowerCase();
@@ -197,10 +196,6 @@ export class ShareDataTableAdapter implements DataTableAdapter {
197196
this.imageResolver = resolver;
198197
}
199198

200-
setAllowFocusOnTableRows(allow: boolean) {
201-
this.allowFocusOnRows = allow;
202-
}
203-
204199
private getFolderIcon(node: any) {
205200
if (this.isSmartFolder(node)) {
206201
return this.thumbnailService.getMimeTypeIcon('smartFolder');

lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import { HarnessLoader } from '@angular/cdk/testing';
3636
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
3737
import { provideRouter } from '@angular/router';
3838
import { firstValueFrom } from 'rxjs';
39-
import { DataTableAdapter } from '@alfresco/adf-core';
4039
import { MatTooltipHarness } from '@angular/material/tooltip/testing';
4140

4241
@Component({
@@ -1818,47 +1817,6 @@ describe('Accessibility', () => {
18181817
});
18191818
});
18201819

1821-
describe('ShareDatatable adapter allowFocusOnRows', () => {
1822-
class ShareAdapterMock extends ObjectDataTableAdapter {
1823-
public allowFocusOnRows = true;
1824-
1825-
constructor(data: any[], schema: DataColumn[]) {
1826-
super(data, schema);
1827-
}
1828-
1829-
setAllowFocusOnTableRows(allow: boolean) {
1830-
this.allowFocusOnRows = allow;
1831-
}
1832-
}
1833-
const testAllowFocusOnRows = (expectedTabindex: string | null, adapter: DataTableAdapter) => {
1834-
const fakeDataRows = [new FakeDataRow(), new FakeDataRow()];
1835-
1836-
adapter.setRows(fakeDataRows);
1837-
dataTable.data = adapter;
1838-
fixture.detectChanges();
1839-
const rowElements = testingUtils.getAllByCSS('.adf-datatable-body adf-datatable-row');
1840-
expect(rowElements.length).toBeGreaterThan(0);
1841-
expect(rowElements.every((row) => row.nativeElement.getAttribute('tabindex') === expectedTabindex)).toBeTrue();
1842-
};
1843-
1844-
it('should set tabindex to null (disabled === true) on datatable-body rows when allowFocusOnRows is set to false in ShareDatatable adapter', () => {
1845-
const adapter = new ShareAdapterMock([], []);
1846-
adapter.setAllowFocusOnTableRows(false);
1847-
testAllowFocusOnRows(null, adapter);
1848-
});
1849-
1850-
it('should set tabindex to 0 (disabled === false) on datatable-body rows when allowFocusOnRows is not set explicitly in ShareDatatable adapter and falls back to default value ', () => {
1851-
const adapter = new ShareAdapterMock([], []);
1852-
adapter.setAllowFocusOnTableRows(true);
1853-
testAllowFocusOnRows('0', adapter);
1854-
});
1855-
1856-
it('should set tabindex to 0 (disabled === false) by default on datatable-body rows when allowFocusOnRows is not defined in Datatable adapter (fallback case)', () => {
1857-
const adapter = new ObjectDataTableAdapter([], []);
1858-
testAllowFocusOnRows('0', adapter);
1859-
});
1860-
});
1861-
18621820
it('should create focus trap on main menu open', () => {
18631821
dataTable.showHeader = ShowHeaderMode.Always;
18641822
dataTable.showMainDatatableActions = true;

lib/core/src/lib/datatable/data/datatable-adapter.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { Subject } from 'rxjs';
2222

2323
export interface DataTableAdapter {
2424
rowsChanged?: Subject<Array<DataRow>>;
25-
allowFocusOnRows?: boolean;
2625

2726
selectedRow: DataRow;
2827
getRows(): Array<DataRow>;
@@ -34,5 +33,4 @@ export interface DataTableAdapter {
3433
getSorting(): DataSorting;
3534
setSorting(sorting: DataSorting): void;
3635
sort(key?: string, direction?: string): void;
37-
setAllowFocusOnTableRows?(allow: boolean): void;
3836
}

0 commit comments

Comments
 (0)