Skip to content

Commit 7e548d1

Browse files
committed
apply copilot's review
1 parent ec41cfe commit 7e548d1

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

packages/devextreme/js/__internal/scheduler/appointments_new/appointment_collector.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('AppointmentCollector', () => {
124124
});
125125
});
126126

127-
describe('Resize', () => {
127+
describe('Geometry', () => {
128128
it('should have correct top and left on init', () => {
129129
const instance = createAppointmentCollector({
130130
...getProperties(defaultAppointmentData),
@@ -163,6 +163,8 @@ describe('AppointmentCollector', () => {
163163

164164
expect(instance.$element().css('top')).toBe('150px');
165165
expect(instance.$element().css('left')).toBe('250px');
166+
expect(instance.$element().css('height')).toBe('30px');
167+
expect(instance.$element().css('width')).toBe('40px');
166168
});
167169
});
168170

packages/devextreme/js/__internal/scheduler/appointments_new/appointment_collector.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export class AppointmentCollector
3232
extends DOMComponent<AppointmentCollector, AppointmentCollectorProperties> {
3333
private defaultAppointmentCollectorTemplate!: FunctionTemplate;
3434

35+
private buttonInstance?: Button;
36+
3537
override _init(): void {
3638
super._init();
3739

@@ -54,6 +56,11 @@ export class AppointmentCollector
5456
top: this.option().geometry.top,
5557
left: this.option().geometry.left,
5658
});
59+
60+
this.buttonInstance?.option({
61+
width: this.option().geometry.width,
62+
height: this.option().geometry.height,
63+
});
5764
}
5865

5966
private applyElementClasses(): void {
@@ -85,7 +92,7 @@ export class AppointmentCollector
8592
? this.defaultAppointmentCollectorTemplate
8693
: this.option().appointmentCollectorTemplate;
8794

88-
this._createComponent(this.$element(), Button, {
95+
this.buttonInstance = this._createComponent(this.$element(), Button, {
8996
type: 'default',
9097
width: this.option().geometry.width,
9198
height: this.option().geometry.height,

packages/devextreme/js/__internal/scheduler/appointments_new/appointments.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ export class Appointments extends DOMComponent<Appointments, AppointmentsPropert
170170
const { allDay, sortedIndex } = diffItem.item;
171171

172172
switch (true) {
173-
case diffItem.needToRemove && !isRepaintAll: {
173+
case diffItem.needToRemove: {
174+
if (isRepaintAll) {
175+
break;
176+
}
177+
174178
this.getAppointmentElement(sortedIndex).remove();
175179
break;
176180
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import type {
7070
AppointmentTooltipItem,
7171
SafeAppointment,
7272
ScrollToGroupValuesOrOptions, ScrollToOptions, TargetedAppointment,
73+
ViewType,
7374
} from './types';
7475
import { AppointmentAdapter } from './utils/appointment_adapter/appointment_adapter';
7576
import { AppointmentDataAccessor } from './utils/data_accessor/appointment_data_accessor';
@@ -318,9 +319,8 @@ class Scheduler extends SchedulerOptionsBaseWidget {
318319

319320
if (this.option('_newAppointments')) {
320321
this._appointments.option({
322+
currentView: value,
321323
viewModel: [],
322-
allowDrag: this.allowDragging(),
323-
allowResize: this.allowResizing(),
324324
// TODO<Appointments>: update appointmentTemplate and appointmentCollectorTemplate
325325
});
326326
} else {
@@ -1044,6 +1044,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
10441044
: this.getViewOption('appointmentTemplate');
10451045

10461046
const appointmentsConfig: Partial<AppointmentsProperties> = {
1047+
currentView: this.option('currentView') as ViewType,
10471048
// TODO<Appointments>: set custom templates
10481049
appointmentTemplate: appointmentTemplateValue,
10491050
appointmentCollectorTemplate: this.getViewOption('appointmentCollectorTemplate'),

0 commit comments

Comments
 (0)