Skip to content

Commit 03a9ffc

Browse files
Fix after review: remove comments, add access modifiers, delete dead code, rename underscore-prefixed members
1 parent 0f92e68 commit 03a9ffc

5 files changed

Lines changed: 23 additions & 44 deletions

File tree

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ class SchedulerAgenda extends WorkSpace {
136136

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

139-
private updateAllDayHeight() { return noop(); }
140-
141139
protected override initWorkSpaceUnits() {
142140
this.initGroupTable();
143141
this._$timePanel = $('<table>').attr('aria-hidden', true).addClass(TIME_PANEL_CLASS);
@@ -348,8 +346,6 @@ class SchedulerAgenda extends WorkSpace {
348346

349347
protected override attachEvents() { return noop(); }
350348

351-
private cleanCellDataCache() { return noop(); }
352-
353349
isIndicationAvailable() {
354350
return false;
355351
}
@@ -536,8 +532,6 @@ class SchedulerAgenda extends WorkSpace {
536532

537533
renovatedRenderSupported() { return false; }
538534

539-
private setSelectedCellsByCellData() {}
540-
541535
protected override getTotalViewDuration() {
542536
return dateUtils.dateToMilliseconds('day') * (this.option('intervalCount') as any);
543537
}

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

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const HORIZONTAL = 'horizontal';
3535
const toMs = dateUtils.dateToMilliseconds;
3636

3737
class SchedulerTimeline extends SchedulerWorkSpace {
38-
_$sidebarTable: any;
38+
protected override $sidebarTable: any;
3939

4040
get verticalGroupTableClass() { return GROUP_TABLE_CLASS; }
4141

@@ -44,7 +44,7 @@ class SchedulerTimeline extends SchedulerWorkSpace {
4444
get renovatedHeaderPanelComponent() { return HeaderPanelTimelineComponent; }
4545

4646
getGroupTableWidth() {
47-
return this._$sidebarTable ? getOuterWidth(this._$sidebarTable) : 0;
47+
return this.$sidebarTable ? getOuterWidth(this.$sidebarTable) : 0;
4848
}
4949

5050
protected override getTotalRowCount(groupCount) {
@@ -96,19 +96,17 @@ class SchedulerTimeline extends SchedulerWorkSpace {
9696
if (this._isHorizontalGroupedWorkSpace()) {
9797
return this._$thead;
9898
}
99-
return this._$sidebarTable;
99+
return this.$sidebarTable;
100100
}
101101

102102
protected override insertAllDayRowsIntoDateTable() {
103103
return false;
104104
}
105105

106-
// Overridden in SchedulerTimelineDay, SchedulerTimelineWeek
107106
protected needRenderWeekHeader() {
108107
return false;
109108
}
110109

111-
// Overridden in SchedulerTimelineWeek, SchedulerTimelineWorkWeek
112110
protected incrementDate(date) {
113111
date.setDate(date.getDate() + 1);
114112
}
@@ -132,20 +130,19 @@ class SchedulerTimeline extends SchedulerWorkSpace {
132130
return today.getTime() - date.getTime();
133131
}
134132

135-
// Overridden in SchedulerTimelineMonth
136133
protected calculateDurationInCells(timeDiff) {
137134
const today = this.getToday();
138135
const differenceInDays = Math.floor(timeDiff / toMs('day'));
139136
let duration = (timeDiff - differenceInDays * toMs('day') - (this.option('startDayHour') as any) * toMs('hour')) / this.getCellDuration();
140137

141138
if (today.getHours() > (this.option('endDayHour') as any)) {
142-
duration = this.getCellCountInDay();
139+
duration = this._getCellCountInDay();
143140
}
144141

145142
if (duration < 0) {
146143
duration = 0;
147144
}
148-
return differenceInDays * this.getCellCountInDay() + duration;
145+
return differenceInDays * this._getCellCountInDay() + duration;
149146
}
150147

151148
getIndicationWidth() {
@@ -159,19 +156,19 @@ class SchedulerTimeline extends SchedulerWorkSpace {
159156
return this.getIndicationCellCount() * this.getCellWidth();
160157
}
161158

162-
isVerticalShader() {
159+
protected override isVerticalShader() {
163160
return false;
164161
}
165162

166-
isCurrentTimeHeaderCell() {
163+
protected override isCurrentTimeHeaderCell() {
167164
return false;
168165
}
169166

170167
protected override setTableSizes() {
171168
super.setTableSizes();
172169

173170
const minHeight = this.getWorkSpaceMinHeight();
174-
setHeight(this._$sidebarTable, minHeight);
171+
setHeight(this.$sidebarTable, minHeight);
175172
setHeight(this._$dateTable, minHeight);
176173

177174
this.virtualScrollingDispatcher.updateDimensions();
@@ -226,7 +223,7 @@ class SchedulerTimeline extends SchedulerWorkSpace {
226223
const fullDays = Math.floor(fullInterval / toMs('day'));
227224
const tailDuration = fullInterval - (fullDays * toMs('day'));
228225
let tailDelta = 0;
229-
const cellCount = this.getCellCountInDay() * (fullDays - this.getWeekendsCount(fullDays));
226+
const cellCount = this._getCellCountInDay() * (fullDays - this.getWeekendsCount(fullDays));
230227
const gapBeforeAppt = apptStart - dateUtils.trimTime(new Date(currentDate)).getTime();
231228
let result = cellCount * (this.option('hoursInterval') as any) * toMs('hour');
232229

@@ -307,7 +304,7 @@ class SchedulerTimeline extends SchedulerWorkSpace {
307304
super._init();
308305

309306
(this.$element() as any).addClass(TIMELINE_CLASS);
310-
this._$sidebarTable = $('<div>')
307+
this.$sidebarTable = $('<div>')
311308
.addClass(GROUP_TABLE_CLASS);
312309
}
313310

@@ -349,7 +346,7 @@ class SchedulerTimeline extends SchedulerWorkSpace {
349346

350347
this._shader = new HorizontalShader(this);
351348

352-
this._$sidebarTable.appendTo(this._sidebarScrollable.$content());
349+
this.$sidebarTable.appendTo(this._sidebarScrollable.$content());
353350

354351
if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) {
355352
this.renderRGroupPanel();
@@ -403,7 +400,7 @@ class SchedulerTimeline extends SchedulerWorkSpace {
403400

404401
const $cells: any[] = [];
405402
const groupCount = this._getGroupCount();
406-
const cellCountInDay = this.getCellCountInDay();
403+
const cellCountInDay = this._getCellCountInDay();
407404
const colSpan = this.isGroupedByDate()
408405
? cellCountInDay * groupCount
409406
: cellCountInDay;
@@ -455,7 +452,7 @@ class SchedulerTimeline extends SchedulerWorkSpace {
455452
}
456453
}
457454

458-
renderIndicator(height, rtlOffset, $container, groupCount) {
455+
protected override renderIndicator(height, rtlOffset, $container, groupCount) {
459456
let $indicator;
460457
const width = this.getIndicationWidth();
461458

@@ -496,7 +493,7 @@ class SchedulerTimeline extends SchedulerWorkSpace {
496493
// Old render methods.
497494
// TODO Old render: delete these methods with the old render.
498495

499-
setCurrentTimeCells(): void {
496+
protected override setCurrentTimeCells(): void {
500497
const timePanelCells = this.getTimePanelCells();
501498
const currentTimeCellIndices = this.getCurrentTimePanelCellIndices();
502499
currentTimeCellIndices.forEach((timePanelCellIndex) => {

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import registerComponent from '@js/core/component_registrator';
2-
import { getBoundingRect } from '@js/core/utils/position';
32

43
import { VIEWS } from '../utils/options/constants_view';
54
import SchedulerTimeline from './m_timeline';
@@ -13,10 +12,6 @@ export default class SchedulerTimelineWeek extends SchedulerTimeline {
1312
return TIMELINE_CLASS;
1413
}
1514

16-
_getHeaderPanelCellWidth($headerRow) {
17-
return getBoundingRect($headerRow.children().first().get(0)).width;
18-
}
19-
2015
protected override needRenderWeekHeader() {
2116
return true;
2217
}

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
298298

299299
_shader: any;
300300

301-
_$sidebarTable: any;
301+
protected $sidebarTable: any;
302302

303303
_interval: any;
304304

@@ -822,8 +822,7 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
822822
});
823823
}
824824

825-
// TODO: rename to getCellCount — used externally via workSpace reference:
826-
// m_work_space_grouped_strategy_horizontal.ts (7 usages), m_work_space_grouped_strategy_vertical.ts, shaders/current_time_shader_horizontal.ts
825+
// TODO: rename to getCellCount (used externally by strategy classes and shaders)
827826
_getCellCount() {
828827
return this.viewDataProvider.getCellCount({
829828
intervalCount: this.option('intervalCount'),
@@ -1103,10 +1102,10 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
11031102
}
11041103

11051104
protected getTimePanelRowCount() {
1106-
return this.getCellCountInDay();
1105+
return this._getCellCountInDay();
11071106
}
11081107

1109-
protected getCellCountInDay() {
1108+
protected _getCellCountInDay() {
11101109
const hoursInterval = this.option('hoursInterval');
11111110
const startDayHour = this.option('startDayHour');
11121111
const endDayHour = this.option('endDayHour');
@@ -2833,7 +2832,7 @@ class SchedulerWorkSpace extends Widget<WorkspaceOptionsInternal> {
28332832
this._$groupTable.empty();
28342833

28352834
this._$allDayTable?.empty();
2836-
this._$sidebarTable?.empty();
2835+
this.$sidebarTable?.empty();
28372836
}
28382837

28392838
this._shader?.clean();

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace {
5858
return dateUtils.dateInRange(today, firstViewDate, endViewDate);
5959
}
6060

61-
// Overridden in SchedulerTimeline
62-
renderIndicator(height, rtlOffset, $container, groupCount) {
61+
protected renderIndicator(height, rtlOffset, $container, groupCount) {
6362
const groupedByDate = this.isGroupedByDate();
6463
const repeatCount = groupedByDate ? 1 : groupCount;
6564
for (let i = 0; i < repeatCount; i++) {
@@ -103,8 +102,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace {
103102
}
104103
}
105104

106-
// Overridden in SchedulerTimeline
107-
isVerticalShader() {
105+
protected isVerticalShader() {
108106
return true;
109107
}
110108

@@ -177,8 +175,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace {
177175
this.renderDateTimeIndication();
178176
}
179177

180-
// Overridden in SchedulerTimeline
181-
isCurrentTimeHeaderCell(headerIndex: number): boolean {
178+
protected isCurrentTimeHeaderCell(headerIndex: number): boolean {
182179
if (this.isIndicationOnView()) {
183180
const { completeDateHeaderMap } = this.viewDataProvider;
184181
const date = completeDateHeaderMap[completeDateHeaderMap.length - 1][headerIndex].startDate;
@@ -254,7 +251,6 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace {
254251
});
255252
}
256253

257-
// Overridden in SchedulerTimeline
258254
protected getCurrentTimePanelCellIndices() {
259255
const rowCountPerGroup = this.getTimePanelRowCount();
260256
const today = this.getToday();
@@ -311,10 +307,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace {
311307
}
312308
}
313309

314-
// Temporary new render methods.
315310
// TODO Old render: replace base call methods by these after the deleting of the old render.
316-
// Overridden in SchedulerTimeline
317-
setCurrentTimeCells(): void {
311+
protected setCurrentTimeCells(): void {
318312
const timePanelCells = this.getTimePanelCells();
319313
const currentTimeCellIndices = this.getCurrentTimePanelCellIndices();
320314
currentTimeCellIndices.forEach((timePanelCellIndex) => {

0 commit comments

Comments
 (0)