mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-16969] Remove force casting of all types to text (#8963)
This commit is contained in:
@@ -20,8 +20,7 @@ import {
|
||||
mockEuropeCountriesData,
|
||||
mockCountriesIncorrectData,
|
||||
mockInvalidSchemaDefinition,
|
||||
mockSchemaDefinition,
|
||||
mockSchemaDefinitionWithDifferentTypes
|
||||
mockSchemaDefinition
|
||||
} from '../../../mocks/data-table-widget.mock';
|
||||
import { ObjectDataRow } from '@alfresco/adf-core';
|
||||
|
||||
@@ -32,14 +31,6 @@ describe('WidgetDataTableAdapter', () => {
|
||||
widgetDataTableAdapter = new WidgetDataTableAdapter(mockEuropeCountriesData, mockSchemaDefinition);
|
||||
});
|
||||
|
||||
it('should set columns type to "text" during initialization', () => {
|
||||
widgetDataTableAdapter = new WidgetDataTableAdapter(mockEuropeCountriesData, mockSchemaDefinitionWithDifferentTypes);
|
||||
|
||||
widgetDataTableAdapter.getColumns().forEach(column =>
|
||||
expect(column.type).toBe('text')
|
||||
);
|
||||
});
|
||||
|
||||
it('should return rows if all columns are linked to data', () => {
|
||||
const rows = widgetDataTableAdapter.getRows();
|
||||
|
||||
|
@@ -30,8 +30,6 @@ export class WidgetDataTableAdapter extends ObjectDataTableAdapter {
|
||||
super(data, schema);
|
||||
this.rows = super.getRows();
|
||||
this.columns = super.getColumns();
|
||||
|
||||
this.setColumnsTypeToText();
|
||||
}
|
||||
|
||||
getRows(): DataRow[] {
|
||||
@@ -55,8 +53,4 @@ export class WidgetDataTableAdapter extends ObjectDataTableAdapter {
|
||||
|
||||
return availableColumnKeys.every(columnKey => this.rows.some(row => Object.keys(row.obj).includes(columnKey)));
|
||||
}
|
||||
|
||||
private setColumnsTypeToText(): void {
|
||||
super.setColumns(this.columns.map(column => ({ ...column, type: 'text' })));
|
||||
}
|
||||
}
|
||||
|
@@ -35,23 +35,6 @@ export const mockSchemaDefinition: DataColumn[] = [
|
||||
}
|
||||
];
|
||||
|
||||
export const mockSchemaDefinitionWithDifferentTypes: DataColumn[] = [
|
||||
{
|
||||
type: 'json',
|
||||
key: 'id',
|
||||
title: 'Country ID',
|
||||
sortable: true,
|
||||
draggable: true
|
||||
},
|
||||
{
|
||||
type: 'date',
|
||||
key: 'name',
|
||||
title: 'Country Name',
|
||||
sortable: true,
|
||||
draggable: true
|
||||
}
|
||||
];
|
||||
|
||||
export const mockInvalidSchemaDefinition: DataColumn[] = [
|
||||
{
|
||||
type: 'text',
|
||||
|
Reference in New Issue
Block a user