').appendTo(this.mainContainer);
+ const headerOptions = this.headerConfig();
// @ts-expect-error
- this._header = this._createComponent($header, SchedulerHeader, headerOptions);
+ this.header = this._createComponent($header, SchedulerHeader, headerOptions);
}
}
- _headerConfig(): HeaderOptions {
+ private headerConfig(): HeaderOptions {
return {
currentView: this.currentView,
views: this.views,
@@ -1230,23 +1230,23 @@ class Scheduler extends SchedulerOptionsBaseWidget {
};
}
- _appointmentsConfig() {
+ private appointmentsConfig() {
const config = {
getResourceManager: () => this.resourceManager,
getAppointmentDataSource: () => this.appointmentDataSource,
dataAccessors: this._dataAccessors,
- notifyScheduler: this._notifyScheduler,
- onItemRendered: this._getAppointmentRenderedAction(),
+ notifyScheduler: this.notifyScheduler,
+ onItemRendered: this.getAppointmentRenderedAction(),
onItemClick: this._createActionByOption('onAppointmentClick'),
onItemContextMenu: this._createActionByOption('onAppointmentContextMenu'),
onAppointmentDblClick: this._createActionByOption('onAppointmentDblClick'),
tabIndex: this.option('tabIndex'),
focusStateEnabled: this.option('focusStateEnabled'),
- allowDrag: this._allowDragging(),
- allowDelete: this._editing.allowUpdating && this._editing.allowDeleting,
- allowResize: this._allowResizing(),
- allowAllDayResize: this._allowAllDayResizing(),
+ allowDrag: this.allowDragging(),
+ allowDelete: this.editing.allowUpdating && this.editing.allowDeleting,
+ allowResize: this.allowResizing(),
+ allowAllDayResize: this.allowAllDayResizing(),
rtlEnabled: this.option('rtlEnabled'),
groups: this.getViewOption('groups'),
timeZoneCalculator: this.timeZoneCalculator,
@@ -1256,7 +1256,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
isVerticalGroupedWorkSpace: () => this._workSpace.isVerticalGroupedWorkSpace(),
isDateAndTimeView: () => isDateAndTimeView(this._workSpace.type),
onContentReady: () => {
- this._workSpace?.option('allDayExpanded', this._isAllDayExpanded());
+ this._workSpace?.option('allDayExpanded', this.isAllDayExpanded());
},
};
@@ -1274,48 +1274,48 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return this.getViewOption('cellDuration');
}
- _renderWorkSpace() {
+ private renderWorkSpace() {
const currentViewOptions = this.currentView;
if (!currentViewOptions) {
return;
}
- if (this._readyToRenderAppointments) {
- this._toggleSmallClass();
+ if (this.readyToRenderAppointments) {
+ this.toggleSmallClass();
// TODO(9): Get rid of it as soon as you can. Workspace didn't render
Promise.resolve().then(() => {
- this._toggleSmallClass();
+ this.toggleSmallClass();
this._workSpace?.updateHeaderEmptyCellWidth();
});
}
- const $workSpace = $('
').appendTo(this._mainContainer);
+ const $workSpace = $('
').appendTo(this.mainContainer);
const currentViewType = currentViewOptions.type;
const workSpaceComponent = VIEWS_CONFIG[currentViewType].workSpace;
- const workSpaceConfig = this._workSpaceConfig(currentViewOptions);
+ const workSpaceConfig = this.workSpaceConfig(currentViewOptions);
// @ts-expect-error
this._workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig);
- this._allowDragging() && this._workSpace.initDragBehavior(this, this._all);
+ this.allowDragging() && this._workSpace.initDragBehavior(this, this._all);
this._workSpace.attachTablesEvents();
this._workSpace.getWorkArea().append(this._appointments.$element());
- this._recalculateWorkspace();
+ this.recalculateWorkspace();
if (currentViewOptions.startDate) {
- this._updateOption('header', 'currentDate', this._workSpace.getHeaderDate());
+ this.updateOption('header', 'currentDate', this._workSpace.getHeaderDate());
}
}
- _recalculateWorkspace() {
+ private recalculateWorkspace() {
// @ts-expect-error
- this._workSpaceRecalculation = new Deferred();
+ this.workSpaceRecalculation = new Deferred();
triggerResizeEvent(this._workSpace.$element());
- this._waitAsyncTemplate(() => {
+ this.waitAsyncTemplate(() => {
this._workSpace.renderCurrentDateTimeLineAndShader();
});
}
- _workSpaceConfig(currentViewOptions: NormalizedView) {
+ private workSpaceConfig(currentViewOptions: NormalizedView) {
const scrolling = this.getViewOption('scrolling');
const isVirtualScrolling = scrolling.mode === 'virtual';
const horizontalVirtualScrollingAllowed = isVirtualScrolling
@@ -1364,16 +1364,16 @@ class Scheduler extends SchedulerOptionsBaseWidget {
schedulerWidth: this.option('width'),
allDayPanelMode: this.option('allDayPanelMode'),
onSelectedCellsClick: this.showAddAppointmentPopup.bind(this),
- onRenderAppointments: this._renderAppointments.bind(this),
+ onRenderAppointments: this.renderAppointments.bind(this),
onShowAllDayPanel: (value) => this.option('showAllDayPanel', value),
- getHeaderHeight: () => utils.DOM.getHeaderHeight(this._header),
+ getHeaderHeight: () => utils.DOM.getHeaderHeight(this.header),
onScrollEnd: () => this._appointments.updateResizableArea(),
// TODO: SSR does not work correctly with renovated render
- renovateRender: this._isRenovatedRender(isVirtualScrolling),
+ renovateRender: this.isRenovatedRender(isVirtualScrolling),
}, currentViewOptions);
- result.notifyScheduler = this._notifyScheduler;
+ result.notifyScheduler = this.notifyScheduler;
result.groups = this.resourceManager.groupResources();
result.onCellClick = this._createActionByOption('onCellClick');
result.onCellContextMenu = this._createActionByOption('onCellContextMenu');
@@ -1388,23 +1388,23 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return result;
}
- _isRenovatedRender(isVirtualScrolling) {
+ private isRenovatedRender(isVirtualScrolling) {
return (this.option('renovateRender') && hasWindow()) || isVirtualScrolling;
}
- _waitAsyncTemplate(callback) {
+ private waitAsyncTemplate(callback) {
if (this._options.silent('templatesRenderAsynchronously')) {
const timer = setTimeout(() => {
callback();
clearTimeout(timer);
});
- this._asyncTemplatesTimers.push(timer);
+ this.asyncTemplatesTimers.push(timer);
} else {
callback();
}
}
- _getAppointmentTemplate(optionName) {
+ getAppointmentTemplate(optionName) {
if (this.currentView?.[optionName]) {
return this._getTemplate(this.currentView[optionName]);
}
@@ -1413,23 +1413,24 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return this._getTemplateByOption(optionName);
}
- _updateOption(viewName: 'workSpace' | 'header', optionName: string, value: T): void {
- this[`_${viewName}`]?.option(optionName, value);
+ private updateOption(viewName: 'workSpace' | 'header', optionName: string, value: T): void {
+ const target = viewName === 'header' ? this.header : this._workSpace;
+ target?.option(optionName, value);
}
- _refreshWorkSpace(): void {
+ private refreshWorkSpace(): void {
this.cleanWorkSpace();
delete this._workSpace;
- this._renderWorkSpace();
+ this.renderWorkSpace();
- if (this._readyToRenderAppointments) {
+ if (this.readyToRenderAppointments) {
this._appointments.option({
fixedContainer: this._workSpace.getFixedContainer(),
allDayContainer: this._workSpace.getAllDayContainer(),
});
- this._waitAsyncTemplate(() => this._workSpaceRecalculation.resolve());
+ this.waitAsyncTemplate(() => this.workSpaceRecalculation.resolve());
}
}
@@ -1454,14 +1455,14 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
getHeader() {
- return this._header;
+ return this.header;
}
- _cleanPopup() {
- this._appointmentPopup?.dispose();
+ private cleanPopup() {
+ this.appointmentPopup?.dispose();
}
- _checkRecurringAppointment(
+ private checkRecurringAppointment(
rawAppointment,
singleAppointment,
exceptionDate,
@@ -1473,7 +1474,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
) {
const recurrenceRule = this._dataAccessors.get('recurrenceRule', rawAppointment);
- if (!validateRRule(recurrenceRule) || !this._editing.allowUpdating) {
+ if (!validateRRule(recurrenceRule) || !this.editing.allowUpdating) {
callback();
return;
}
@@ -1484,18 +1485,18 @@ class Scheduler extends SchedulerOptionsBaseWidget {
callback();
break;
case 'occurrence':
- this._excludeAppointmentFromSeries(rawAppointment, singleAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent);
+ this.excludeAppointmentFromSeries(rawAppointment, singleAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent);
break;
default:
if (dragEvent) {
// @ts-expect-error
dragEvent.cancel = new Deferred();
}
- this._showRecurrenceChangeConfirm(isDeleted)
+ this.showRecurrenceChangeConfirm(isDeleted)
.done((editingMode) => {
editingMode === RECURRENCE_EDITING_MODE.SERIES && callback();
- editingMode === RECURRENCE_EDITING_MODE.OCCURRENCE && this._excludeAppointmentFromSeries(
+ editingMode === RECURRENCE_EDITING_MODE.OCCURRENCE && this.excludeAppointmentFromSeries(
rawAppointment,
singleAppointment,
exceptionDate,
@@ -1508,7 +1509,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
}
- _excludeAppointmentFromSeries(rawAppointment, newRawAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent) {
+ private excludeAppointmentFromSeries(rawAppointment, newRawAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent) {
const appointment = excludeFromRecurrence(
rawAppointment,
exceptionDate,
@@ -1530,7 +1531,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
if (isPopupEditing) {
- this._appointmentPopup.show(singleRawAppointment, {
+ this.appointmentPopup.show(singleRawAppointment, {
isToolbarVisible: true,
action: ACTION_TO_APPOINTMENT.EXCLUDE_FROM_SERIES,
excludeInfo: {
@@ -1538,26 +1539,26 @@ class Scheduler extends SchedulerOptionsBaseWidget {
updatedAppointment: appointment.source,
},
});
- this._editAppointmentData = rawAppointment;
+ this.editAppointmentData = rawAppointment;
} else {
- this._updateAppointment(rawAppointment, appointment.source, () => {
+ this.updateAppointmentCore(rawAppointment, appointment.source, () => {
this._appointments.moveAppointmentBack(dragEvent);
}, dragEvent);
}
}
- _createRecurrenceException(appointment, exceptionDate) {
+ private createRecurrenceException(appointment, exceptionDate) {
const result: any[] = [];
if (appointment.recurrenceException) {
result.push(appointment.recurrenceException);
}
- result.push(this._getSerializedDate(exceptionDate, appointment.startDate, appointment.allDay));
+ result.push(this.getSerializedDate(exceptionDate, appointment.startDate, appointment.allDay));
return result.join();
}
- _getSerializedDate(date, startDate, isAllDay) {
+ private getSerializedDate(date, startDate, isAllDay) {
isAllDay && date.setHours(
startDate.getHours(),
startDate.getMinutes(),
@@ -1568,13 +1569,13 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return dateSerialization.serializeDate(date, UTC_FULL_DATE_FORMAT);
}
- _showRecurrenceChangeConfirm(isDeleted) {
+ private showRecurrenceChangeConfirm(isDeleted) {
const title = messageLocalization.format(isDeleted ? 'dxScheduler-confirmRecurrenceDeleteTitle' : 'dxScheduler-confirmRecurrenceEditTitle');
const message = messageLocalization.format(isDeleted ? 'dxScheduler-confirmRecurrenceDeleteMessage' : 'dxScheduler-confirmRecurrenceEditMessage');
const seriesText = messageLocalization.format(isDeleted ? 'dxScheduler-confirmRecurrenceDeleteSeries' : 'dxScheduler-confirmRecurrenceEditSeries');
const occurrenceText = messageLocalization.format(isDeleted ? 'dxScheduler-confirmRecurrenceDeleteOccurrence' : 'dxScheduler-confirmRecurrenceEditOccurrence');
- this._recurrenceDialog = customDialog({
+ this.recurrenceDialog = customDialog({
title,
messageHtml: message,
showCloseButton: true,
@@ -1591,10 +1592,10 @@ class Scheduler extends SchedulerOptionsBaseWidget {
},
} as any);
- return this._recurrenceDialog.show();
+ return this.recurrenceDialog.show();
}
- _getUpdatedData(rawAppointment) {
+ private getUpdatedData(rawAppointment) {
const viewOffset = this.getViewOffsetMs();
const getConvertedFromGrid = (date: any): Date | undefined => {
@@ -1692,14 +1693,14 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
subscribe(subject, action) {
- this._subscribes[subject] = subscribes[subject] = action;
+ this.subscribes[subject] = subscribes[subject] = action;
}
fire(
subject: Subject,
...args: Parameters
): ReturnType {
- const callback = this._subscribes[subject];
+ const callback = this.subscribes[subject];
if (!isFunction(callback)) {
throw errors.Error('E1031', subject);
@@ -1712,7 +1713,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return this._workSpace.getDataByDroppableCell();
}
- _updateAppointment(target, rawAppointment, onUpdatePrevented?: any, dragEvent?: any) {
+ updateAppointmentCore(target, rawAppointment, onUpdatePrevented?: any, dragEvent?: any) {
const updatingOptions = {
newData: rawAppointment,
oldData: extend({}, target),
@@ -1729,7 +1730,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
}.bind(this);
- this._actions[StoreEventNames.UPDATING](updatingOptions);
+ this.actions[StoreEventNames.UPDATING](updatingOptions);
if (dragEvent && !isDeferred(dragEvent.cancel)) {
// @ts-expect-error
@@ -1737,15 +1738,15 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
if (isPromise(updatingOptions.cancel) && dragEvent) {
- this._updatingAppointments.add(target);
+ this.updatingAppointments.add(target);
}
- return this._processActionResult(updatingOptions, function (canceled) {
+ return this.processActionResult(updatingOptions, function (canceled) {
// @ts-expect-error
let deferred = new Deferred();
if (!canceled) {
- this._expandAllDayPanel(rawAppointment);
+ this.expandAllDayPanel(rawAppointment);
try {
deferred = this.appointmentDataSource
@@ -1754,18 +1755,18 @@ class Scheduler extends SchedulerOptionsBaseWidget {
dragEvent?.cancel.resolve(false);
})
.always((storeAppointment) => {
- this._updatingAppointments.delete(target);
- this._onDataPromiseCompleted(StoreEventNames.UPDATED, storeAppointment);
+ this.updatingAppointments.delete(target);
+ this.onDataPromiseCompleted(StoreEventNames.UPDATED, storeAppointment);
})
.fail(() => performFailAction());
} catch (err) {
performFailAction(err);
- this._updatingAppointments.delete(target);
+ this.updatingAppointments.delete(target);
deferred.resolve();
}
} else {
performFailAction();
- this._updatingAppointments.delete(target);
+ this.updatingAppointments.delete(target);
deferred.resolve();
}
@@ -1773,7 +1774,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
});
}
- _processActionResult(actionOptions, callback) {
+ private processActionResult(actionOptions, callback) {
// @ts-expect-error
const deferred = new Deferred();
const resolveCallback = (callbackResult) => {
@@ -1795,28 +1796,28 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return deferred.promise();
}
- _expandAllDayPanel(appointment) {
- if (!this._isAllDayExpanded() && this.appointmentTakesAllDay(appointment)) {
- this._updateOption('workSpace', 'allDayExpanded', true);
+ private expandAllDayPanel(appointment) {
+ if (!this.isAllDayExpanded() && this.appointmentTakesAllDay(appointment)) {
+ this.updateOption('workSpace', 'allDayExpanded', true);
}
}
- _onDataPromiseCompleted(handlerName, storeAppointment, appointment?: any) {
+ private onDataPromiseCompleted(handlerName, storeAppointment, appointment?: any) {
const args: any = { appointmentData: appointment || storeAppointment };
if (storeAppointment instanceof Error) {
args.error = storeAppointment;
} else {
- this._appointmentPopup.visible && this._appointmentPopup.hide();
+ this.appointmentPopup.visible && this.appointmentPopup.hide();
}
- this._actions[handlerName](args);
+ this.actions[handlerName](args);
this._fireContentReadyAction();
}
/// #DEBUG
getAppointmentDetailsForm() { // for tests
- return this._appointmentForm.form;
+ return this.appointmentForm.form;
}
/// #ENDDEBUG
@@ -1829,7 +1830,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
getActions() {
- return this._actions;
+ return this.actions;
}
appointmentTakesAllDay(rawAppointment) {
@@ -1910,19 +1911,19 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
if (isCreateAppointment) {
- delete this._editAppointmentData; // TODO
- this._editing.allowAdding && this._appointmentPopup.show(rawAppointment, {
+ delete this.editAppointmentData; // TODO
+ this.editing.allowAdding && this.appointmentPopup.show(rawAppointment, {
isToolbarVisible: true,
action: ACTION_TO_APPOINTMENT.CREATE,
});
} else {
const startDate = this._dataAccessors.get('startDate', newRawTargetedAppointment || rawAppointment);
- this._checkRecurringAppointment(rawAppointment, newTargetedAppointment, startDate, () => {
- this._editAppointmentData = rawAppointment; // TODO
+ this.checkRecurringAppointment(rawAppointment, newTargetedAppointment, startDate, () => {
+ this.editAppointmentData = rawAppointment; // TODO
- this._appointmentPopup.show(rawAppointment, {
- isToolbarVisible: this._editing.allowUpdating,
+ this.appointmentPopup.show(rawAppointment, {
+ isToolbarVisible: this.editing.allowUpdating,
action: ACTION_TO_APPOINTMENT.UPDATE,
});
}, false, true);
@@ -1943,9 +1944,9 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
hideAppointmentPopup(saveChanges?: any) {
- if (this._appointmentPopup?.visible) {
- saveChanges && this._appointmentPopup.saveChangesAsync();
- this._appointmentPopup.hide();
+ if (this.appointmentPopup?.visible) {
+ saveChanges && this.appointmentPopup.saveChangesAsync();
+ this.appointmentPopup.hide();
}
}
@@ -1985,12 +1986,12 @@ class Scheduler extends SchedulerOptionsBaseWidget {
this._createActionByOption('onAppointmentTooltipShowing')(arg);
- if (this._appointmentTooltip.isAlreadyShown(target)) {
+ if (this.appointmentTooltip.isAlreadyShown(target)) {
this.hideAppointmentTooltip();
} else {
- this._processActionResult(arg, (canceled) => {
- !canceled && this._appointmentTooltip.show(target, data, {
- ...this._getExtraAppointmentTooltipOptions(),
+ this.processActionResult(arg, (canceled) => {
+ !canceled && this.appointmentTooltip.show(target, data, {
+ ...this.getExtraAppointmentTooltipOptions(),
...options,
});
});
@@ -1998,7 +1999,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
hideAppointmentTooltip() {
- this._appointmentTooltip?.hide();
+ this.appointmentTooltip?.hide();
}
scrollToTime(hours, minutes, date) {
@@ -2010,7 +2011,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
this._workSpace.scrollTo(date, groupValues, allDay);
}
- _isHorizontalVirtualScrolling() {
+ private isHorizontalVirtualScrolling() {
const scrolling = this.option('scrolling');
const { orientation, mode } = scrolling;
const isVirtualScrolling = mode === 'virtual';
@@ -2034,24 +2035,24 @@ class Scheduler extends SchedulerOptionsBaseWidget {
cancel: false,
};
- this._actions[StoreEventNames.ADDING](addingOptions);
+ this.actions[StoreEventNames.ADDING](addingOptions);
- return this._processActionResult(addingOptions, (canceled) => {
+ return this.processActionResult(addingOptions, (canceled) => {
if (canceled) {
// @ts-expect-error
return new Deferred().resolve();
}
- this._expandAllDayPanel(serializedAppointment);
+ this.expandAllDayPanel(serializedAppointment);
return this.appointmentDataSource
.add(serializedAppointment)
- .always((storeAppointment) => this._onDataPromiseCompleted(StoreEventNames.ADDED, storeAppointment));
+ .always((storeAppointment) => this.onDataPromiseCompleted(StoreEventNames.ADDED, storeAppointment));
});
}
updateAppointment(target, appointment) {
- return this._updateAppointment(target, appointment);
+ return this.updateAppointmentCore(target, appointment);
}
deleteAppointment(rawAppointment) {
@@ -2066,17 +2067,17 @@ class Scheduler extends SchedulerOptionsBaseWidget {
cancel: false,
};
- this._actions[StoreEventNames.DELETING](deletingOptions);
+ this.actions[StoreEventNames.DELETING](deletingOptions);
return deletingOptions;
}
processDeleteAppointment(rawAppointment, deletingOptions) {
- this._processActionResult(deletingOptions, function (canceled) {
+ this.processActionResult(deletingOptions, function (canceled) {
if (!canceled) {
this.appointmentDataSource
.remove(rawAppointment)
- .always((storeAppointment) => this._onDataPromiseCompleted(
+ .always((storeAppointment) => this.onDataPromiseCompleted(
StoreEventNames.DELETED,
storeAppointment,
rawAppointment,
@@ -2093,7 +2094,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
if (typeof date === 'string') {
date = new Date(date);
}
- this._checkRecurringAppointment(
+ this.checkRecurringAppointment(
appointment,
{ },
date,
@@ -2111,7 +2112,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
focus() {
- if (this._editAppointmentData) {
+ if (this.editAppointmentData) {
this._appointments.focus();
} else {
this._workSpace.focus();
@@ -2124,7 +2125,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
: dateLocalization.firstDayOfWeekIndex() as FirstDayOfWeek;
}
- _validateKeyFieldIfAgendaExist() {
+ private validateKeyFieldIfAgendaExist() {
if (!this.appointmentDataSource.isDataSourceInit) {
return;
}
@@ -2142,7 +2143,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
_isAppointmentBeingUpdated(appointmentData: Appointment): boolean {
- return this._updatingAppointments.has(appointmentData);
+ return this.updatingAppointments.has(appointmentData);
}
getViewOffsetMs(): number {
diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts
index 8e173ad8d9d0..f6e772f5bc09 100644
--- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts
+++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts
@@ -74,15 +74,15 @@ const subscribes = {
const { info } = utils.dataAccessors.getAppointmentSettings(options.$appointment) as AppointmentItemViewModel;
const { startDate } = info.sourceAppointment;
- this._checkRecurringAppointment(options.target, options.data, startDate, () => {
- this._updateAppointment(options.target, options.data, function () {
+ this.checkRecurringAppointment(options.target, options.data, startDate, () => {
+ this.updateAppointmentCore(options.target, options.data, function () {
this._appointments.moveAppointmentBack();
});
});
},
getUpdatedData(rawAppointment) {
- return this._getUpdatedData(rawAppointment);
+ return this.getUpdatedData(rawAppointment);
},
updateAppointmentAfterDrag({
@@ -91,7 +91,7 @@ const subscribes = {
const { info } = utils.dataAccessors.getAppointmentSettings(element) as AppointmentItemViewModel;
// NOTE: enrich target appointment with additional data from the source
// in case of one appointment of series will change
- const targetedRawAppointment = extend({}, rawAppointment, this._getUpdatedData(rawAppointment));
+ const targetedRawAppointment = extend({}, rawAppointment, this.getUpdatedData(rawAppointment));
const fromAllDay = Boolean(rawAppointment.allDay);
const toAllDay = Boolean(targetedRawAppointment.allDay);
@@ -108,8 +108,8 @@ const subscribes = {
}
if (isDropToSelfScheduler && (!isDropToTheSameCell || isDragAndDropBetweenComponents || isDropBetweenAllDay)) {
- this._checkRecurringAppointment(rawAppointment, targetedRawAppointment, info.sourceAppointment.startDate, () => {
- this._updateAppointment(rawAppointment, targetedRawAppointment, onCancel, event);
+ this.checkRecurringAppointment(rawAppointment, targetedRawAppointment, info.sourceAppointment.startDate, () => {
+ this.updateAppointmentCore(rawAppointment, targetedRawAppointment, onCancel, event);
}, undefined, undefined, event);
} else {
onCancel();
diff --git a/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts b/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts
index 872769d26fee..1a306315bb12 100644
--- a/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts
+++ b/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts
@@ -116,8 +116,8 @@ class AppointmentLayoutManager {
rowCount,
appointmentCountPerCell: this.instance.option('_appointmentCountPerCell'),
appointmentOffset: this.instance.option('_appointmentOffset'),
- allowResizing: this.instance._allowResizing(),
- allowAllDayResizing: this.instance._allowAllDayResizing(),
+ allowResizing: this.instance.allowResizing(),
+ allowAllDayResizing: this.instance.allowAllDayResizing(),
startViewDate: workspace.getStartViewDate(),
groupOrientation: workspace.getRealGroupOrientation(),
cellWidth: getCellWidth(DOMMetaData),
diff --git a/packages/devextreme/testing/helpers/scheduler/helpers.js b/packages/devextreme/testing/helpers/scheduler/helpers.js
index 22938bf1a967..52b8eb8a095c 100644
--- a/packages/devextreme/testing/helpers/scheduler/helpers.js
+++ b/packages/devextreme/testing/helpers/scheduler/helpers.js
@@ -591,11 +591,11 @@ export class SchedulerTestWrapper extends ElementWrapper {
getCancelButton: () => this.appointmentPopup.getPopup().find('.dx-popup-cancel'),
clickCancelButton: () => this.appointmentPopup.getCancelButton().trigger('dxclick'),
- saveAppointmentData: () => this.instance._appointmentPopup.saveEditDataAsync.call(this.instance._appointmentPopup),
+ saveAppointmentData: () => this.instance.appointmentPopup.saveEditDataAsync.call(this.instance.appointmentPopup),
hasLoadPanel: () => this.appointmentPopup.getPopup().find('.dx-loadpanel').length !== 0,
- getInstance: () => this.instance._appointmentPopup
+ getInstance: () => this.instance.appointmentPopup
};
this.appointmentForm = {
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.editing.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.editing.tests.js
index 01cfabfccd64..96fb44d89780 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.editing.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.editing.tests.js
@@ -135,11 +135,11 @@ module('Integration: Appointment editing', {
currentView: 'timelineMonth'
});
- const updateAppointment = scheduler.instance._updateAppointment;
+ const updateAppointment = scheduler.instance.updateAppointmentCore;
const spy = sinon.spy(noop);
const oldItem = data[0];
- scheduler.instance._updateAppointment = spy;
+ scheduler.instance.updateAppointmentCore = spy;
const cellWidth = getOuterWidth(scheduler.instance.$element().find('.' + DATE_TABLE_CELL_CLASS).eq(0));
@@ -151,7 +151,7 @@ module('Integration: Appointment editing', {
assert.deepEqual(spy.getCall(0).args[0], oldItem, 'Target item is correct');
assert.deepEqual(spy.getCall(0).args[1], $.extend(true, oldItem, { endDate: new Date(2015, 1, 3, 2, 0) }), 'New data is correct');
} finally {
- scheduler.instance._updateAppointment = updateAppointment;
+ scheduler.instance.updateAppointmentCore = updateAppointment;
}
});
@@ -162,11 +162,11 @@ module('Integration: Appointment editing', {
const scheduler = await this.createInstance({ currentDate: new Date(2015, 1, 9), dataSource: data, editing: true });
- const updateAppointment = scheduler.instance._updateAppointment;
+ const updateAppointment = scheduler.instance.updateAppointmentCore;
const spy = sinon.spy(noop);
const oldItem = this.tasks[0];
- scheduler.instance._updateAppointment = spy;
+ scheduler.instance.updateAppointmentCore = spy;
const cellHeight = getOuterHeight(scheduler.instance.$element().find('.' + DATE_TABLE_CELL_CLASS).eq(0));
const hourHeight = cellHeight * 2;
@@ -179,7 +179,7 @@ module('Integration: Appointment editing', {
assert.deepEqual(spy.getCall(0).args[0], oldItem, 'Target item is correct');
assert.deepEqual(spy.getCall(0).args[1], $.extend(true, oldItem, { endDate: new Date(2015, 1, 9, 3, 0) }), 'New data is correct');
} finally {
- scheduler.instance._updateAppointment = updateAppointment;
+ scheduler.instance.updateAppointmentCore = updateAppointment;
}
});
@@ -263,7 +263,7 @@ module('Integration: Appointment editing', {
$('.dx-scheduler-appointment-popup .dx-popup-done').trigger('dxclick');
- const popup = scheduler.instance._appointmentPopup.popup;
+ const popup = scheduler.instance.appointmentPopup.popup;
});
test('Add new appointment with delay and an error(T381444)', async function(assert) {
@@ -298,7 +298,7 @@ module('Integration: Appointment editing', {
$('.dx-scheduler-appointment-popup .dx-popup-done').trigger('dxclick');
- const popup = scheduler.instance._appointmentPopup.popup;
+ const popup = scheduler.instance.appointmentPopup.popup;
});
// TODO: update editors in popup
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.monthView.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.monthView.tests.js
index 61be4a332f87..2953d6d64e1e 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.monthView.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.monthView.tests.js
@@ -413,7 +413,7 @@ module('Integration: Appointments in Month view', {
$('.dx-dialog-buttons .dx-button').eq(0).trigger('dxclick');
- const popup = scheduler.instance._appointmentPopup.popup;
+ const popup = scheduler.instance.appointmentPopup.popup;
const $buttonGroup = $(popup.$content()).find('.dx-buttongroup');
assert.deepEqual($buttonGroup.eq(0).dxButtonGroup('instance').option('selectedItemKeys'), ['MO', 'TH'], 'Right button group select item keys');
@@ -452,7 +452,7 @@ module('Integration: Appointments in Month view', {
$('.dx-dialog-buttons .dx-button').eq(0).trigger('dxclick');
- const popup = scheduler.instance._appointmentPopup.popup;
+ const popup = scheduler.instance.appointmentPopup.popup;
const $buttonGroup = $(popup.$content()).find('.dx-buttongroup');
$buttonGroup.eq(0).dxButtonGroup('instance').option('selectedItemKeys'), ['MO', 'TH'], 'Right button group select item keys';
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.tooltip.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.tooltip.tests.js
index 02df11bd48ad..73a4e410542b 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.tooltip.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.tooltip.tests.js
@@ -55,7 +55,7 @@ module('Integration: Appointment tooltip', {
height: 600
});
- const getAppointmentDisabled = sinon.spy(scheduler.instance._appointmentTooltip._options, 'getAppointmentDisabled');
+ const getAppointmentDisabled = sinon.spy(scheduler.instance.appointmentTooltip._options, 'getAppointmentDisabled');
const clock = sinon.useFakeTimers();
await scheduler.appointments.click(0, clock);
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.week.based.views.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.week.based.views.tests.js
index 7c25bf02d26c..cfa81be7baf1 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.week.based.views.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.week.based.views.tests.js
@@ -230,7 +230,7 @@ module('Integration: Appointment Day, Week views', {
height: 1500
});
- const spy = sinon.spy(scheduler.instance._appointmentPopup, 'show');
+ const spy = sinon.spy(scheduler.instance.appointmentPopup, 'show');
const clock = sinon.useFakeTimers();
await scheduler.appointments.click(0, clock);
@@ -244,7 +244,7 @@ module('Integration: Appointment Day, Week views', {
hide();
} finally {
- scheduler.instance._appointmentPopup.show.restore();
+ scheduler.instance.appointmentPopup.show.restore();
}
});
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointmentPopup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointmentPopup.tests.js
index 38061a255c4a..fd17cf00ae33 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointmentPopup.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointmentPopup.tests.js
@@ -34,7 +34,7 @@ const checkFormWithRecurrenceEditor = (assert, instance, visibility) => {
assert.equal(form.itemOption(APPOINTMENT_FORM_GROUP_NAMES.Main).colSpan, colSpan, 'colSpan of main group is correct');
assert.equal(form.itemOption(APPOINTMENT_FORM_GROUP_NAMES.Recurrence).colSpan, colSpan, 'colSpan of recurrence group is correct');
- assert.equal(instance._appointmentPopup.popup.option('maxWidth'), width, 'maxWidth of popup is correct');
+ assert.equal(instance.appointmentPopup.popup.option('maxWidth'), width, 'maxWidth of popup is correct');
};
const createInstance = (options) => {
@@ -162,12 +162,12 @@ QUnit.module('Appointment popup form', moduleConfig, () => {
scheduler.appointments.dblclick(0);
scheduler.appointmentPopup.dialog.clickEditSeries();
- const form = scheduler.instance._appointmentPopup.form.form;
+ const form = scheduler.instance.appointmentPopup.form.form;
assert.ok(form.getEditor('repeat').option('value'), 'repeat checkbox should be checked');
assert.ok(form.option('items')[1].visible, 'recurrence form should be visible');
- scheduler.instance._appointmentPopup.popup.hide();
+ scheduler.instance.appointmentPopup.popup.hide();
scheduler.instance.showAppointmentPopup();
assert.notOk(form.getEditor('repeat').option('value'), 'repeat checkbox should be unchecked if empty form');
@@ -330,11 +330,11 @@ QUnit.module('Appointment popup form', moduleConfig, () => {
scheduler.appointments.dblclick();
assert.equal(scheduler.appointmentPopup.isVisible(), expected, text + ' if call from UI');
- scheduler.instance._appointmentPopup.popup.option('visible', false);
+ scheduler.instance.appointmentPopup.popup.option('visible', false);
scheduler.instance.showAppointmentPopup(data[0]);
assert.equal(scheduler.appointmentPopup.isVisible(), expected, text + ' if call showAppointmentPopup method');
- scheduler.instance._appointmentPopup.popup.option('visible', false);
+ scheduler.instance.appointmentPopup.popup.option('visible', false);
});
});
@@ -674,11 +674,11 @@ if(isDesktopEnvironment()) {
const scheduler = await createScheduler();
scheduler.instance.showAppointmentPopup({ startDate: new Date(2018, 5, 18), endDate: Date(2018, 5, 18), text: 'a' });
checkFormWithRecurrenceEditor(assert, scheduler.instance, false);
- scheduler.instance._appointmentPopup.popup.hide();
+ scheduler.instance.appointmentPopup.popup.hide();
scheduler.instance.showAppointmentPopup({ startDate: new Date(2018, 5, 18), endDate: Date(2018, 5, 18), text: 'b', recurrenceRule: 'FREQ=WEEKLY' });
$('.dx-dialog-buttons .dx-button').eq(0).trigger('dxclick');
checkFormWithRecurrenceEditor(assert, scheduler.instance, true);
- scheduler.instance._appointmentPopup.popup.hide();
+ scheduler.instance.appointmentPopup.popup.hide();
scheduler.instance.showAppointmentPopup({ startDate: new Date(2018, 5, 18), endDate: Date(2018, 5, 18), text: 'c' });
checkFormWithRecurrenceEditor(assert, scheduler.instance, false);
@@ -690,7 +690,7 @@ if(isDesktopEnvironment()) {
const form = scheduler.instance.getAppointmentDetailsForm();
form.getEditor('visibilityChanged').option('value', true);
- scheduler.instance._appointmentPopup.popup.hide();
+ scheduler.instance.appointmentPopup.popup.hide();
scheduler.instance.showAppointmentPopup({ startDate: new Date(2018, 5, 18), endDate: Date(2018, 5, 18), text: 'b', recurrenceRule: 'FREQ=WEEKLY' });
$('.dx-dialog-buttons .dx-button').eq(0).trigger('dxclick');
@@ -712,7 +712,7 @@ if(isDesktopEnvironment()) {
const form = scheduler.instance.getAppointmentDetailsForm();
assert.ok(!form.getEditor(null), 'Editor is not rendered');
- assert.equal(scheduler.instance._appointmentPopup.popup.option('maxWidth'), APPOINTMENT_POPUP_WIDTH);
+ assert.equal(scheduler.instance.appointmentPopup.popup.option('maxWidth'), APPOINTMENT_POPUP_WIDTH);
assert.equal(form.option('items')[0].colSpan, 2, 'colSpan of main group');
scheduler.instance.option('recurrenceRuleExpr', 'recurrenceRule');
@@ -737,7 +737,7 @@ if(isDesktopEnvironment()) {
const form = scheduler.instance.getAppointmentDetailsForm();
assert.ok(!form.getEditor(null), 'Editor is not rendered');
- assert.equal(scheduler.instance._appointmentPopup.popup.option('maxWidth'), APPOINTMENT_POPUP_WIDTH);
+ assert.equal(scheduler.instance.appointmentPopup.popup.option('maxWidth'), APPOINTMENT_POPUP_WIDTH);
assert.equal(form.option('items')[0].colSpan, 2, 'colSpan of main group');
});
@@ -769,7 +769,7 @@ QUnit.module('Appointment Popup Content', moduleOptions, () => {
scheduler.instance.showAppointmentPopup({ startDate: new Date(2015, 1, 1), endDate: new Date(2015, 1, 2) });
- const appointmentPopupOptions = scheduler.instance._appointmentPopup.popup.option();
+ const appointmentPopupOptions = scheduler.instance.appointmentPopup.popup.option();
assert.strictEqual(appointmentPopupOptions.enableBodyScroll, false, 'enable body scroll');
assert.strictEqual(appointmentPopupOptions.preventScrollEvents, false, 'prevent scroll events');
@@ -885,7 +885,7 @@ QUnit.module('Appointment Popup Content', moduleOptions, () => {
scheduler.instance.showAppointmentPopup({ startDate: new Date(2015, 1, 1), endDate: new Date(2015, 1, 2), text: 'appointment 1' });
- const popup = scheduler.instance._appointmentPopup.popup;
+ const popup = scheduler.instance.appointmentPopup.popup;
assert.equal(popup.option('height'), 'auto', 'popup has correct height');
assert.equal(popup.option('maxHeight'), '100%', 'popup has correct max-height');
@@ -896,7 +896,7 @@ QUnit.module('Appointment Popup Content', moduleOptions, () => {
scheduler.instance.showAppointmentPopup({ startDate: new Date(2015, 1, 1), endDate: new Date(2015, 1, 2), text: 'appointment 1' });
- const popup = scheduler.instance._appointmentPopup.popup;
+ const popup = scheduler.instance.appointmentPopup.popup;
let contentReadyCalled = 0;
popup.option('onContentReady', function() {
@@ -1392,7 +1392,7 @@ QUnit.module('Appointment Popup Content', moduleOptions, () => {
QUnit.test('Done button default configuration should be correct', async function(assert) {
const scheduler = await createInstance({
onAppointmentFormOpening: function(e) {
- const popup = e.component._appointmentPopup.popup;
+ const popup = e.component.appointmentPopup.popup;
const buttons = popup.option('toolbarItems');
const doneButton = buttons[0];
@@ -1414,7 +1414,7 @@ QUnit.module('Appointment Popup Content', moduleOptions, () => {
store: this.tasks
}),
onAppointmentFormOpening: function(e) {
- const popup = e.component._appointmentPopup.popup;
+ const popup = e.component.appointmentPopup.popup;
const buttons = popup.option('toolbarItems');
buttons[0].options = { text: 'Text 1' };
popup.option('toolbarItems', buttons);
@@ -1555,7 +1555,7 @@ QUnit.module('Appointment Popup', moduleOptions, () => {
recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10'
});
- const popup = scheduler.instance._appointmentPopup.popup;
+ const popup = scheduler.instance.appointmentPopup.popup;
const $buttonGroup = $(popup.$content()).find('.dx-buttongroup');
assert.deepEqual($buttonGroup.eq(0).dxButtonGroup('instance').option('selectedItemKeys'), ['MO', 'TH'], 'Right buttons was checked');
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.events.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.events.tests.js
index e7c07160bb23..00f189a1557a 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.events.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.events.tests.js
@@ -685,16 +685,16 @@ QUnit.module('Events', {
assert.equal(contentReadyFiresCount, 1, 'contentReadyFiresCount === 1');
- scheduler.instance._workSpaceRecalculation = new Deferred();
+ scheduler.instance.workSpaceRecalculation = new Deferred();
scheduler.instance._fireContentReadyAction();
assert.equal(contentReadyFiresCount, 1, 'contentReadyFiresCount === 1');
- scheduler.instance._workSpaceRecalculation.resolve();
+ scheduler.instance.workSpaceRecalculation.resolve();
assert.equal(contentReadyFiresCount, 2, 'contentReadyFiresCount === 2');
- scheduler.instance._workSpaceRecalculation = null;
+ scheduler.instance.workSpaceRecalculation = null;
scheduler.instance._fireContentReadyAction();
assert.equal(contentReadyFiresCount, 3, 'contentReadyFiresCount === 3');
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js
index 6a45e70982a1..04beb0447b0a 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js
@@ -498,7 +498,7 @@ QUnit.module('Methods', {
const appointments = scheduler.instance.getAppointmentsInstance();
const focusSpy = sinon.spy(appointments, 'focus');
- scheduler.instance._editAppointmentData = tasks[0];
+ scheduler.instance.editAppointmentData = tasks[0];
scheduler.instance.focus();
assert.ok(focusSpy.calledOnce, 'focus is called');
@@ -636,49 +636,49 @@ QUnit.module('Methods', {
QUnit.test('showAppointmentTooltipCore, should call show tooltip', async function(assert) {
const scheduler = await createInstance({});
- scheduler.instance._appointmentTooltip.isAlreadyShown = sinon.stub().returns(false);
- scheduler.instance._appointmentTooltip.show = sinon.stub();
- scheduler.instance._appointmentTooltip.hide = sinon.stub();
+ scheduler.instance.appointmentTooltip.isAlreadyShown = sinon.stub().returns(false);
+ scheduler.instance.appointmentTooltip.show = sinon.stub();
+ scheduler.instance.appointmentTooltip.hide = sinon.stub();
scheduler.instance.showAppointmentTooltipCore('target', [], 'options');
- assert.ok(!scheduler.instance._appointmentTooltip.hide.called, 'hide tooltip is not called');
- assert.ok(scheduler.instance._appointmentTooltip.show.called, 'show tooltip is called');
+ assert.ok(!scheduler.instance.appointmentTooltip.hide.called, 'hide tooltip is not called');
+ assert.ok(scheduler.instance.appointmentTooltip.show.called, 'show tooltip is called');
});
QUnit.test('showAppointmentTooltipCore, should call hide tooltip', async function(assert) {
const scheduler = await createInstance({});
- scheduler.instance._appointmentTooltip.isAlreadyShown = sinon.stub().returns(true);
- scheduler.instance._appointmentTooltip.show = sinon.stub();
- scheduler.instance._appointmentTooltip.hide = sinon.stub();
+ scheduler.instance.appointmentTooltip.isAlreadyShown = sinon.stub().returns(true);
+ scheduler.instance.appointmentTooltip.show = sinon.stub();
+ scheduler.instance.appointmentTooltip.hide = sinon.stub();
scheduler.instance.showAppointmentTooltipCore('target', [], 'options');
- assert.ok(scheduler.instance._appointmentTooltip.hide.called, 'hide tooltip is called');
- assert.ok(!scheduler.instance._appointmentTooltip.show.called, 'show tooltip is not called');
+ assert.ok(scheduler.instance.appointmentTooltip.hide.called, 'hide tooltip is called');
+ assert.ok(!scheduler.instance.appointmentTooltip.show.called, 'show tooltip is not called');
});
QUnit.test('showAppointmentTooltip, should call show tooltip', async function(assert) {
const scheduler = await createInstance({});
- scheduler.instance._appointmentTooltip.isAlreadyShown = sinon.stub().returns(false);
- scheduler.instance._appointmentTooltip.show = sinon.stub();
- scheduler.instance._appointmentTooltip.hide = sinon.stub();
+ scheduler.instance.appointmentTooltip.isAlreadyShown = sinon.stub().returns(false);
+ scheduler.instance.appointmentTooltip.show = sinon.stub();
+ scheduler.instance.appointmentTooltip.hide = sinon.stub();
scheduler.instance.showAppointmentTooltip('appointmentData', 'target', 'currentAppointmentData');
- assert.ok(!scheduler.instance._appointmentTooltip.hide.called, 'hide tooltip is not called');
- assert.ok(scheduler.instance._appointmentTooltip.show.called, 'show tooltip is called');
+ assert.ok(!scheduler.instance.appointmentTooltip.hide.called, 'hide tooltip is not called');
+ assert.ok(scheduler.instance.appointmentTooltip.show.called, 'show tooltip is called');
});
QUnit.test('showAppointmentTooltip, should call hide tooltip', async function(assert) {
const scheduler = await createInstance({});
- scheduler.instance._appointmentTooltip.isAlreadyShown = sinon.stub().returns(true);
- scheduler.instance._appointmentTooltip.show = sinon.stub();
- scheduler.instance._appointmentTooltip.hide = sinon.stub();
+ scheduler.instance.appointmentTooltip.isAlreadyShown = sinon.stub().returns(true);
+ scheduler.instance.appointmentTooltip.show = sinon.stub();
+ scheduler.instance.appointmentTooltip.hide = sinon.stub();
scheduler.instance.showAppointmentTooltip('appointmentData', 'target', 'currentAppointmentData');
- assert.ok(scheduler.instance._appointmentTooltip.hide.called, 'hide tooltip is called');
- assert.ok(!scheduler.instance._appointmentTooltip.show.called, 'show tooltip is not called');
+ assert.ok(scheduler.instance.appointmentTooltip.hide.called, 'hide tooltip is called');
+ assert.ok(!scheduler.instance.appointmentTooltip.show.called, 'show tooltip is not called');
});
- QUnit.test('_getUpdatedData for the empty data item (T906240)', async function(assert) {
+ QUnit.test('getUpdatedData for the empty data item (T906240)', async function(assert) {
const startCellDate = new Date(2020, 1, 2, 3);
const endCellDate = new Date(2020, 1, 2, 4);
const scheduler = await createWrapper({});
@@ -690,7 +690,7 @@ QUnit.module('Methods', {
};
};
- const updatedData = scheduler.instance._getUpdatedData({ text: 'test' });
+ const updatedData = scheduler.instance.getUpdatedData({ text: 'test' });
assert.deepEqual(updatedData, {
endDate: endCellDate,
startDate: startCellDate
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.options.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.options.tests.js
index b5f4add53b58..845273242154 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.options.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.options.tests.js
@@ -630,7 +630,7 @@ QUnit.module('Options', () => {
const spyAppointmentPopupForm = sinon.spy(
scheduler.instance,
- '_createAppointmentPopupForm'
+ 'createAppointmentPopupForm'
);
scheduler.instance.option('resources', resources);
@@ -928,7 +928,7 @@ QUnit.module('Options', () => {
});
const initMarkupSpy = sinon.spy(scheduler.instance, '_initMarkup');
- const reloadDataSourceSpy = sinon.spy(scheduler.instance, '_reloadDataSource');
+ const reloadDataSourceSpy = sinon.spy(scheduler.instance, 'reloadDataSource');
let count = 0;
const nextDataSource = new DataSource({
@@ -954,7 +954,7 @@ QUnit.module('Options', () => {
await waitForAsync(() => count === 2);
assert.equal(initMarkupSpy.callCount, 2, 'Init markup was called on each dataSource changes');
- assert.equal(reloadDataSourceSpy.callCount, 2, '_reloadDataSource was called on each changes');
+ assert.equal(reloadDataSourceSpy.callCount, 2, 'reloadDataSource was called on each changes');
});
QUnit.test('It should be possible to change views option when view names are specified (T995794)', async function(assert) {
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.tests.js
index d9b00cc53aca..8a2bc2dbb295 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.tests.js
@@ -444,7 +444,7 @@ QUnit.module('View with configuration', () => {
});
assert.equal(scheduler.instance._workSpace.option('firstDayOfWeek'), 0, 'value of the firstDayOfWeek in workSpace');
- assert.equal(scheduler.instance._header.option('firstDayOfWeek'), 0, 'value of the firstDayOfWeek in header');
+ assert.equal(scheduler.instance.header.option('firstDayOfWeek'), 0, 'value of the firstDayOfWeek in header');
});
QUnit.test('Scheduler should have specific groups setting of the view', async function(assert) {
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/dataSource.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/dataSource.tests.js
index e3b915e82de0..a3855bc24824 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/dataSource.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/dataSource.tests.js
@@ -263,7 +263,7 @@ module('Events', {
scheduler.instance.showAppointmentPopup(appointments[0]);
$('.dx-scheduler-appointment-popup .dx-popup-done').trigger('dxclick');
- const appointmentForm = scheduler.instance._appointmentPopup.form;
+ const appointmentForm = scheduler.instance.appointmentPopup.form;
assert.deepEqual(appointmentForm.formData.startDate, new Date(2015, 1, 9, 13), 'Form data is correct');
} finally {
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentCollector.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentCollector.tests.js
index 6eb836263b91..f918a9b71bbf 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentCollector.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentCollector.tests.js
@@ -83,7 +83,7 @@ module('Integration: Appointments Collector Base Tests', baseConfig, () => {
}
return this.callBase(options);
},
- _getAppointmentTemplate(template) {
+ getAppointmentTemplate(template) {
return this._getTemplateByOption(template);
},
_dataAccessors: mockDataAccessor,
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentTooltip.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentTooltip.tests.js
index 0b014d5e8b28..52af1d199525 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentTooltip.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentTooltip.tests.js
@@ -309,7 +309,7 @@ module('Integration: Appointment tooltip', moduleConfig, () => {
assert.equal(Tooltip.getInstance($('.dx-tooltip')).option('rtlEnabled'), true, 'rtlEnabled for tooltip was set to true');
});
- test('Click on tooltip-edit button should call scheduler._appointmentPopup and hide tooltip', async function(assert) {
+ test('Click on tooltip-edit button should call scheduler.appointmentPopup and hide tooltip', async function(assert) {
const data = new DataSource({
store: getSampleData()
});
@@ -319,7 +319,7 @@ module('Integration: Appointment tooltip', moduleConfig, () => {
dataSource: data
});
- const stub = sinon.stub(scheduler.instance._appointmentPopup, 'show');
+ const stub = sinon.stub(scheduler.instance.appointmentPopup, 'show');
const clock = sinon.useFakeTimers();
await scheduler.appointments.click(1, clock);
@@ -585,7 +585,7 @@ module('Integration: Appointment tooltip', moduleConfig, () => {
}
]
});
- const stub = sinon.stub(scheduler.instance, '_updateAppointment');
+ const stub = sinon.stub(scheduler.instance, 'updateAppointmentCore');
const clock = sinon.useFakeTimers();
await scheduler.appointments.click(1, clock);
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.dateNavigator.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.dateNavigator.tests.js
index f7f298c9f408..55b21fa854a1 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.dateNavigator.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.dateNavigator.tests.js
@@ -381,13 +381,13 @@ QUnit.module('Integration: Date navigator', moduleConfig, function() {
QUnit.test('Tasks should be rerendered after click on next/prev button', async function(assert) {
await this.createInstance({ currentDate: new Date(2015, 1, 24) });
- const spy = sinon.spy(this.instance, '_filterAppointmentsByDate');
+ const spy = sinon.spy(this.instance, 'filterAppointmentsByDate');
try {
$(this.instance.$element()).find('.dx-scheduler-navigator-previous').trigger('dxclick');
assert.ok(spy.calledOnce, 'filterByDate is called');
} finally {
- this.instance._filterAppointmentsByDate.restore();
+ this.instance.filterAppointmentsByDate.restore();
}
});
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.multiWeekAppointments.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.multiWeekAppointments.tests.js
index 4386c44f5703..d49f2536423a 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.multiWeekAppointments.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.multiWeekAppointments.tests.js
@@ -15,12 +15,12 @@ const { testStart } = QUnit;
testStart(() => initTestMarkup());
const mockWorkSpaceRendering = function(schedulerInst, cellSize, bounds) {
- const base = schedulerInst._renderWorkSpace;
+ const base = schedulerInst.renderWorkSpace;
const getMaxAllowedPosition = (groupIndex) => {
return bounds[groupIndex];
};
- sinon.stub(schedulerInst, '_renderWorkSpace').callsFake(function(groups) {
+ sinon.stub(schedulerInst, 'renderWorkSpace').callsFake(function(groups) {
base.call(this, groups);
sinon.stub(this._workSpace, 'getCellWidth').returns(cellSize);
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.workSpace.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.workSpace.tests.js
index d6659d89bfc5..bd740e0d0b8a 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.workSpace.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.workSpace.tests.js
@@ -914,7 +914,7 @@ module('Integration: Work space', { ...moduleConfig }, () => {
]
});
- const refreshStub = sinon.stub(scheduler.instance, '_refreshWorkSpace');
+ const refreshStub = sinon.stub(scheduler.instance, 'refreshWorkSpace');
try {
scheduler.instance.option('groups', ['resource2']);
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/keyboardNavigation.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/keyboardNavigation.tests.js
index d81037f48448..9dcf6abff81f 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/keyboardNavigation.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/keyboardNavigation.tests.js
@@ -88,13 +88,13 @@ QUnit.module('Keyboard Navigation', {
});
scheduler.appointments.compact.click();
- assert.notOk(scheduler.instance._appointmentTooltip._list.option('focusStateEnabled'), 'focusStateEnabled was passed correctly');
+ assert.notOk(scheduler.instance.appointmentTooltip._list.option('focusStateEnabled'), 'focusStateEnabled was passed correctly');
- scheduler.instance._appointmentTooltip.hide();
+ scheduler.instance.appointmentTooltip.hide();
scheduler.instance.option('focusStateEnabled', true);
scheduler.appointments.compact.click();
- assert.ok(scheduler.instance._appointmentTooltip._list.option('focusStateEnabled'), 'focusStateEnabled was passed correctly');
+ assert.ok(scheduler.instance.appointmentTooltip._list.option('focusStateEnabled'), 'focusStateEnabled was passed correctly');
});
QUnit.test('Workspace navigation by arrows should work correctly with opened dropDown appointments', async function(assert) {