Skip to content

Commit 3d07c63

Browse files
Merge branch '25_1' into 25_1_ng_leak_click
2 parents 8a893e7 + d0d0abb commit 3d07c63

File tree

7 files changed

+166
-22
lines changed

7 files changed

+166
-22
lines changed

apps/demos/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"stylelint-config-recommended-vue": "1.5.0",
143143
"stylelint-config-standard": "35.0.0",
144144
"systemjs-builder": "0.16.15",
145-
"testcafe": "2.6.2",
145+
"testcafe": "3.7.2",
146146
"ts-node": "10.9.2",
147147
"vue-tsc": "^3.0.6"
148148
},

apps/demos/utils/visual-tests/testcafe-runner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ async function main() {
221221
.concurrency(concurrency || 1)
222222
.run({
223223
quarantineMode: process.env.TCQUARANTINE ? { successThreshold: 1, attemptLimit: 5 } : false,
224+
disableNativeAutomation: true,
224225
});
225226

226227
await tester.close();
35.9 KB
Loading
36.3 KB
Loading

e2e/testcafe-devextreme/tests/scheduler/common/header/header.ts

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
12
import Scheduler from 'devextreme-testcafe-models/scheduler';
23
import { createWidget } from '../../../../helpers/createWidget';
34
import url from '../../../../helpers/getPageUrl';
5+
import { insertStylesheetRulesToPage, removeStylesheetRulesFromPage } from '../../../../helpers/domUtils';
46

57
fixture.disablePageReloads`Scheduler header`
68
.page(url(__dirname, '../../../container.html'));
@@ -42,3 +44,144 @@ test('dateNavigator buttons should have "contained" styling mode with generic th
4244
views: ['day'],
4345
height: 580,
4446
}));
47+
48+
const testData = [
49+
{
50+
text: 'Website Re-Design Plan',
51+
startDate: new Date('2021-03-29T16:30:00.000Z'),
52+
endDate: new Date('2021-03-29T18:30:00.000Z'),
53+
}, {
54+
text: 'Book Flights to San Fran for Sales Trip',
55+
startDate: new Date('2021-03-29T19:00:00.000Z'),
56+
endDate: new Date('2021-03-29T20:00:00.000Z'),
57+
allDay: true,
58+
}, {
59+
text: 'Install New Router in Dev Room',
60+
startDate: new Date('2021-03-29T21:30:00.000Z'),
61+
endDate: new Date('2021-03-29T22:30:00.000Z'),
62+
}, {
63+
text: 'Approve Personal Computer Upgrade Plan',
64+
startDate: new Date('2021-03-30T17:00:00.000Z'),
65+
endDate: new Date('2021-03-30T18:00:00.000Z'),
66+
}, {
67+
text: 'Final Budget Review',
68+
startDate: new Date('2021-03-30T19:00:00.000Z'),
69+
endDate: new Date('2021-03-30T20:35:00.000Z'),
70+
}, {
71+
text: 'New Brochures',
72+
startDate: new Date('2021-03-30T21:30:00.000Z'),
73+
endDate: new Date('2021-03-30T22:45:00.000Z'),
74+
}, {
75+
text: 'Install New Database',
76+
startDate: new Date('2021-03-31T16:45:00.000Z'),
77+
endDate: new Date('2021-03-31T18:15:00.000Z'),
78+
}, {
79+
text: 'Approve New Online Marketing Strategy',
80+
startDate: new Date('2021-03-31T19:00:00.000Z'),
81+
endDate: new Date('2021-03-31T21:00:00.000Z'),
82+
}, {
83+
text: 'Upgrade Personal Computers',
84+
startDate: new Date('2021-03-31T22:15:00.000Z'),
85+
endDate: new Date('2021-03-31T23:30:00.000Z'),
86+
}, {
87+
text: 'Customer Workshop',
88+
startDate: new Date('2021-04-01T18:00:00.000Z'),
89+
endDate: new Date('2021-04-01T19:00:00.000Z'),
90+
allDay: true,
91+
}, {
92+
text: 'Prepare 2021 Marketing Plan',
93+
startDate: new Date('2021-04-01T18:00:00.000Z'),
94+
endDate: new Date('2021-04-01T20:30:00.000Z'),
95+
}, {
96+
text: 'Brochure Design Review',
97+
startDate: new Date('2021-04-01T21:00:00.000Z'),
98+
endDate: new Date('2021-04-01T22:30:00.000Z'),
99+
}, {
100+
text: 'Create Icons for Website',
101+
startDate: new Date('2021-04-02T17:00:00.000Z'),
102+
endDate: new Date('2021-04-02T18:30:00.000Z'),
103+
}, {
104+
text: 'Upgrade Server Hardware',
105+
startDate: new Date('2021-04-02T21:30:00.000Z'),
106+
endDate: new Date('2021-04-02T23:00:00.000Z'),
107+
}, {
108+
text: 'Submit New Website Design',
109+
startDate: new Date('2021-04-02T23:30:00.000Z'),
110+
endDate: new Date('2021-04-03T01:00:00.000Z'),
111+
}, {
112+
text: 'Launch New Website',
113+
startDate: new Date('2021-04-02T19:20:00.000Z'),
114+
endDate: new Date('2021-04-02T21:00:00.000Z'),
115+
},
116+
];
117+
118+
const SCROLLBAR_STYLES = `
119+
::-webkit-scrollbar {
120+
-webkit-appearance: none;
121+
width: 7px;
122+
}
123+
::-webkit-scrollbar-thumb {
124+
border-radius: 4px;
125+
background-color: rgba(0, 0, 0, .5);
126+
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
127+
}
128+
.dx-scheduler-date-table-scrollable .dx-scrollable-container {
129+
overflow: scroll !important;
130+
}
131+
`;
132+
133+
test('Scheduler: maintain layout after horizontal scroll (T1306971)', async (t) => {
134+
const {
135+
takeScreenshot,
136+
compareResults,
137+
} = createScreenshotsComparer(t);
138+
const scheduler = new Scheduler('#container');
139+
140+
await insertStylesheetRulesToPage(SCROLLBAR_STYLES);
141+
142+
await t.wait(100);
143+
144+
await scheduler.repaint();
145+
146+
await t.wait(100);
147+
148+
await t.expect(
149+
await takeScreenshot('T1306971__scheduler__horizontal-scrolling__before.png', scheduler.element),
150+
).ok();
151+
152+
const container = scheduler.dateTableScrollableContainer;
153+
const scrollWidth = await container.scrollWidth;
154+
const clientWidth = await container.clientWidth;
155+
const maxScrollLeft = scrollWidth - clientWidth;
156+
157+
await t.scroll(scheduler.workspaceScrollable, maxScrollLeft, 0);
158+
159+
const finalScrollLeft = await container.scrollLeft;
160+
161+
await t
162+
.expect(maxScrollLeft).gt(0, 'No horizontal scroll available')
163+
.expect(finalScrollLeft).gt(0, 'Scroll position should be greater than 0');
164+
165+
await t.wait(500);
166+
167+
await t.expect(
168+
await takeScreenshot('T1306971__scheduler__horizontal-scrolling__after.png', scheduler.element),
169+
).ok();
170+
171+
await t.expect(compareResults.isValid())
172+
.ok(compareResults.errorMessages());
173+
}).before(async () => {
174+
await createWidget('dxScheduler', {
175+
timeZone: 'America/Los_Angeles',
176+
dataSource: testData,
177+
views: ['week'],
178+
currentView: 'week',
179+
currentDate: new Date(2021, 2, 28),
180+
startDayHour: 9,
181+
height: 730,
182+
crossScrollingEnabled: true,
183+
width: 500,
184+
});
185+
}).after(async () => {
186+
await removeStylesheetRulesFromPage();
187+
});

packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
import { isDefined } from '@js/core/utils/type';
3030
import { getWindow, hasWindow } from '@js/core/utils/window';
3131
import type { dxSchedulerOptions } from '@js/ui/scheduler';
32-
import Scrollable from '@js/ui/scroll_view/ui.scrollable';
3332
import errors from '@js/ui/widget/ui.errors';
3433
import Widget from '@js/ui/widget/ui.widget';
3534
import { getMemoizeScrollTo } from '@ts/core/utils/scroll';
@@ -51,6 +50,7 @@ import {
5150
isDateAndTimeView,
5251
} from '@ts/scheduler/r1/utils/index';
5352
import type { SafeAppointment, ViewType } from '@ts/scheduler/types';
53+
import Scrollable from '@ts/ui/scroll_view/scrollable';
5454

5555
import type NotifyScheduler from '../base/m_widget_notify_scheduler';
5656
import { APPOINTMENT_SETTINGS_KEY } from '../constants';
@@ -213,7 +213,7 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
213213

214214
_cellsSelectionController: any;
215215

216-
_dateTableScrollable: any;
216+
_dateTableScrollable!: Scrollable;
217217

218218
_selectionChangedAction: any;
219219

@@ -909,6 +909,19 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
909909
}
910910
}
911911

912+
updateHeaderPanelScrollbarPadding() {
913+
if (hasWindow() && this._$headerPanelContainer) {
914+
const scrollbarWidth = this._getScrollbarWidth();
915+
this._$headerPanelContainer.css('paddingRight', `${scrollbarWidth}px`);
916+
}
917+
}
918+
919+
_getScrollbarWidth() {
920+
const containerElement = $(this._dateTableScrollable.container()).get(0) as HTMLElement;
921+
const scrollbarWidth = containerElement.offsetWidth - containerElement.clientWidth;
922+
return scrollbarWidth;
923+
}
924+
912925
_isGroupsSpecified(groupValues?: GroupValues) {
913926
return this.option('groups')?.length && groupValues;
914927
}
@@ -1074,6 +1087,7 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
10741087
this._dateTableScrollable.update();
10751088
this._headerScrollable?.update();
10761089
this._sidebarScrollable?.update();
1090+
this.updateHeaderPanelScrollbarPadding();
10771091
}
10781092

10791093
_getTimePanelRowCount() {

pnpm-lock.yaml

Lines changed: 5 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)