Skip to content

Commit

Permalink
Merge branch '24_2' into grids/cardview/draft
Browse files Browse the repository at this point in the history
  • Loading branch information
pomahtri committed Aug 29, 2024
2 parents 612d263 + 2d7156c commit 2359f1b
Show file tree
Hide file tree
Showing 163 changed files with 6,118 additions and 3,235 deletions.
2 changes: 2 additions & 0 deletions .github/actions/setup-chrome/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ runs:
CHROME_VERSION: ${{ inputs.chrome-version }}
run: |
if [ -n "$CHROME_VERSION" ]; then
sudo apt-get update
sudo apt-get install libu2f-udev
curl -L "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" > /tmp/chrome.deb
sudo dpkg -i /tmp/chrome.deb
unlink /tmp/chrome.deb
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_security-alerts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: |
RESPONSE=$(curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.TOKEN }}" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/dependabot/alerts?state=open)
echo 'ALERTS<<EOF' >> $GITHUB_OUTPUT
echo $RESPONSE >> $GITHUB_OUTPUT
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/testcafe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ jobs:
{ componentFolder: "filterBuilder", name: "filterBuilder" },
{ componentFolder: "filterBuilder", name: "filterBuilder - material", theme: 'material.blue.light' },
{ componentFolder: "filterBuilder", name: "filterBuilder - fluent", theme: 'fluent.blue.light' },
{ componentFolder: "pager", name: "pager" },
{ componentFolder: "pager", name: "pager - material", theme: 'material.blue.light' },
{ componentFolder: "pager", name: "pager - fluent", theme: 'fluent.blue.light' },
]
runs-on: devextreme-shr2
timeout-minutes: 90
Expand Down
1 change: 1 addition & 0 deletions apps/demos/configs/Angular/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ window.config = {
/* devextreme-angular umd maps */
'devextreme-angular': 'bundles:devextreme-angular/devextreme-angular.umd.js',
'devextreme-angular/core': 'bundles:devextreme-angular/devextreme-angular-core.umd.js',
'devextreme-angular/http': 'bundles:devextreme-angular/devextreme-angular-http.umd.js',
...componentNames.reduce((acc, name) => {
acc[`devextreme-angular/ui/${name}`] = `bundles:devextreme-angular/devextreme-angular-ui-${name}.umd.js`;
return acc;
Expand Down
13 changes: 7 additions & 6 deletions apps/demos/rollup.devextreme-angular.umd.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ const componentNames = fs.readdirSync(baseDir)
.map((fileName) => fileName.replace('.mjs.map', ''));

const inputs = {
'devextreme-angular-core': `${baseDir}devextreme-angular-core.mjs`,
'devextreme-angular': `${baseDir}devextreme-angular.mjs`,
...componentNames.reduce((acc, name) => {
acc[name] = `${baseDir}${name}.mjs`;
'devextreme-angular': `${baseDir}devextreme-angular.mjs`,
'devextreme-angular-core': `${baseDir}devextreme-angular-core.mjs`,
'devextreme-angular-http': `${baseDir}devextreme-angular-http.mjs`,
...componentNames.reduce((acc, name) => {
acc[name] = `${baseDir}${name}.mjs`;

return acc;
}, {}),
return acc;
}, {}),
};

const getLibName = (file) => file
Expand Down
6 changes: 0 additions & 6 deletions apps/demos/testing/common.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ const SKIPPED_TESTS = {
{ demo: 'TaskTemplate', themes: [THEME.generic, THEME.material, THEME.fluent] },
{ demo: 'Validation', themes: [THEME.generic, THEME.material, THEME.fluent] },
],
DataGrid: [
{ demo: 'RightToLeftSupport', themes: [THEME.generic, THEME.material, THEME.fluent] },
],
},
Angular: {
DataGrid: [
Expand All @@ -79,7 +76,6 @@ const SKIPPED_TESTS = {
{ demo: 'CellEditingAndEditingAPI', themes: [THEME.material] },
{ demo: 'MultipleRecordSelectionAPI', themes: [THEME.material] },
{ demo: 'RemoteGrouping', themes: [THEME.generic] },
{ demo: 'RightToLeftSupport', themes: [THEME.generic, THEME.material, THEME.fluent] },
],
Charts: [
{ demo: 'Overview', themes: [THEME.material] },
Expand Down Expand Up @@ -147,7 +143,6 @@ const SKIPPED_TESTS = {
{ demo: 'ToolbarCustomization', themes: [THEME.fluent, THEME.material] },
{ demo: 'MultipleRecordSelectionAPI', themes: [THEME.material] },
{ demo: 'CellEditingAndEditingAPI', themes: [THEME.material] },
{ demo: 'RightToLeftSupport', themes: [THEME.generic, THEME.material, THEME.fluent] },
],
Gantt: [
{ demo: 'Validation', themes: [THEME.generic, THEME.material, THEME.fluent] },
Expand Down Expand Up @@ -210,7 +205,6 @@ const SKIPPED_TESTS = {
{ demo: 'CellEditingAndEditingAPI', themes: [THEME.material] },
{ demo: 'PopupEditing', themes: [THEME.generic] },
{ demo: 'RecordPaging', themes: [THEME.generic] },
{ demo: 'RightToLeftSupport', themes: [THEME.generic, THEME.material, THEME.fluent] },
],
FieldSet: [
{ demo: 'Overview', themes: [THEME.fluent] },
Expand Down
Binary file modified apps/demos/testing/etalons/Gantt-FilterRow (fluent.blue.light).png
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.
Binary file modified apps/demos/testing/etalons/Gantt-FilterRow.png
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.
Binary file modified apps/demos/testing/etalons/Scheduler-Adaptability.png
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.
29 changes: 29 additions & 0 deletions e2e/testcafe-devextreme/tests/dataGrid/focus/focus.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import DataGrid from 'devextreme-testcafe-models/dataGrid';
import { ClientFunction } from 'testcafe';
import FilterTextBox from 'devextreme-testcafe-models/dataGrid/editors/filterTextBox';
import { createWidget } from '../../../helpers/createWidget';
import url from '../../../helpers/getPageUrl';

Expand Down Expand Up @@ -148,3 +149,31 @@ test('Should remove dx-focused class on blur event from the cell', async (t) =>
})();
});
});

test('DataGrid - FilterRow cell loses focus when focusedRowEnabled is true and editing is in batch mode (T1246926)', async (t) => {
const dataGrid = new DataGrid('#container');
const filterEditor = dataGrid.getFilterEditor(0, FilterTextBox).getInput();

await t
.click(dataGrid.getDataCell(0, 0).element)
.click(filterEditor)
.expect(filterEditor.focused)
.ok();
}).before(async () => createWidget('dxDataGrid', {
dataSource: [
{
ID: 1,
FirstName: 'John',
},
],
keyExpr: 'ID',
filterRow: {
visible: true,
},
focusedRowEnabled: true,
editing: {
mode: 'batch',
allowUpdating: true,
},
columns: ['FirstName'],
}));
8 changes: 4 additions & 4 deletions e2e/testcafe-devextreme/tests/dataGrid/pager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ safeSizeTest('Full size pager', async (t) => {
.ok('page size 5 selected')
.expect(pager.getNavPage('6').selected)
.ok('page 6 selected')
.expect(pager.infoText.textContent)
.expect(pager.getInfoText().textContent)
.eql('Page 6 of 20 (100 items)')
.expect(dataGrid.getDataCell(29, 2).element.textContent)
.eql('29');
Expand All @@ -50,17 +50,17 @@ safeSizeTest('Full size pager', async (t) => {
.click(pager.getNavPage('7').element)
.expect(dataGrid.getDataCell(10 * 7 - 1, 2).element.textContent)
.eql('69')
.expect(pager.infoText.textContent)
.expect(pager.getInfoText().textContent)
.eql('Page 7 of 10 (100 items)');
// navigate to prev page (6)
await t
.click(pager.getPrevNavButton().element)
.expect(pager.infoText.textContent)
.expect(pager.getInfoText().textContent)
.eql('Page 6 of 10 (100 items)');
// navigate to next page (7)
await t
.click(pager.getNextNavButton().element)
.expect(pager.infoText.textContent)
.expect(pager.getInfoText().textContent)
.eql('Page 7 of 10 (100 items)')
.expect(await compareScreenshot(t, 'pager-full-allpages.png'))
.ok();
Expand Down
93 changes: 93 additions & 0 deletions e2e/testcafe-devextreme/tests/dataGrid/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,96 @@ test('Select rows by shift should work when grid has real time updates', async (
pageSize: 10,
},
}));

// --- T1234676 ---

const data = [
{ ID: 'aaa', Name: 'Name 1' },
{ ID: 'AAA', Name: 'Name 2' },
{ ID: 'BBB', Name: 'Name 3' },
];
const DATA_GRID_SELECTOR = '#container';
(['base', undefined] as ('base' | undefined)[]).forEach((sensitivity) => {
test(`Deferred selection should work correctly with deferred sensitivity: ${sensitivity}`, async (t) => {
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
const checkBoxCell = dataGrid.getDataCell(0, 0);
const firstRow = dataGrid.getDataRow(0);
const secondRow = dataGrid.getDataRow(1);

await t.click(checkBoxCell.element);

await t
.expect(firstRow.isSelected).ok()
.expect(secondRow.isSelected).ok();
}).before(() => createWidget('dxDataGrid', {
dataSource: data,
keyExpr: 'ID',
columns: ['ID', 'Name'],
showBorders: true,
selection: {
mode: 'multiple',
deferred: true,
sensitivity,
},
}));
});

test('Deferred selection should work correctly with deferred sensitivity: \'case\'', async (t) => {
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
const checkBoxCell = dataGrid.getDataCell(0, 0);
const firstRow = dataGrid.getDataRow(0);
const secondRow = dataGrid.getDataRow(1);

await t.click(checkBoxCell.element);

await t
.expect(firstRow.isSelected).ok()
.expect(secondRow.isSelected).notOk();
}).before(() => createWidget('dxDataGrid', {
dataSource: data,
keyExpr: 'ID',
columns: ['ID', 'Name'],
showBorders: true,
selection: {
mode: 'multiple',
deferred: true,
sensitivity: 'case',
},
}));

test('Sensitivity option change should be correctly handled during runtime change', async (t) => {
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
const checkBoxCell = dataGrid.getDataCell(0, 0);
const firstRow = dataGrid.getDataRow(0);
const secondRow = dataGrid.getDataRow(1);

await t.click(checkBoxCell.element);

await t
.expect(firstRow.isSelected).ok()
.expect(secondRow.isSelected).ok();

await dataGrid.apiChangeSensitivity('case');

await t
.expect(firstRow.isSelected).notOk()
.expect(secondRow.isSelected).notOk();

await t.click(checkBoxCell.element);

await t
.expect(firstRow.isSelected).ok()
.expect(secondRow.isSelected).notOk();
}).before(() => createWidget('dxDataGrid', {
dataSource: data,
keyExpr: 'ID',
columns: ['ID', 'Name'],
showBorders: true,
selection: {
mode: 'multiple',
deferred: true,
sensitivity: 'base',
},
}));

// ---
67 changes: 67 additions & 0 deletions e2e/testcafe-devextreme/tests/pager/accessibility.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import Pager from 'devextreme-testcafe-models/pager';
import url from '../../helpers/getPageUrl';
import { testAccessibility, Configuration } from '../../helpers/accessibility/test';
import { Options } from '../../helpers/generateOptionMatrix';

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

const options: Options<any> = {
// disabled: [true, false], //not supported
displayMode: ['full', 'compact'],
infoText: [undefined, 'Total {2} items. Page {0} of {1}'],
pageCount: [10, 100],
pageSizes: [[1, 2, 3], [3, 6, 9]],
showInfo: [true, false],
showNavigationButtons: [true, false],
showPageSizeSelector: [true, false],
visible: [true],
};

const defaultCreated = async (): Promise<void> => {};
const created = async (t: TestController, optionConfiguration): Promise<void> => {
const {
visible,
displayMode,
infoText,
pageCount,
pageSizes,
showInfo,
showNavigationButtons,
showPageSizeSelector,
} = optionConfiguration;

if (!visible) {
return;
}

const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const pager = new Pager('#container');
await t
.expect(await takeScreenshot(`pager-dm_${displayMode}-`
+ `${infoText ? 'has' : 'has_no'}_it-`
+ `pc_${pageCount}-`
+ `ps_${pageSizes[0]}_${pageSizes[1]}_${pageSizes[2]}-`
+ `si_${showInfo.toString()}-`
+ `snb_${showNavigationButtons.toString()}-`
+ `spss_${showPageSizeSelector.toString()}`
+ '.png', pager.element))
.ok()
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
};

const a11yCheckConfig = {
// NOTE: color-contrast issues
rules: { 'color-contrast': { enabled: false } },
};

const configuration: Configuration = {
component: 'dxPager',
a11yCheckConfig,
options,
created: defaultCreated || created, // Waiting pager specification
};

testAccessibility(configuration);
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.
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.
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.
15 changes: 11 additions & 4 deletions packages/devextreme-angular/src/http/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import { NgModule } from '@angular/core';
import { NgModule, Injector, createNgModuleRef } from '@angular/core';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import devextremeAjax from 'devextreme/core/utils/ajax';
// eslint-disable-next-line import/named
import { sendRequestFactory } from './ajax';

@NgModule({
exports: [],
imports: [HttpClientModule],
imports: [],
providers: [],
})
export class DxHttpModule {
constructor(httpClient: HttpClient) {
constructor(injector: Injector) {
let httpClient: HttpClient = injector.get(HttpClient, null);

if (!httpClient) {
const moduleRef = createNgModuleRef(HttpClientModule, injector);

httpClient = moduleRef.injector.get(HttpClient);
}

devextremeAjax.inject({ sendRequest: sendRequestFactory(httpClient) });
}
}
Loading

0 comments on commit 2359f1b

Please sign in to comment.