diff --git a/lib/core/src/lib/datatable/data/object-datatable-adapter.spec.ts b/lib/core/src/lib/datatable/data/object-datatable-adapter.spec.ts index 591e0dfd6fe..71005d880f5 100644 --- a/lib/core/src/lib/datatable/data/object-datatable-adapter.spec.ts +++ b/lib/core/src/lib/datatable/data/object-datatable-adapter.spec.ts @@ -21,7 +21,6 @@ import { DataSorting } from './data-sorting.model'; import { ObjectDataTableAdapter } from './object-datatable-adapter'; import { ObjectDataRow } from './object-datarow.model'; import { ObjectDataColumn } from './object-datacolumn.model'; -import { mockPersonsData, mockPersonDataFirstRow } from './mocks/object-datatable-adapter.mock'; describe('ObjectDataTableAdapter', () => { it('should init with empty row collection', () => { @@ -290,132 +289,6 @@ describe('ObjectDataTableAdapter', () => { }) ); }); - - describe('should create proper rows and columns from schema and data with nested properties for', () => { - it('one column', () => { - const mockPersonSchema: DataColumn[] = [ - { - type: 'text', - key: 'person.name', - title: 'Name' - } - ]; - - const adapter = new ObjectDataTableAdapter(mockPersonsData, mockPersonSchema); - const rows = adapter.getRows(); - const columns = adapter.getColumns(); - - const expectedFirstRow = new ObjectDataRow({ - name: 'John Doe' - }); - const expectedSecondRow = new ObjectDataRow({ - name: 'Sam Smith' - }); - const expectedColumns = [new ObjectDataColumn({ key: 'name', type: 'text', title: 'Name' })]; - - expect(rows.length).toBe(2); - expect(rows[0]).toEqual(expectedFirstRow); - expect(rows[1]).toEqual(expectedSecondRow); - - expect(columns.length).toBe(1); - expect(columns).toEqual(expectedColumns); - }); - - it('one row', () => { - const mockPersonSchema: DataColumn[] = [ - { - type: 'text', - key: 'name', - title: 'Name' - }, - { - type: 'text', - key: 'personData.[address.[data]test].city', - title: 'City' - } - ]; - - const adapter = new ObjectDataTableAdapter([mockPersonDataFirstRow], mockPersonSchema); - const rows = adapter.getRows(); - const columns = adapter.getColumns(); - - const expectedFirstRow = new ObjectDataRow({ - name: 'John Doe', - city: 'Springfield' - }); - const expectedColumns = [ - new ObjectDataColumn({ key: 'name', type: 'text', title: 'Name' }), - new ObjectDataColumn({ key: 'city', type: 'text', title: 'City' }) - ]; - - expect(rows.length).toBe(1); - expect(rows[0]).toEqual(expectedFirstRow); - - expect(columns.length).toBe(2); - expect(columns).toEqual(expectedColumns); - }); - - it('complex schema', () => { - const mockPersonSchema: DataColumn[] = [ - { - type: 'text', - key: 'person.name', - title: 'Name' - }, - { - type: 'text', - key: 'person.personData.[address.[data]test].city', - title: 'City' - }, - { - type: 'text', - key: 'person.personData.[address.[data]test].street', - title: 'Street' - }, - { - type: 'json', - key: 'person.phoneNumbers', - title: 'Phone numbers' - } - ]; - - const adapter = new ObjectDataTableAdapter(mockPersonsData, mockPersonSchema); - const rows = adapter.getRows(); - const columns = adapter.getColumns(); - - const expectedFirstRow = new ObjectDataRow({ - city: 'Springfield', - street: '1234 Main St', - name: 'John Doe', - phoneNumbers: [ - { type: 'home', phoneNumber: '123-456-7890' }, - { type: 'work', phoneNumber: '098-765-4321' } - ] - }); - const expectedSecondRow = new ObjectDataRow({ - city: 'Westlake', - street: '731 Second St', - name: 'Sam Smith', - phoneNumbers: [ - { type: 'home', phoneNumber: '123-456-7891' }, - { type: 'work', phoneNumber: '321-654-1987' } - ] - }); - const expectedColumns = [ - new ObjectDataColumn({ key: 'name', type: 'text', title: 'Name' }), - new ObjectDataColumn({ key: 'city', type: 'text', title: 'City' }), - new ObjectDataColumn({ key: 'street', type: 'text', title: 'Street' }), - new ObjectDataColumn({ key: 'phoneNumbers', type: 'json', title: 'Phone numbers' }) - ]; - - expect(rows.length).toBe(2); - expect(rows[0]).toEqual(expectedFirstRow); - expect(rows[1]).toEqual(expectedSecondRow); - - expect(columns.length).toBe(4); - expect(columns).toEqual(expectedColumns); - }); - }); }); describe('ObjectDataRow', () => { diff --git a/lib/core/src/lib/datatable/data/object-datatable-adapter.ts b/lib/core/src/lib/datatable/data/object-datatable-adapter.ts index bf0582a64dd..aea687446a6 100644 --- a/lib/core/src/lib/datatable/data/object-datatable-adapter.ts +++ b/lib/core/src/lib/datatable/data/object-datatable-adapter.ts @@ -22,22 +22,19 @@ import { ObjectDataColumn } from './object-datacolumn.model'; import { DataSorting } from './data-sorting.model'; import { DataTableAdapter } from './datatable-adapter'; import { Subject } from 'rxjs'; -import { DataTablePathParserHelper } from '../helpers/data-table-path-parser.helper'; // Simple implementation of the DataTableAdapter interface. export class ObjectDataTableAdapter implements DataTableAdapter { private _sorting: DataSorting; private _rows: DataRow[]; private _columns: DataColumn[]; - private columnPaths: string[] = []; - private columnKeys: string[] = []; - private helper = new DataTablePathParserHelper(); selectedRow: DataRow; rowsChanged: Subject>; static generateSchema(data: any[]) { const schema = []; + if (data?.length) { const rowToExamine = data[0]; @@ -61,64 +58,21 @@ export class ObjectDataTableAdapter implements DataTableAdapter { this._rows = []; this._columns = []; - this.createColumns(schema); - this.createRows(data); - this.sortColumns(); - - this.rowsChanged = new Subject>(); - } - - private createColumns(schema: DataColumn[]): void { - if (schema?.length) { - this._columns = this.buildColumnsFromSchema(schema); - } - } - - private buildColumnsFromSchema(schema: DataColumn[]): ObjectDataColumn[] { - return schema.map((dataColumn) => { - const columnKey = this.extractNestedColumnKey(dataColumn.key); - this.columnPaths.push(dataColumn.key); - this.columnKeys.push(columnKey); - dataColumn.key = columnKey; - - return new ObjectDataColumn(dataColumn); - }); - } - - private sortColumns(): void { - const sortable = this._columns.filter((column) => column.sortable); - if (sortable?.length) { - this.sort(sortable[0].key, 'asc'); + if (data && data.length > 0) { + this._rows = data.map((item) => new ObjectDataRow(item)); } - } - private extractNestedColumnKey(path: string): string { - const properties = this.helper.splitPathIntoProperties(path); + if (schema && schema.length > 0) { + this._columns = schema.map((item) => new ObjectDataColumn(item)); - return this.helper.removeSquareBracketsFromProperty(properties[properties.length - 1]); - } - - private createRows(data: any[]): void { - if (data?.length) { - this._rows = data.map((item) => this.buildDataRowFromItem(item)); - } - } - - private buildDataRowFromItem(item: any): ObjectDataRow { - const rowData = {}; - this.columnPaths.forEach((path, i) => { - const rowValue = this.extractPropertyValue(this.helper.splitPathIntoProperties(path), item); - - if (rowValue) { - rowData[this.columnKeys[i]] = rowValue; + // Sort by first sortable or just first column + const sortable = this._columns.filter((column) => column.sortable); + if (sortable.length > 0) { + this.sort(sortable[0].key, 'asc'); } - }); - - return new ObjectDataRow(rowData); - } + } - private extractPropertyValue(properties: string[], item: any): string { - return properties.reduce((acc, property) => (acc ? acc[this.helper.removeSquareBracketsFromProperty(property)] : undefined), item); + this.rowsChanged = new Subject>(); } getColumnType(_row: DataRow, col: DataColumn): string { diff --git a/lib/core/src/lib/datatable/public-api.ts b/lib/core/src/lib/datatable/public-api.ts index d9e175ab29e..bc3ec5cdaac 100644 --- a/lib/core/src/lib/datatable/public-api.ts +++ b/lib/core/src/lib/datatable/public-api.ts @@ -52,7 +52,5 @@ export * from './directives/main-data-table-action-template.directive'; export * from './services/datatable.service'; -export * from './helpers/data-table-path-parser.helper'; - export * from './datatable.module'; export * from './data-column'; diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table-adapter.widget.spec.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table-adapter.widget.spec.ts index 612392ccb5b..b00692a492c 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table-adapter.widget.spec.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table-adapter.widget.spec.ts @@ -22,7 +22,8 @@ import { mockInvalidSchemaDefinition, mockSchemaDefinition } from './mocks/data-table-widget.mock'; -import { ObjectDataRow } from '@alfresco/adf-core'; +import { mockPersonDataFirstRow, mockPersonsData } from './mocks/data-table-adapter.mock'; +import { DataColumn, ObjectDataColumn, ObjectDataRow } from '@alfresco/adf-core'; describe('WidgetDataTableAdapter', () => { let widgetDataTableAdapter: WidgetDataTableAdapter; @@ -64,4 +65,130 @@ describe('WidgetDataTableAdapter', () => { expect(isValid).toBeTrue(); }); + + describe('should create proper rows and columns from schema and data with nested properties for', () => { + it('one column', () => { + const mockPersonSchema: DataColumn[] = [ + { + type: 'text', + key: 'person.name', + title: 'Name' + } + ]; + + const adapter = new WidgetDataTableAdapter(mockPersonsData, mockPersonSchema); + const rows = adapter.getRows(); + const columns = adapter.getColumns(); + + const expectedFirstRow = new ObjectDataRow({ + 'person.name': 'John Doe' + }); + const expectedSecondRow = new ObjectDataRow({ + 'person.name': 'Sam Smith' + }); + const expectedColumns = [new ObjectDataColumn({ key: 'person.name', type: 'text', title: 'Name' })]; + + expect(rows.length).toBe(2); + expect(rows[0]).toEqual(expectedFirstRow); + expect(rows[1]).toEqual(expectedSecondRow); + + expect(columns.length).toBe(1); + expect(columns).toEqual(expectedColumns); + }); + + it('one row', () => { + const mockPersonSchema: DataColumn[] = [ + { + type: 'text', + key: 'name', + title: 'Name' + }, + { + type: 'text', + key: 'personData.[address.[data]test].city', + title: 'City' + } + ]; + + const adapter = new WidgetDataTableAdapter([mockPersonDataFirstRow], mockPersonSchema); + const rows = adapter.getRows(); + const columns = adapter.getColumns(); + + const expectedFirstRow = new ObjectDataRow({ + name: 'John Doe', + 'personData.[address.[data]test].city': 'Springfield' + }); + const expectedColumns = [ + new ObjectDataColumn({ key: 'name', type: 'text', title: 'Name' }), + new ObjectDataColumn({ key: 'personData.[address.[data]test].city', type: 'text', title: 'City' }) + ]; + + expect(rows.length).toBe(1); + expect(rows[0]).toEqual(expectedFirstRow); + + expect(columns.length).toBe(2); + expect(columns).toEqual(expectedColumns); + }); + + it('complex schema', () => { + const mockPersonSchema: DataColumn[] = [ + { + type: 'text', + key: 'person.name', + title: 'Name' + }, + { + type: 'text', + key: 'person.personData.[address.[data]test].city', + title: 'City' + }, + { + type: 'text', + key: 'person.personData.[address.[data]test].street', + title: 'Street' + }, + { + type: 'json', + key: 'person.phoneNumbers', + title: 'Phone numbers' + } + ]; + + const adapter = new WidgetDataTableAdapter(mockPersonsData, mockPersonSchema); + const rows = adapter.getRows(); + const columns = adapter.getColumns(); + + const expectedFirstRow = new ObjectDataRow({ + 'person.personData.[address.[data]test].city': 'Springfield', + 'person.personData.[address.[data]test].street': '1234 Main St', + 'person.name': 'John Doe', + 'person.phoneNumbers': [ + { type: 'home', phoneNumber: '123-456-7890' }, + { type: 'work', phoneNumber: '098-765-4321' } + ] + }); + const expectedSecondRow = new ObjectDataRow({ + 'person.personData.[address.[data]test].city': 'Westlake', + 'person.personData.[address.[data]test].street': '731 Second St', + 'person.name': 'Sam Smith', + 'person.phoneNumbers': [ + { type: 'home', phoneNumber: '123-456-7891' }, + { type: 'work', phoneNumber: '321-654-1987' } + ] + }); + const expectedColumns = [ + new ObjectDataColumn({ key: 'person.name', type: 'text', title: 'Name' }), + new ObjectDataColumn({ key: 'person.personData.[address.[data]test].city', type: 'text', title: 'City' }), + new ObjectDataColumn({ key: 'person.personData.[address.[data]test].street', type: 'text', title: 'Street' }), + new ObjectDataColumn({ key: 'person.phoneNumbers', type: 'json', title: 'Phone numbers' }) + ]; + + expect(rows.length).toBe(2); + expect(rows[0]).toEqual(expectedFirstRow); + expect(rows[1]).toEqual(expectedSecondRow); + + expect(columns.length).toBe(4); + expect(columns).toEqual(expectedColumns); + }); + }); }); diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table-adapter.widget.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table-adapter.widget.ts index c213f9940d5..60e13ffb5f3 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table-adapter.widget.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table-adapter.widget.ts @@ -15,42 +15,118 @@ * limitations under the License. */ -import { - ObjectDataTableAdapter, - DataColumn, - DataRow -} from '@alfresco/adf-core'; +import { ObjectDataTableAdapter, DataColumn, DataRow, ObjectDataColumn, ObjectDataRow, DataTableAdapter, DataSorting } from '@alfresco/adf-core'; +import { DataTablePathParserHelper } from './helpers/data-table-path-parser.helper'; +import { Subject } from 'rxjs'; -export class WidgetDataTableAdapter extends ObjectDataTableAdapter { +export class WidgetDataTableAdapter implements DataTableAdapter { + private adapter: ObjectDataTableAdapter; + private columnKeys: string[] = []; + private helper = new DataTablePathParserHelper(); - private rows: DataRow[]; - private columns: DataColumn[]; + get selectedRow(): DataRow { + return this.adapter.selectedRow; + } + + get rowsChanged(): Subject> { + return this.adapter.rowsChanged; + } + + constructor(data: any[], schema: DataColumn[]) { + this.adapter = new ObjectDataTableAdapter(data, schema); + + this.createColumns(schema); + this.createRows(data); + } + + private createColumns(schema: DataColumn[]): void { + if (schema?.length) { + this.adapter.setColumns(this.buildColumnsFromSchema(schema)); + } + } - constructor(data?: any[], schema?: DataColumn[]) { - super(data, schema); - this.rows = super.getRows(); - this.columns = super.getColumns(); + private buildColumnsFromSchema(schema: DataColumn[]): ObjectDataColumn[] { + return schema.map((dataColumn) => { + this.columnKeys.push(dataColumn.key); + + return new ObjectDataColumn(dataColumn); + }); + } + + private createRows(data: any[]): void { + if (data?.length) { + this.adapter.setRows(data.map((item) => this.buildDataRowFromItem(item))); + } + } + + private buildDataRowFromItem(item: any): ObjectDataRow { + const rowData = {}; + this.columnKeys.forEach((path, i) => { + const rowValue = this.extractPropertyValue(this.helper.splitPathIntoProperties(path), item); + + if (rowValue) { + rowData[this.columnKeys[i]] = rowValue; + } + }); + + return new ObjectDataRow(rowData); + } + + private extractPropertyValue(properties: string[], item: any): string { + return properties.reduce((acc, property) => (acc ? acc[this.helper.removeSquareBracketsFromProperty(property)] : undefined), item); + } + + getColumns(): Array { + return this.adapter.getColumns(); } getRows(): DataRow[] { if (this.isDataSourceValid()) { - return this.rows; + return this.adapter.getRows(); } return []; } + setRows(rows: Array): void { + this.adapter.setRows(rows); + } + + setColumns(columns: Array): void { + this.adapter.setColumns(columns); + } + + getValue(row: DataRow, col: DataColumn, resolverFn?: (_row: DataRow, _col: DataColumn) => any): any { + return this.adapter.getValue(row, col, resolverFn); + } + + getColumnType(row: DataRow, col: DataColumn): string { + return this.adapter.getColumnType(row, col); + } + + getSorting(): DataSorting { + return this.adapter.getSorting(); + } + + setSorting(sorting: DataSorting): void { + this.adapter.setSorting(sorting); + } + + sort(key?: string, direction?: string): void { + this.adapter.sort(key, direction); + } + isDataSourceValid(): boolean { return this.hasAllColumnsLinkedToData() && this.hasAllMandatoryColumnPropertiesHaveValues(); } private hasAllMandatoryColumnPropertiesHaveValues(): boolean { - return this.columns.every(column => !!column.key); + return this.adapter.getColumns().every((column) => !!column.key); } private hasAllColumnsLinkedToData(): boolean { - const availableColumnKeys: string[] = this.columns.map(column => column.key); + const availableColumnKeys: string[] = this.adapter.getColumns().map((column) => column.key); - return availableColumnKeys.every(columnKey => this.rows.some(row => Object.keys(row.obj).includes(columnKey))); + return availableColumnKeys.every((columnKey) => this.adapter.getRows().some((row) => Object.keys(row.obj).includes(columnKey))); } } diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.spec.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.spec.ts index c776ecb3590..ce5d0c92768 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.spec.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.spec.ts @@ -37,7 +37,9 @@ import { mockSchemaDefinitionWithNestedKeys, mockCountryColumns, mockEuropeCountriesRows, - mockAmericaCountriesRows + mockAmericaCountriesRows, + mockNestedCountryColumns, + mockNestedEuropeCountriesRows } from './mocks/data-table-widget.mock'; describe('DataTableWidgetComponent', () => { @@ -126,7 +128,7 @@ describe('DataTableWidgetComponent', () => { widget.field.value = mockNestedEuropeCountriesData; fixture.detectChanges(); - assertData(mockCountryColumns, mockEuropeCountriesRows); + assertData(mockNestedCountryColumns, mockNestedEuropeCountriesRows); }); it('should properly initialize data source with priority on the field value if process and form variables are provided', () => { diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.ts index a9ea2b5beca..fe2c786e571 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.ts @@ -18,12 +18,13 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; -import { WidgetComponent, FormService, DataTableModule, FormBaseModule, DataRow, DataColumn, DataTablePathParserHelper } from '@alfresco/adf-core'; +import { WidgetComponent, FormService, DataTableModule, FormBaseModule, DataRow, DataColumn } from '@alfresco/adf-core'; import { CommonModule } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; import { FormCloudService } from '../../../services/form-cloud.service'; import { TaskVariableCloud } from '../../../models/task-variable-cloud.model'; import { WidgetDataTableAdapter } from './data-table-adapter.widget'; +import { DataTablePathParserHelper } from './helpers/data-table-path-parser.helper'; @Component({ standalone: true, diff --git a/lib/core/src/lib/datatable/helpers/data-table-path-parser.helper.spec.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/helpers/data-table-path-parser.helper.spec.ts similarity index 100% rename from lib/core/src/lib/datatable/helpers/data-table-path-parser.helper.spec.ts rename to lib/process-services-cloud/src/lib/form/components/widgets/data-table/helpers/data-table-path-parser.helper.spec.ts diff --git a/lib/core/src/lib/datatable/helpers/data-table-path-parser.helper.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/helpers/data-table-path-parser.helper.ts similarity index 100% rename from lib/core/src/lib/datatable/helpers/data-table-path-parser.helper.ts rename to lib/process-services-cloud/src/lib/form/components/widgets/data-table/helpers/data-table-path-parser.helper.ts diff --git a/lib/core/src/lib/datatable/helpers/mocks/data-table-path-parser.helper.mock.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/helpers/mocks/data-table-path-parser.helper.mock.ts similarity index 100% rename from lib/core/src/lib/datatable/helpers/mocks/data-table-path-parser.helper.mock.ts rename to lib/process-services-cloud/src/lib/form/components/widgets/data-table/helpers/mocks/data-table-path-parser.helper.mock.ts diff --git a/lib/core/src/lib/datatable/data/mocks/object-datatable-adapter.mock.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/mocks/data-table-adapter.mock.ts similarity index 96% rename from lib/core/src/lib/datatable/data/mocks/object-datatable-adapter.mock.ts rename to lib/process-services-cloud/src/lib/form/components/widgets/data-table/mocks/data-table-adapter.mock.ts index 0b62ba46193..f6e494ebf05 100644 --- a/lib/core/src/lib/datatable/data/mocks/object-datatable-adapter.mock.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/mocks/data-table-adapter.mock.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/mocks/data-table-widget.mock.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/mocks/data-table-widget.mock.ts index 8b6fc999f48..5d37f9fee11 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/mocks/data-table-widget.mock.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/mocks/data-table-widget.mock.ts @@ -57,6 +57,11 @@ export const mockCountryColumns: DataColumn[] = [ new ObjectDataColumn({ key: 'name', type: 'text', title: 'Country Name', sortable: true, draggable: true }) ]; +export const mockNestedCountryColumns: DataColumn[] = [ + new ObjectDataColumn({ key: 'countries.europeCountry.id', type: 'text', title: 'Country ID', sortable: true, draggable: true }), + new ObjectDataColumn({ key: 'countries.europeCountry.name', type: 'text', title: 'Country Name', sortable: true, draggable: true }) +]; + export const mockInvalidSchemaDefinition: DataColumn[] = [ { type: 'text', @@ -95,6 +100,12 @@ export const mockEuropeCountriesRows: DataRow[] = [ new ObjectDataRow({ id: 'UK', name: 'United Kingdom' }) ]; +export const mockNestedEuropeCountriesRows: DataRow[] = [ + new ObjectDataRow({ 'countries.europeCountry.id': 'IT', 'countries.europeCountry.name': 'Italy' }), + new ObjectDataRow({ 'countries.europeCountry.id': 'PL', 'countries.europeCountry.name': 'Poland' }), + new ObjectDataRow({ 'countries.europeCountry.id': 'UK', 'countries.europeCountry.name': 'United Kingdom' }) +]; + export const mockJsonResponseEuropeCountriesData = { data: mockEuropeCountriesData };