Skip to content

Commit 62c1362

Browse files
Scheduler - Remove old render and renovateRender option
1 parent 2972b94 commit 62c1362

12 files changed

Lines changed: 25 additions & 516 deletions

File tree

packages/devextreme/js/__internal/scheduler/m_scheduler.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,6 @@ class Scheduler extends SchedulerOptionsBaseWidget {
578578
this.updateAppointmentDataSource();
579579
this.updateOption('workSpace', args.fullName, value);
580580
break;
581-
case 'renovateRender':
582-
this.updateOption('workSpace', name, value);
583-
break;
584581
case '_draggingMode':
585582
this.updateOption('workSpace', 'draggingMode', value);
586583
break;
@@ -1482,8 +1479,6 @@ class Scheduler extends SchedulerOptionsBaseWidget {
14821479
getHeaderHeight: () => utils.DOM.getHeaderHeight(this.header),
14831480
onScrollEnd: () => this._appointments.updateResizableArea(),
14841481

1485-
// TODO: SSR does not work correctly with renovated render
1486-
renovateRender: this.isRenovatedRender(isVirtualScrolling),
14871482
}, currentViewOptions);
14881483

14891484
result.notifyScheduler = this.notifyScheduler;
@@ -1502,10 +1497,6 @@ class Scheduler extends SchedulerOptionsBaseWidget {
15021497
return result;
15031498
}
15041499

1505-
private isRenovatedRender(isVirtualScrolling) {
1506-
return (this.option('renovateRender') && hasWindow()) || isVirtualScrolling;
1507-
}
1508-
15091500
private waitAsyncTemplate(callback) {
15101501
if (this._options.silent('templatesRenderAsynchronously')) {
15111502
const timer = setTimeout(() => {

packages/devextreme/js/__internal/scheduler/utils/options/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export const DEFAULT_SCHEDULER_OPTIONS: Properties = {
102102

103103
export const DEFAULT_SCHEDULER_INTERNAL_OPTIONS: SchedulerInternalOptions = {
104104
indicatorTime: undefined,
105-
renovateRender: true,
106105
editing: {
107106
// @ts-expect-error copy from default so that you can rewrite it
108107
...DEFAULT_SCHEDULER_OPTIONS.editing,

packages/devextreme/js/__internal/scheduler/utils/options/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export type NormalizedView = View | AgendaView;
2222

2323
export interface SchedulerInternalOptions {
2424
indicatorTime?: Date;
25-
renovateRender: boolean;
2625
editing: Properties['editing'];
2726
_draggingMode: 'outlook' | 'default';
2827
// TODO: legacy option property name

packages/devextreme/js/__internal/scheduler/workspaces/helpers/m_position_helper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export const getGroupWidth = (groupIndex, viewDataProvider, options) => {
7676

7777
const cellWidth = getCellWidth(DOMMetaData);
7878
let result = viewDataProvider.getCellCount(options) * cellWidth;
79-
// TODO: refactor after deleting old render
8079
if (isVirtualScrolling) {
8180
const groupedData = viewDataProvider.groupedDataMap.dateTableGroupedMap;
8281
const groupLength = groupedData[groupIndex][0].length;

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class SchedulerAgenda extends WorkSpace {
132132
return this.option('agendaDuration') as number;
133133
}
134134

135-
protected override renderAllDayPanel() { return noop(); }
135+
protected renderAllDayPanel() { return noop(); }
136136

137137
protected override updateAllDayVisibility() { return noop(); }
138138

@@ -337,7 +337,7 @@ class SchedulerAgenda extends WorkSpace {
337337
this.$element().append(this._dateTableScrollable.$element());
338338
}
339339

340-
protected override renderDateTable() {
340+
protected renderDateTable() {
341341
this.renderTableBody({
342342
container: getPublicElement(this._$dateTable),
343343
rowClass: DATE_TABLE_ROW_CLASS,
@@ -371,7 +371,7 @@ class SchedulerAgenda extends WorkSpace {
371371
}
372372

373373
// eslint-disable-next-line @typescript-eslint/no-unused-vars
374-
protected override renderTableBody(options: any, delayCellTemplateRendering?: any) {
374+
protected renderTableBody(options: any, delayCellTemplateRendering?: any) {
375375
const cellTemplates: any[] = [];
376376
const cellTemplateOpt = options.cellTemplate;
377377

@@ -431,7 +431,7 @@ class SchedulerAgenda extends WorkSpace {
431431
}
432432
}
433433

434-
protected override renderTimePanel() {
434+
protected renderTimePanel() {
435435
this.renderTableBody({
436436
container: getPublicElement(this.$timePanel),
437437
rowCount: this.getTimePanelRowCount(),
@@ -532,6 +532,8 @@ class SchedulerAgenda extends WorkSpace {
532532

533533
renovatedRenderSupported() { return false; }
534534

535+
override isVirtualScrolling() { return false; }
536+
535537
protected override getTotalViewDuration() {
536538
return dateUtils.dateToMilliseconds('day') * (this.option('intervalCount') as any);
537539
}

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

Lines changed: 3 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ import { getOuterHeight, getOuterWidth, setHeight } from '@js/core/utils/size';
88
import { hasWindow } from '@js/core/utils/window';
99
// NOTE: Renovation component import.
1010
import { HeaderPanelTimelineComponent } from '@ts/scheduler/r1/components/index';
11-
import { formatWeekdayAndDay, timelineWeekUtils } from '@ts/scheduler/r1/utils/index';
11+
import { timelineWeekUtils } from '@ts/scheduler/r1/utils/index';
1212

1313
import {
1414
GROUP_HEADER_CONTENT_CLASS,
1515
GROUP_ROW_CLASS,
16-
HEADER_CURRENT_TIME_CELL_CLASS,
1716
} from '../m_classes';
1817
import tableCreatorModule from '../m_table_creator';
1918
import timezoneUtils from '../m_utils_time_zone';
@@ -30,7 +29,6 @@ const HORIZONTAL_GROUPED_WORKSPACE_CLASS = 'dx-scheduler-work-space-horizontal-g
3029

3130
const HEADER_PANEL_CELL_CLASS = 'dx-scheduler-header-panel-cell';
3231
const HEADER_PANEL_WEEK_CELL_CLASS = 'dx-scheduler-header-panel-week-cell';
33-
const HEADER_ROW_CLASS = 'dx-scheduler-header-row';
3432

3533
const HORIZONTAL = 'horizontal';
3634
const toMs = dateUtils.dateToMilliseconds;
@@ -298,8 +296,6 @@ class SchedulerTimeline extends SchedulerWorkSpace {
298296

299297
renderRTimeTable() {}
300298

301-
protected override renderGroupAllDayPanel() {}
302-
303299
// eslint-disable-next-line @typescript-eslint/no-unused-vars
304300
generateRenderOptions(argument?: any) {
305301
const options = super.generateRenderOptions(true);
@@ -348,28 +344,18 @@ class SchedulerTimeline extends SchedulerWorkSpace {
348344
}
349345

350346
protected override renderView() {
351-
let groupCellTemplates;
352-
if (!this.isRenovatedRender()) {
353-
groupCellTemplates = this.renderGroupHeader();
354-
}
355-
356347
this.renderWorkSpace();
357-
358-
if (this.isRenovatedRender()) {
359-
this.virtualScrollingDispatcher.updateDimensions();
360-
}
348+
this.virtualScrollingDispatcher.updateDimensions();
361349

362350
this._shader = new HorizontalShader(this);
363351

364352
this.$sidebarTable.appendTo(this._sidebarScrollable.$content());
365353

366-
if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) {
354+
if (this.isVerticalGroupedWorkSpace()) {
367355
this.renderRGroupPanel();
368356
}
369357

370358
this.updateHeaderEmptyCellWidth();
371-
372-
this.applyCellTemplates(groupCellTemplates);
373359
}
374360

375361
protected override setHorizontalGroupHeaderCellsHeight() { return noop(); }
@@ -397,76 +383,6 @@ class SchedulerTimeline extends SchedulerWorkSpace {
397383
.map((_, groupIndex) => columnCountPerGroup * groupIndex + currentTimeColumnIndex);
398384
}
399385

400-
// --------------
401-
// These methods should be deleted when we get rid of old render
402-
// --------------
403-
404-
protected override renderTimePanel() { return noop(); }
405-
406-
protected override renderAllDayPanel() { return noop(); }
407-
408-
protected override createAllDayPanelElements() { return noop(); }
409-
410-
protected override renderDateHeader() {
411-
const $headerRow = super.renderDateHeader();
412-
if (this.needRenderWeekHeader()) {
413-
const firstViewDate = new Date(this.getStartViewDate());
414-
let currentDate = new Date(firstViewDate);
415-
416-
const $cells: any[] = [];
417-
const groupCount = this._getGroupCount();
418-
const cellCountInDay = this.getCellCountInDay();
419-
const colSpan = this.isGroupedByDate()
420-
? cellCountInDay * groupCount
421-
: cellCountInDay;
422-
const cellTemplate: any = this.option('dateCellTemplate');
423-
424-
const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()
425-
? groupCount
426-
: 1;
427-
const cellsInGroup = this.viewDataProvider.viewDataGenerator.daysInInterval * (this.option('intervalCount') as any);
428-
429-
const cellsCount = cellsInGroup * horizontalGroupCount;
430-
431-
for (let templateIndex = 0; templateIndex < cellsCount; templateIndex++) {
432-
const $th = $('<th>');
433-
const text = formatWeekdayAndDay(currentDate);
434-
435-
if (cellTemplate) {
436-
const templateOptions = {
437-
model: {
438-
text,
439-
date: new Date(currentDate),
440-
...this.getGroupsForDateHeaderTemplate(templateIndex, colSpan),
441-
},
442-
container: $th,
443-
index: templateIndex,
444-
};
445-
446-
cellTemplate.render(templateOptions);
447-
} else {
448-
$th.text(text);
449-
}
450-
451-
$th
452-
.addClass(HEADER_PANEL_CELL_CLASS)
453-
.addClass(HEADER_PANEL_WEEK_CELL_CLASS)
454-
.attr('colSpan', colSpan);
455-
456-
$cells.push($th);
457-
458-
if ((templateIndex % cellsInGroup) === (cellsInGroup - 1)) {
459-
currentDate = new Date(firstViewDate);
460-
} else {
461-
this.incrementDate(currentDate);
462-
}
463-
}
464-
465-
const $row = $('<tr>').addClass(HEADER_ROW_CLASS).append($cells as any);
466-
$headerRow.before($row);
467-
}
468-
}
469-
470386
protected override renderIndicator(height, rtlOffset, $container, groupCount) {
471387
let $indicator;
472388
const width = this.getIndicationWidth();
@@ -504,18 +420,6 @@ class SchedulerTimeline extends SchedulerWorkSpace {
504420
groupByDate,
505421
);
506422
}
507-
508-
// Old render methods.
509-
// TODO Old render: delete these methods with the old render.
510-
511-
protected override setCurrentTimeCells(): void {
512-
const timePanelCells = this.getTimePanelCells();
513-
const currentTimeCellIndices = this.getCurrentTimePanelCellIndices();
514-
currentTimeCellIndices.forEach((timePanelCellIndex) => {
515-
timePanelCells.eq(timePanelCellIndex)
516-
.addClass(HEADER_CURRENT_TIME_CELL_CLASS);
517-
});
518-
}
519423
}
520424

521425
registerComponent('dxSchedulerTimeline', SchedulerTimeline as any);

0 commit comments

Comments
 (0)