Skip to content

Commit

Permalink
merge upstream 25_1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zedwag committed Feb 18, 2025
2 parents 13a7eff + b3134ce commit 934b23e
Show file tree
Hide file tree
Showing 29 changed files with 644 additions and 160 deletions.
53 changes: 52 additions & 1 deletion e2e/testcafe-devextreme/tests/dataGrid/filterRow/filterRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import FilterTextBox from 'devextreme-testcafe-models/dataGrid/editors/filterTex
import url from '../../../helpers/getPageUrl';
import { createWidget } from '../../../helpers/createWidget';
import { changeTheme } from '../../../helpers/changeTheme';
import { getNumberData } from '../helpers/generateDataSourceData';
import { getNumberData, getData } from '../helpers/generateDataSourceData';

fixture.disablePageReloads`FilterRow`
.page(url(__dirname, '../../container.html'));
Expand Down Expand Up @@ -106,3 +106,54 @@ test('FilterRow range overlay screenshot', async (t) => {
applyFilter: 'auto',
},
}));

// T1267481
test('Filter Row\'s Reset button does not work after a custom filter is set in Filter Builder', async (t) => {
const dataGrid = new DataGrid('#container');
const filterEditor = dataGrid.getFilterEditor(0, FilterTextBox);

await dataGrid.isReady();

await t
.expect(dataGrid.dataRows.count)
.eql(0);

await t
.click(filterEditor.menuButton)
.click(filterEditor.menu.getItemByText('Reset'));

await t
.expect(dataGrid.dataRows.count)
.notEql(0);
}).before(async () => {
await createWidget('dxDataGrid', {
dataSource: getData(20, 1),
height: 400,
showBorders: true,
filterRow: {
visible: true,
applyFilter: 'auto',
},
filterBuilder: {
customOperations: [
{
name: 'custom',
caption: 'custom',
dataTypes: ['string'],
icon: 'check',
hasValue: false,
calculateFilterExpression() {
return [
['Field 0', '=', 0],
];
},
},
],
allowHierarchicalFields: true,
},
filterPanel: { visible: true },
filterValue: [
['field_0', 'custom'],
],
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import { DRAG_MOUSE_OPTIONS } from '../const';
fixture.disablePageReloads`pivotGrid_fieldPanel_drag-n-drop`
.page(url(__dirname, '../../container.html'));

const PIVOT_GRID_SELECTOR = '#container';

test('Field panel items markup in the middle of the drag-n-drop', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const pivotGrid = new PivotGrid('#container');
const pivotGrid = new PivotGrid(PIVOT_GRID_SELECTOR);
const columnFirstAction = pivotGrid.getColumnHeaderArea().getAction();
const rowFirstAction = pivotGrid.getRowHeaderArea().getAction();
const dataFirstAction = pivotGrid.getDataHeaderArea().getAction();
Expand Down Expand Up @@ -72,3 +74,53 @@ test('Field panel items markup in the middle of the drag-n-drop', async (t) => {
},
});
});

test('Should show d-n-d indicator during drag to first place in columns fields', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const pivotGrid = new PivotGrid(PIVOT_GRID_SELECTOR);
const rowFirstField = pivotGrid.getRowHeaderArea().getField();
const columnHeaderAreaElement = pivotGrid.getColumnHeaderArea().element;

await MouseUpEvents.disable(MouseAction.dragToOffset);

const rowFirsFieldX = await rowFirstField.offsetLeft;
const rowFirsFieldY = await rowFirstField.offsetTop;
const columnHeaderX = await columnHeaderAreaElement.offsetLeft;
const columnHeaderY = await columnHeaderAreaElement.offsetTop;
const deltaOffsetX = 20;
const dragOffsetX = columnHeaderX - rowFirsFieldX - deltaOffsetX;
const dragOffsetY = rowFirsFieldY - columnHeaderY;

await t.drag(rowFirstField, dragOffsetX, dragOffsetY, DRAG_MOUSE_OPTIONS);

await testScreenshot(t, takeScreenshot, 'field-panel_column-field_dnd-first.png', { element: pivotGrid.element });

await MouseUpEvents.enable(MouseAction.dragToOffset);

await t.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => {
await createWidget('dxPivotGrid', {
showBorders: true,
fieldPanel: {
visible: true,
},
dataSource: {
fields: [{
dataField: 'row1',
area: 'row',
}, {
dataField: 'row2',
area: 'row',
}, {
dataField: 'column1',
area: 'column',
}, {
dataField: 'column2',
area: 'column',
}],
store: [],
},
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions e2e/testcafe-devextreme/tests/treeList/seachPanel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import TreeList from 'devextreme-testcafe-models/treeList';
import url from '../../helpers/getPageUrl';
import { createWidget } from '../../helpers/createWidget';

fixture`SearchPanel`
.page(url(__dirname, '../container.html'));

test('Items are shown in the original order after search is applied - T1274434 - 1', async (t) => {
const treeList = new TreeList('#container');
await treeList.apiSearchByText('test');

await t
.expect((await treeList.apiGetVisibleRows()).length)
.eql(3);

await t
.expect(treeList.apiGetCellValue(0, 0))
.eql('parent1');

await t
.expect(treeList.apiGetCellValue(1, 0))
.eql('test2');

await t
.expect(treeList.apiGetCellValue(2, 0))
.eql('test1');
}).before(async () => createWidget('dxTreeList', {
showBorders: true,
showRowLines: true,
expandedRowKeys: [1],
searchPanel: {
visible: true,
},
columns: ['text'],
dataSource: [
{ id: 1, parentId: 0, text: 'parent1' },
{ id: 2, parentId: 0, text: 'test1' },
{ id: 3, parentId: 1, text: 'test2' },
],
}));

test('Items are shown in the original order after search is applied - T1274434 - 2', async (t) => {
const treeList = new TreeList('#container');
await treeList.apiSearchByText('test');

await t
.expect((await treeList.apiGetVisibleRows()).length)
.eql(3);

await t
.expect(treeList.apiGetCellValue(0, 0))
.eql('parent1');

await t
.expect(treeList.apiGetCellValue(1, 0))
.eql('test2');

await t
.expect(treeList.apiGetCellValue(2, 0))
.eql('test1');
}).before(async () => createWidget('dxTreeList', {
showBorders: true,
showRowLines: true,
expandedRowKeys: [1],
searchPanel: {
visible: true,
},
columns: ['text'],
dataSource: [
{ id: 1, parentId: 0, text: 'parent1' },
{ id: 2, parentId: 0, text: 'test1' },
{ id: 3, parentId: 1, text: 'test2' },
{ id: 4, parentId: 0, text: 'parent2' },
],
}));
20 changes: 16 additions & 4 deletions packages/devextreme-scss/scss/widgets/base/pivotGrid/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ $pivotgrid-expand-icon-text-offset: 0;
.dx-pivotgrid {
.dx-column-header,
.dx-filter-header {
.dx-pivotgrid-fields-area {
overflow: hidden;
}

.dx-pivotgrid-toolbar {
margin-right: 10px;
float: right;
Expand All @@ -146,6 +142,22 @@ $pivotgrid-expand-icon-text-offset: 0;
}
}

.dx-column-header {
.dx-pivotgrid-fields-area {
.dx-area-field-container {
display: block;
max-width: 100%;
overflow: hidden;
}
}
}

.dx-filter-header {
.dx-pivotgrid-fields-area {
overflow: hidden;
}
}

.dx-data-header,
.dx-column-header,
.dx-area-description-cell.dx-pivotgrid-background {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ export const columnOptionCore = function (that: ColumnsController, column, optio
that._checkColumns();
}

if (!isDefined(prevValue) && !isDefined(value) && optionName.indexOf('buffer') !== 0) {
if (!isDefined(prevValue) && !isDefined(value) && optionName.indexOf('buffer') !== 0 && notFireEvent !== false) {
notFireEvent = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ const columnHeadersView = (Base: ModuleType<ColumnHeadersView>) => class ColumnH
options[isOnClickMode ? 'bufferedSelectedFilterOperation' : 'selectedFilterOperation'] = column.defaultSelectedFilterOperation || null;
}

that._columnsController.columnOption(column.index, options);
const isResetFilterOperation = !properties.itemData?.name;
const isNotFireEvent = isResetFilterOperation ? false : undefined;
that._columnsController.columnOption(column.index, options, undefined, isNotFireEvent);
that._applyFilterViewController.setHighLight($editorContainer, true);

if (!selectedFilterOperation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,26 +197,30 @@ function mergeArraysByMaxValue(values1, values2) {
return result;
}

/**
* @returns Maximum expanded level in the axis
*/
function getExpandedLevel(options, axisName) {
const dimensions = options[axisName];
let expandLevel = 0;
const fields = options[axisName];
const expandedPaths = (axisName === 'columns' ? options.columnExpandedPaths : options.rowExpandedPaths) || [];

let expandedLevel = 0;

if (options.headerName === axisName) {
expandLevel = options.path.length;
expandedLevel = options.path.length;
} else if (options.headerName && options.headerName !== axisName && options.oppositePath) {
expandLevel = options.oppositePath.length;
expandedLevel = options.oppositePath.length;
} else {
each(expandedPaths, (_, path) => {
expandLevel = Math.max(expandLevel, path.length);
expandedLevel = Math.max(expandedLevel, path.length);
});
}

while (dimensions[expandLevel + 1] && dimensions[expandLevel].expanded) {
expandLevel += 1;
while (fields[expandedLevel + 1] && fields[expandedLevel].expanded) {
expandedLevel += 1;
}

return expandLevel;
return expandedLevel;
}

function createGroupFields(item) {
Expand Down
Loading

0 comments on commit 934b23e

Please sign in to comment.