Skip to content
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}) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: This removes .dx-item-content from the selector, which changes CSS specificity. This is the only change that affects production (old implementation). The etalon screenshots changed — so there is a visual diff.

This feels out of place in this PR. Maybe move to a separate small PR so we can test it on its own?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if the screenshots changed because of this, but I would like to know if it was because of css or not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sjbur definitely screenshots changed because of this. But it seems that now it's better, because all day appts have the same padding-right as the common appts.

That happened because of .dx-item-content selector, some styles weren't applied to the all day appts.

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,28 @@
import { EmptyTemplate } from '@ts/core/templates/m_empty_template';
import { mockAppointmentDataAccessor } from '@ts/scheduler/__mock__/appointment_data_accessor.mock';
import type { SafeAppointment, TargetedAppointment } from '@ts/scheduler/types';
import type { AppointmentDataAccessor } from '@ts/scheduler/utils/data_accessor/appointment_data_accessor';

import type { BaseAppointmentViewProperties } from '../appointment/base_appointment';

export const getBaseAppointmentProperties = (
appointmentData: SafeAppointment,
targetedAppointmentData?: TargetedAppointment,
): BaseAppointmentViewProperties => {
const normalizedTargetedAppointmentData = targetedAppointmentData ?? {
...appointmentData,
displayStartDate: appointmentData.startDate as Date,
displayEndDate: appointmentData.endDate as Date,
};

const config: BaseAppointmentViewProperties = {
appointmentData,
targetedAppointmentData: normalizedTargetedAppointmentData,
appointmentTemplate: new EmptyTemplate(),
onAppointmentRendered: () => {},
getDataAccessor: (): AppointmentDataAccessor => mockAppointmentDataAccessor,
getResourceColor: (): Promise<string | undefined> => Promise.resolve(undefined),
};

return config;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import type { SafeAppointment } from '@ts/scheduler/types';
import type { AppointmentAgendaViewModel, AppointmentCollectorViewModel, AppointmentItemViewModel } from '@ts/scheduler/view_model/types';

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,
});
Loading
Loading