Skip to content

Commit

Permalink
Scheduler - Appointment is rendered incorrectly in the workWeek view …
Browse files Browse the repository at this point in the history
…when the interval >= 2 (T1243027) (#27763)
  • Loading branch information
pomahtri authored Jul 22, 2024
1 parent 75574e1 commit 48a3265
Show file tree
Hide file tree
Showing 42 changed files with 68 additions and 2 deletions.
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import Scheduler from 'devextreme-testcafe-models/scheduler';
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import url from '../../../../helpers/getPageUrl';
import { createWidget } from '../../../../helpers/createWidget';
import { safeSizeTest } from '../../../../helpers/safeSizeTest';

fixture.disablePageReloads`Appointments with adaptive`
.page(url(__dirname, '../../../container.html'));

safeSizeTest('Should correctly render scheduler in workWeek view with interval, skipping weekends (T1243027)', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const scheduler = new Scheduler('#container');

await takeScreenshot('work_week_interval-2.png', scheduler.workSpace);

await t.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxScheduler', {
dataSource: [
{
startDate: '2024-01-05T01:00:00',
endDate: '2024-01-07T01:00:00',
text: 'Ends in weekend',
color: 'red',
},
{
startDate: '2024-01-07T01:00:00',
endDate: '2024-01-08T01:00:00',
text: 'Starts in weekend',
color: 'blue',
},
{
startDate: '2024-01-05T01:00:00',
endDate: '2024-01-08T01:00:00',
text: 'Goes over weekend',
color: 'green',
},
],
views: [{
name: 'myView',
type: 'workWeek',
allDayPanelMode: 'allDay',
intervalCount: 2,
maxAppointmentsPerCell: 'unlimited',
}],
currentView: 'myView',
currentDate: '2024-01-01',
height: 600,
// NOTE: resources are used only to distinguish appts in etalon file
resources: [{
fieldExpr: 'color',
dataSource: [
{ id: 'red', color: 'red' },
{ id: 'blue', color: 'blue' },
{ id: 'green', color: 'green' },
],
label: 'Room',
}],
}));
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.
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.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,14 @@ class VerticalRenderingStrategy extends BaseAppointmentsStrategy {
} = position.info.appointment;
const allDay = ExpressionUtils.getField(this.dataAccessors, 'allDay', appointment);
const duration = this.getAppointmentDurationInMs(startDate, normalizedEndDate, allDay);
const durationInMinutes = this._adjustDurationByDaylightDiff(duration, startDate, normalizedEndDate) / toMs('minute');
const skippedMinutes = getSkippedHoursInRange(
startDate,
normalizedEndDate,
appointment.allDay,
this.viewDataProvider,
) * 60;

const durationInMinutes = this._adjustDurationByDaylightDiff(duration, startDate, normalizedEndDate) / toMs('minute') - skippedMinutes;

const height = durationInMinutes * this._getMinuteHeight();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export const getSkippedHoursInRange = (
}

const startDateHours = startDate.getHours();
const endDateHours = endDate.getHours() + Math.ceil(endDate.getTime() % HOUR_IN_MS);
const endDateHours = endDate.getHours() + (endDate.getTime() % HOUR_IN_MS) / HOUR_IN_MS;

if (viewDataProvider.isSkippedDate(startDate)) {
if (isAllDay) {
Expand Down

0 comments on commit 48a3265

Please sign in to comment.