Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -209,25 +209,25 @@ $fluent-scheduler-agenda-time-panel-cell-padding: 8px;

&.dx-scheduler-appointment-recurrence {
@container (max-height: #{$fluent-scheduler-appointment-15min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $fluent-scheduler-appointment-10min-recurrence-padding-right;
}
}

@container (min-height: #{$fluent-scheduler-appointment-15min-height}) and (max-height: #{$fluent-scheduler-appointment-20min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $fluent-scheduler-appointment-15min-recurrence-padding-right;
}
}

@container (min-height: #{$fluent-scheduler-appointment-20min-height}) and (max-height: #{$fluent-scheduler-appointment-25min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $fluent-scheduler-appointment-20min-recurrence-padding-right;
}
}
}

.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
@container (max-height: #{$fluent-scheduler-appointment-25min-height}) {
display: flex;
align-items: center;
Expand All @@ -245,7 +245,7 @@ $fluent-scheduler-agenda-time-panel-cell-padding: 8px;
}

@container (max-height: #{$fluent-scheduler-appointment-15min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
.dx-scheduler-appointment-title {
font-size: $fluent-scheduler-appointment-10min-title-font-size;
line-height: $fluent-scheduler-appointment-10min-title-line-height;
Expand All @@ -259,7 +259,7 @@ $fluent-scheduler-agenda-time-panel-cell-padding: 8px;
}

@container (min-height: #{$fluent-scheduler-appointment-15min-height}) and (max-height: #{$fluent-scheduler-appointment-20min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
.dx-scheduler-appointment-title {
font-size: $fluent-scheduler-appointment-15min-title-font-size;
line-height: $fluent-scheduler-appointment-15min-title-line-height;
Expand All @@ -273,7 +273,7 @@ $fluent-scheduler-agenda-time-panel-cell-padding: 8px;
}

@container (min-height: #{$fluent-scheduler-appointment-20min-height}) and (max-height: #{$fluent-scheduler-appointment-25min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
.dx-scheduler-appointment-recurrence-icon {
right: $fluent-scheduler-appointment-20min-icon-right;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,25 +587,25 @@ $generic-scheduler-agenda-group-header-padding: $generic-scheduler-agenda-time-c

&.dx-scheduler-appointment-recurrence {
@container (max-height: #{$generic-scheduler-appointment-15min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $generic-scheduler-appointment-10min-recurrence-padding-right;
}
}

@container (min-height: #{$generic-scheduler-appointment-15min-height}) and (max-height: #{$generic-scheduler-appointment-20min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $generic-scheduler-appointment-15min-recurrence-padding-right;
}
}

@container (min-height: #{$generic-scheduler-appointment-20min-height}) and (max-height: #{$generic-scheduler-appointment-25min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $generic-scheduler-appointment-20min-recurrence-padding-right;
}
}
}

.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
@container (max-height: #{$generic-scheduler-appointment-25min-height}) {
display: flex;
align-items: center;
Expand All @@ -623,7 +623,7 @@ $generic-scheduler-agenda-group-header-padding: $generic-scheduler-agenda-time-c
}

@container (max-height: #{$generic-scheduler-appointment-15min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
.dx-scheduler-appointment-title {
font-size: $generic-scheduler-appointment-10min-title-font-size;
line-height: $generic-scheduler-appointment-10min-title-line-height;
Expand All @@ -637,7 +637,7 @@ $generic-scheduler-agenda-group-header-padding: $generic-scheduler-agenda-time-c
}

@container (min-height: #{$generic-scheduler-appointment-15min-height}) and (max-height: #{$generic-scheduler-appointment-20min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
.dx-scheduler-appointment-title {
font-size: $generic-scheduler-appointment-15min-title-font-size;
line-height: $generic-scheduler-appointment-15min-title-line-height;
Expand All @@ -652,7 +652,7 @@ $generic-scheduler-agenda-group-header-padding: $generic-scheduler-agenda-time-c

@if $size == "compact" {
@container (max-height: #{$generic-scheduler-appointment-10min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
display: none;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,25 @@ $material-scheduler-agenda-time-panel-cell-padding: 8px;

&.dx-scheduler-appointment-recurrence {
@container (max-height: #{$material-scheduler-appointment-15min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $material-scheduler-appointment-10min-recurrence-padding-right;
}
}

@container (min-height: #{$material-scheduler-appointment-15min-height}) and (max-height: #{$material-scheduler-appointment-20min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $material-scheduler-appointment-15min-recurrence-padding-right;
}
}

@container (min-height: #{$material-scheduler-appointment-20min-height}) and (max-height: #{$material-scheduler-appointment-25min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
padding-right: $material-scheduler-appointment-20min-recurrence-padding-right;
}
}
}

.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
@container (max-height: #{$material-scheduler-appointment-25min-height}) {
display: flex;
align-items: center;
Expand All @@ -218,7 +218,7 @@ $material-scheduler-agenda-time-panel-cell-padding: 8px;
}

@container (max-height: #{$material-scheduler-appointment-15min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
.dx-scheduler-appointment-title {
font-size: $material-scheduler-appointment-10min-title-font-size;
line-height: $material-scheduler-appointment-10min-title-line-height;
Expand All @@ -232,7 +232,7 @@ $material-scheduler-agenda-time-panel-cell-padding: 8px;
}

@container (min-height: #{$material-scheduler-appointment-15min-height}) and (max-height: #{$material-scheduler-appointment-20min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
.dx-scheduler-appointment-title {
font-size: $material-scheduler-appointment-15min-title-font-size;
line-height: $material-scheduler-appointment-15min-title-line-height;
Expand All @@ -246,7 +246,7 @@ $material-scheduler-agenda-time-panel-cell-padding: 8px;
}

@container (min-height: #{$material-scheduler-appointment-20min-height}) and (max-height: #{$material-scheduler-appointment-25min-height}) {
.dx-item-content.dx-scheduler-appointment-content {
.dx-scheduler-appointment-content {
.dx-scheduler-appointment-recurrence-icon {
right: $material-scheduler-appointment-20min-icon-right;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { mockAppointmentDataAccessor } from '@ts/scheduler/__mock__/appointment_data_accessor.mock';
import { getResourceManagerMock } from '@ts/scheduler/__mock__/resource_manager.mock';
import type { SafeAppointment } from '@ts/scheduler/types';
import type { AppointmentDataAccessor } from '@ts/scheduler/utils/data_accessor/appointment_data_accessor';
import type { ResourceConfig } from '@ts/scheduler/utils/loader/types';
import type { AppointmentAgendaViewModel, AppointmentCollectorViewModel, AppointmentItemViewModel } from '@ts/scheduler/view_model/types';

import type { BaseAppointmentProperties } from '../appointment/base_appointment';
import { getTargetedAppointment } from '../utils/get_targeted_appointment';

export const mockGridViewModel = (
appointmentData: SafeAppointment,
partialViewModel?: Partial<AppointmentItemViewModel>,
): AppointmentItemViewModel => {
const sourceAppointment = {
allDay: appointmentData.allDay,
startDate: appointmentData.startDate as Date,
endDate: appointmentData.endDate as Date,
};

const viewModel: AppointmentItemViewModel = {
itemData: appointmentData,
allDay: appointmentData.allDay ?? false,
groupIndex: appointmentData.groupIndex ?? 0,
sortedIndex: appointmentData.sortedIndex ?? 0,
info: {
sourceAppointment,
appointment: { ...sourceAppointment },
},
direction: 'horizontal',
skipResizing: false,
level: 0,
maxLevel: 0,
empty: false,
left: 0,
top: 0,
height: 0,
width: 0,
reduced: undefined,
partIndex: 0,
partTotalCount: 0,
rowIndex: 0,
columnIndex: 0,
};

return {
...viewModel,
...partialViewModel,
};
};

export const mockAgendaViewModel = (
appointmentData: SafeAppointment,
partialViewModel?: Partial<AppointmentAgendaViewModel>,
): AppointmentAgendaViewModel => {
const sourceAppointment = {
allDay: appointmentData.allDay,
startDate: appointmentData.startDate as Date,
endDate: appointmentData.endDate as Date,
};

const viewModel: AppointmentAgendaViewModel = {
itemData: appointmentData,
allDay: appointmentData.allDay ?? false,
groupIndex: appointmentData.groupIndex ?? 0,
sortedIndex: appointmentData.sortedIndex ?? 0,
isAgendaModel: true,
height: 50,
width: '100',
isLastInGroup: appointmentData.isLastInGroup ?? false,
info: {
sourceAppointment,
appointment: { ...sourceAppointment },
partialDates: { ...sourceAppointment },
},
};

return {
...viewModel,
...partialViewModel,
};
};

export const mockAppointmentCollectorViewModel = (
appointmentData: SafeAppointment,
partialViewModel?: Partial<AppointmentCollectorViewModel>,
): AppointmentCollectorViewModel => ({
itemData: appointmentData,
allDay: appointmentData.allDay ?? false,
groupIndex: appointmentData.groupIndex ?? 0,
sortedIndex: appointmentData.sortedIndex ?? 0,
top: 0,
left: 0,
height: 0,
width: 0,
isCompact: false,
items: [mockGridViewModel(appointmentData)],
...partialViewModel,
});

export const getMockedBaseAppointmentProperties = <
TViewModel extends AppointmentItemViewModel | AppointmentAgendaViewModel,
>(options: {
appointmentData: SafeAppointment;
viewModel: TViewModel;
resources?: ResourceConfig[]
}): BaseAppointmentProperties => {
const resourceManager = getResourceManagerMock(options.resources ?? []);
const dataAccessor = mockAppointmentDataAccessor;
const targetedAppointmentData = getTargetedAppointment(
options.viewModel,
dataAccessor,
resourceManager,
);

const config: BaseAppointmentProperties = {
viewModel: options.viewModel,
targetedAppointmentData,
appointmentTemplate: 'appointment',
onAppointmentRendered: () => {},
getResourceManager: () => resourceManager,
getDataAccessor: (): AppointmentDataAccessor => mockAppointmentDataAccessor,
};

return config;
};
Loading
Loading