Automatically apply virtualization in the DataGridView of SchemaView if the schema contains only one collection. #7607

This commit is contained in:
Aditya Toshniwal
2024-06-27 13:21:18 +05:30
committed by GitHub
parent 6f96f67655
commit feb3093c6d
6 changed files with 116 additions and 40 deletions
@@ -70,8 +70,8 @@ describe('SchemaView', ()=>{
await user.type(ctrl.container.querySelector('[name="field2"]'), '2');
await user.type(ctrl.container.querySelector('[name="field5"]'), 'val5');
/* Add a row */
await user.click(ctrl.container.querySelector('[data-test="add-row"]'));
await user.click(ctrl.container.querySelector('[data-test="add-row"]'));
await user.click(ctrl.container.querySelector('button[data-test="add-row"]'));
await user.click(ctrl.container.querySelector('button[data-test="add-row"]'));
await user.type(ctrl.container.querySelectorAll('[name="field5"]')[0], 'rval51');
await user.type(ctrl.container.querySelectorAll('[name="field5"]')[1], 'rval52');
};
@@ -35,7 +35,7 @@ class TestSubSchema extends BaseUISchema {
{
id: 'field5', label: 'Field5', type: 'multiline', group: null,
cell: 'text', mode: ['properties', 'edit', 'create'], disabled: false,
noEmpty: true, minWidth: '50%',
noEmpty: true, minWidth: 50,
},
{
id: 'fieldskip', label: 'FieldSkip', type: 'text', group: null,
+28
View File
@@ -65,5 +65,33 @@ document.createRange = () => {
return range;
};
// for virtual tables, height should exist.
Element.prototype.getBoundingClientRect = jest.fn(function () {
if (this.classList?.contains('pgrt')) {
return {
width: 400,
height: 400,
top: 0,
left: 0,
bottom: 0,
right: 0,
x: 0,
y: 0,
toJSON: () => {},
};
}
return {
width: 0,
height: 0,
top: 0,
left: 0,
bottom: 0,
right: 0,
x: 0,
y: 0,
toJSON: () => {},
};
});
jest.setTimeout(18000); // 1 second