Skip to content

Commit ec41cfe

Browse files
committed
rename components
1 parent 3d5fca8 commit ec41cfe

10 files changed

Lines changed: 100 additions & 100 deletions

File tree

packages/devextreme/js/__internal/scheduler/appointments_new/__mock__/appointment_properties.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import { mockAppointmentDataAccessor } from '@ts/scheduler/__mock__/appointment_
33
import type { SafeAppointment, TargetedAppointment } from '@ts/scheduler/types';
44
import type { AppointmentDataAccessor } from '@ts/scheduler/utils/data_accessor/appointment_data_accessor';
55

6-
import type { BaseAppointmentProperties } from '../appointment/base_appointment';
6+
import type { BaseAppointmentViewProperties } from '../appointment/base_appointment';
77

88
export const getBaseAppointmentProperties = (
99
appointmentData: SafeAppointment,
1010
targetedAppointmentData?: TargetedAppointment,
11-
): BaseAppointmentProperties => {
11+
): BaseAppointmentViewProperties => {
1212
const normalizedTargetedAppointmentData = targetedAppointmentData ?? {
1313
...appointmentData,
1414
displayStartDate: appointmentData.startDate as Date,
1515
displayEndDate: appointmentData.endDate as Date,
1616
};
1717

18-
const config: BaseAppointmentProperties = {
18+
const config: BaseAppointmentViewProperties = {
1919
appointmentData,
2020
targetedAppointmentData: normalizedTargetedAppointmentData,
2121
appointmentTemplate: new EmptyTemplate(),

packages/devextreme/js/__internal/scheduler/appointments_new/appointment/agenda_appointment.test.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import type { AppointmentResource } from '@ts/scheduler/utils/resource_manager/a
88
import fx from '../../../common/core/animation/fx';
99
import { getBaseAppointmentProperties } from '../__mock__/appointment_properties';
1010
import { AGENDA_APPOINTMENT_CLASSES, APPOINTMENT_CLASSES } from '../const';
11-
import type { AgendaAppointmentProperties } from './agenda_appointment';
12-
import { AgendaAppointment } from './agenda_appointment';
11+
import type { AgendaAppointmentViewProperties } from './agenda_appointment';
12+
import { AgendaAppointmentView } from './agenda_appointment';
1313

14-
const getAgendaAppointmentProperties = (
14+
const getProperties = (
1515
appointmentData: SafeAppointment,
1616
targetedAppointmentData?: TargetedAppointment,
17-
): AgendaAppointmentProperties => {
17+
): AgendaAppointmentViewProperties => {
1818
const baseProperties = getBaseAppointmentProperties(
1919
appointmentData,
2020
targetedAppointmentData,
@@ -34,12 +34,12 @@ const getAgendaAppointmentProperties = (
3434
};
3535

3636
const createAgendaAppointment = async (
37-
properties: AgendaAppointmentProperties,
38-
): Promise<AgendaAppointment> => {
37+
properties: AgendaAppointmentViewProperties,
38+
): Promise<AgendaAppointmentView> => {
3939
const $element = $('.root');
4040

4141
// @ts-expect-error
42-
const instance = new AgendaAppointment($element, properties);
42+
const instance = new AgendaAppointmentView($element, properties);
4343

4444
// Await for resources
4545
await new Promise(process.nextTick);
@@ -77,7 +77,7 @@ describe('AgendaAppointment', () => {
7777
true, false,
7878
])('should have correct class for modifiers.lastInGroup = %o', async (isLastInGroup) => {
7979
const instance = await createAgendaAppointment({
80-
...getAgendaAppointmentProperties(defaultAppointmentData),
80+
...getProperties(defaultAppointmentData),
8181
modifiers: { isLastInGroup },
8282
});
8383

@@ -94,7 +94,7 @@ describe('AgendaAppointment', () => {
9494
{ text: '', expected: '(No subject)' },
9595
])('should have correct title text for appointment text = %o', async ({ text, expected }) => {
9696
const instance = await createAgendaAppointment(
97-
getAgendaAppointmentProperties({
97+
getProperties({
9898
...defaultAppointmentData, text,
9999
}),
100100
);
@@ -107,7 +107,7 @@ describe('AgendaAppointment', () => {
107107
describe('Date text', () => {
108108
it('should have correct date text', async () => {
109109
const instance = await createAgendaAppointment(
110-
getAgendaAppointmentProperties({
110+
getProperties({
111111
...defaultAppointmentData,
112112
startDate: new Date(2024, 0, 1, 9, 0),
113113
endDate: new Date(2024, 0, 1, 10, 0),
@@ -129,7 +129,7 @@ describe('AgendaAppointment', () => {
129129
: defaultAppointmentData;
130130

131131
const instance = await createAgendaAppointment(
132-
getAgendaAppointmentProperties(appointmentData),
132+
getProperties(appointmentData),
133133
);
134134

135135
const $icon = instance.$element().find(`.${APPOINTMENT_CLASSES.RECURRENCE_ICON}`);
@@ -145,7 +145,7 @@ describe('AgendaAppointment', () => {
145145
const appointmentData = { ...defaultAppointmentData, allDay: isAllDay };
146146

147147
const instance = await createAgendaAppointment(
148-
getAgendaAppointmentProperties(appointmentData),
148+
getProperties(appointmentData),
149149
);
150150

151151
const $allDayText = instance.$element().find(`.${APPOINTMENT_CLASSES.ALL_DAY_TEXT}`);
@@ -159,7 +159,7 @@ describe('AgendaAppointment', () => {
159159
const resourceColor = 'rgb(255, 0, 0)';
160160

161161
const instance = await createAgendaAppointment({
162-
...getAgendaAppointmentProperties(defaultAppointmentData),
162+
...getProperties(defaultAppointmentData),
163163
getResourceColor: () => Promise.resolve(resourceColor),
164164
});
165165

@@ -170,7 +170,7 @@ describe('AgendaAppointment', () => {
170170

171171
it('should render resource list', async () => {
172172
const instance = await createAgendaAppointment({
173-
...getAgendaAppointmentProperties(defaultAppointmentData),
173+
...getProperties(defaultAppointmentData),
174174
getResourcesValues: () => {
175175
const resourceValues: AppointmentResource[] = [
176176
{ label: 'roomId', values: ['Room 1'] },
@@ -190,7 +190,7 @@ describe('AgendaAppointment', () => {
190190

191191
it('should not render resource list if there are no resources', async () => {
192192
const instance = await createAgendaAppointment({
193-
...getAgendaAppointmentProperties(defaultAppointmentData),
193+
...getProperties(defaultAppointmentData),
194194
getResourcesValues: () => Promise.resolve([]),
195195
});
196196

@@ -202,15 +202,15 @@ describe('AgendaAppointment', () => {
202202

203203
describe('Geometry', () => {
204204
it('should have correct height and width', async () => {
205-
const instance = await createAgendaAppointment(
206-
getAgendaAppointmentProperties({
205+
const instance = await createAgendaAppointment({
206+
...getProperties({
207207
...defaultAppointmentData,
208-
geometry: {
209-
height: 60,
210-
width: '80%',
211-
},
212208
}),
213-
);
209+
geometry: {
210+
height: 60,
211+
width: '80%',
212+
},
213+
});
214214

215215
expect(instance.$element().css('height')).toBe('60px');
216216
expect(instance.$element().css('width')).toBe('80%');

packages/devextreme/js/__internal/scheduler/appointments_new/appointment/agenda_appointment.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import type { AppointmentResource } from '@ts/scheduler/utils/resource_manager/a
66
import {
77
AGENDA_APPOINTMENT_CLASSES, ALL_DAY_TEXT, APPOINTMENT_CLASSES, RECURRING_LABEL,
88
} from '../const';
9-
import type { BaseAppointmentProperties } from './base_appointment';
10-
import { BaseAppointment } from './base_appointment';
9+
import type { BaseAppointmentViewProperties } from './base_appointment';
10+
import { BaseAppointmentView } from './base_appointment';
1111

12-
export interface AgendaAppointmentProperties extends BaseAppointmentProperties {
12+
export interface AgendaAppointmentViewProperties extends BaseAppointmentViewProperties {
1313
modifiers: {
1414
isLastInGroup: boolean;
1515
};
@@ -24,7 +24,7 @@ export interface AgendaAppointmentProperties extends BaseAppointmentProperties {
2424
) => Promise<AppointmentResource[]>;
2525
}
2626

27-
export class AgendaAppointment extends BaseAppointment<AgendaAppointmentProperties> {
27+
export class AgendaAppointmentView extends BaseAppointmentView<AgendaAppointmentViewProperties> {
2828
protected override applyElementClasses(): void {
2929
super.applyElementClasses();
3030

packages/devextreme/js/__internal/scheduler/appointments_new/appointment/base_appointment.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import $ from '@js/core/renderer';
66
import fx from '../../../common/core/animation/fx';
77
import { getBaseAppointmentProperties } from '../__mock__/appointment_properties';
88
import { APPOINTMENT_CLASSES, APPOINTMENT_TYPE_CLASSES } from '../const';
9-
import type { BaseAppointmentProperties } from './base_appointment';
10-
import { BaseAppointment } from './base_appointment';
9+
import type { BaseAppointmentViewProperties } from './base_appointment';
10+
import { BaseAppointmentView } from './base_appointment';
1111

1212
const createBaseAppointment = async (
13-
properties: BaseAppointmentProperties,
14-
): Promise<BaseAppointment> => {
13+
properties: BaseAppointmentViewProperties,
14+
): Promise<BaseAppointmentView> => {
1515
const $element = $('.root');
1616

1717
// @ts-expect-error
18-
const instance = new BaseAppointment($element, properties);
18+
const instance = new BaseAppointmentView($element, properties);
1919

2020
// Await for resources
2121
await new Promise(process.nextTick);

packages/devextreme/js/__internal/scheduler/appointments_new/appointment/base_appointment.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import type { AppointmentDataAccessor } from '@ts/scheduler/utils/data_accessor/
1616
import { APPOINTMENT_CLASSES, APPOINTMENT_TYPE_CLASSES } from '../const';
1717
import { DateFormatType, getDateTextFromTargetAppointment } from '../utils/get_date_text';
1818

19-
export interface BaseAppointmentProperties
19+
export interface BaseAppointmentViewProperties
2020
// eslint-disable-next-line @typescript-eslint/no-explicit-any
21-
extends DOMComponentProperties<BaseAppointment<any>>
21+
extends DOMComponentProperties<BaseAppointmentView<any>>
2222
{
2323
appointmentData: SafeAppointment;
2424
targetedAppointmentData: TargetedAppointment;
@@ -34,9 +34,9 @@ export interface BaseAppointmentProperties
3434
getResourceColor: () => Promise<string | undefined>;
3535
}
3636

37-
export class BaseAppointment<
38-
TProperties extends BaseAppointmentProperties = BaseAppointmentProperties,
39-
> extends DOMComponent<BaseAppointment<TProperties>, TProperties> {
37+
export class BaseAppointmentView<
38+
TProperties extends BaseAppointmentViewProperties = BaseAppointmentViewProperties,
39+
> extends DOMComponent<BaseAppointmentView<TProperties>, TProperties> {
4040
protected get targetedAppointmentData(): TargetedAppointment {
4141
return this.option().targetedAppointmentData;
4242
}
@@ -145,4 +145,4 @@ export class BaseAppointment<
145145

146146
// TODO<Appointments>: rename to dxSchedulerAppointment when old impl is removed
147147
// eslint-disable-next-line @typescript-eslint/no-explicit-any
148-
registerComponent('dxSchedulerNewAppointment', BaseAppointment as any);
148+
registerComponent('dxSchedulerNewAppointment', BaseAppointmentView as any);

packages/devextreme/js/__internal/scheduler/appointments_new/appointment/grid_appointment.test.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import type { SafeAppointment } from '@ts/scheduler/types';
77
import fx from '../../../common/core/animation/fx';
88
import { getBaseAppointmentProperties } from '../__mock__/appointment_properties';
99
import { APPOINTMENT_CLASSES, APPOINTMENT_TYPE_CLASSES } from '../const';
10-
import type { GridAppointmentProperties } from './grid_appointment';
11-
import { GridAppointment } from './grid_appointment';
10+
import type { GridAppointmentViewProperties } from './grid_appointment';
11+
import { GridAppointmentView } from './grid_appointment';
1212

13-
const getGridAppointmentProperties = (
13+
const getProperties = (
1414
appointmentData: SafeAppointment,
15-
): GridAppointmentProperties => {
15+
): GridAppointmentViewProperties => {
1616
const baseProperties = getBaseAppointmentProperties(appointmentData);
1717

1818
return {
@@ -27,12 +27,12 @@ const getGridAppointmentProperties = (
2727
};
2828

2929
const createGridAppointment = async (
30-
properties: GridAppointmentProperties,
31-
): Promise<GridAppointment> => {
30+
properties: GridAppointmentViewProperties,
31+
): Promise<GridAppointmentView> => {
3232
const $element = $('.root');
3333

3434
// @ts-expect-error
35-
const instance = new GridAppointment($element, properties);
35+
const instance = new GridAppointmentView($element, properties);
3636

3737
// Await for resources
3838
await new Promise(process.nextTick);
@@ -69,7 +69,7 @@ describe('GridAppointment', () => {
6969
describe('Classes', () => {
7070
it('should have container class', async () => {
7171
const instance = await createGridAppointment(
72-
getGridAppointmentProperties(defaultAppointmentData),
72+
getProperties(defaultAppointmentData),
7373
);
7474

7575
expect(instance.$element().hasClass(APPOINTMENT_CLASSES.CONTAINER)).toBe(true);
@@ -79,7 +79,7 @@ describe('GridAppointment', () => {
7979
true, false,
8080
])('should have correct empty class for modifiers.empty = %o', async (empty) => {
8181
const instance = await createGridAppointment({
82-
...getGridAppointmentProperties(defaultAppointmentData),
82+
...getProperties(defaultAppointmentData),
8383
modifiers: { empty },
8484
});
8585

@@ -94,7 +94,7 @@ describe('GridAppointment', () => {
9494
{ text: '', expected: '(No subject)' },
9595
])('should have correct title text for appointment text = %o', async ({ text, expected }) => {
9696
const instance = await createGridAppointment(
97-
getGridAppointmentProperties({
97+
getProperties({
9898
...defaultAppointmentData,
9999
text,
100100
}),
@@ -109,7 +109,7 @@ describe('GridAppointment', () => {
109109
describe('Date text', () => {
110110
it('should have correct date text', async () => {
111111
const instance = await createGridAppointment(
112-
getGridAppointmentProperties({
112+
getProperties({
113113
...defaultAppointmentData,
114114
startDate: new Date(2024, 0, 1, 9, 0),
115115
endDate: new Date(2024, 0, 1, 10, 0),
@@ -125,7 +125,7 @@ describe('GridAppointment', () => {
125125
describe('Geometry', () => {
126126
it('should apply geometry on init', async () => {
127127
const instance = await createGridAppointment({
128-
...getGridAppointmentProperties(defaultAppointmentData),
128+
...getProperties(defaultAppointmentData),
129129
geometry: {
130130
top: 10, left: 15, width: 100, height: 50,
131131
},
@@ -141,7 +141,7 @@ describe('GridAppointment', () => {
141141

142142
it('should apply new geometry when resize() is called', async () => {
143143
const instance = await createGridAppointment({
144-
...getGridAppointmentProperties(defaultAppointmentData),
144+
...getProperties(defaultAppointmentData),
145145
geometry: {
146146
top: 10, left: 15, width: 100, height: 50,
147147
},
@@ -170,7 +170,7 @@ describe('GridAppointment', () => {
170170
true, false,
171171
])('should have correct recurrence icon visibility for isRecurring = %o', async (isRecurring) => {
172172
const instance = await createGridAppointment(
173-
getGridAppointmentProperties({
173+
getProperties({
174174
...defaultAppointmentData,
175175
recurrenceRule: isRecurring ? 'FREQ=DAILY' : undefined,
176176
}),
@@ -187,7 +187,7 @@ describe('GridAppointment', () => {
187187
true, false,
188188
])('should have correct all day text visibility for allDay = %o', async (allDay) => {
189189
const instance = await createGridAppointment(
190-
getGridAppointmentProperties({
190+
getProperties({
191191
...defaultAppointmentData,
192192
allDay,
193193
}),
@@ -202,7 +202,7 @@ describe('GridAppointment', () => {
202202
describe('Resources', () => {
203203
it('should apply resource color', async () => {
204204
const instance = await createGridAppointment({
205-
...getGridAppointmentProperties(defaultAppointmentData),
205+
...getProperties(defaultAppointmentData),
206206
getResourceColor: () => Promise.resolve('red'),
207207
});
208208

@@ -211,7 +211,7 @@ describe('GridAppointment', () => {
211211

212212
it('should not have background-color css when no resource', async () => {
213213
const instance = await createGridAppointment({
214-
...getGridAppointmentProperties(defaultAppointmentData),
214+
...getProperties(defaultAppointmentData),
215215
getResourceColor: () => Promise.resolve(undefined),
216216
});
217217

packages/devextreme/js/__internal/scheduler/appointments_new/appointment/grid_appointment.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import $ from '@js/core/renderer';
44
import {
55
ALL_DAY_TEXT, APPOINTMENT_CLASSES, APPOINTMENT_TYPE_CLASSES, RECURRING_LABEL,
66
} from '../const';
7-
import type { BaseAppointmentProperties } from './base_appointment';
8-
import { BaseAppointment } from './base_appointment';
7+
import type { BaseAppointmentViewProperties } from './base_appointment';
8+
import { BaseAppointmentView } from './base_appointment';
99

10-
export interface GridAppointmentProperties extends BaseAppointmentProperties {
10+
export interface GridAppointmentViewProperties extends BaseAppointmentViewProperties {
1111
geometry: {
1212
height: number;
1313
width: number;
@@ -19,7 +19,7 @@ export interface GridAppointmentProperties extends BaseAppointmentProperties {
1919
}
2020
}
2121

22-
export class GridAppointment extends BaseAppointment<GridAppointmentProperties> {
22+
export class GridAppointmentView extends BaseAppointmentView<GridAppointmentViewProperties> {
2323
override _initMarkup(): void {
2424
super._initMarkup();
2525

0 commit comments

Comments
 (0)