+
+
+
{getAppointmentTimeText(appointmentData)}
+
+ {gridDto?.gridOptions.schedulerOptionDto?.allowDeleting && (
+
+ )}
+
+ )
+ },
+ [getAppointmentHtml, getAppointmentTimeText, gridDto],
+ )
+
const onAppointmentFormOpening = useCallback(
(e: AppointmentFormOpeningEvent) => {
if (!gridDto) return
@@ -194,7 +268,11 @@ const SchedulerView = (props: SchedulerViewProps) => {
)
e.popup.option('showTitle', gridDto.gridOptions.editingOptionDto?.popup?.showTitle)
e.popup.option('width', gridDto.gridOptions.editingOptionDto?.popup?.width)
- e.popup.option('height', gridDto.gridOptions.editingOptionDto?.popup?.height)
+ e.popup.option('height', isPopupFullScreen ? '100%' : 'auto')
+ e.popup.option(
+ 'maxHeight',
+ isPopupFullScreen ? '100%' : gridDto.gridOptions.editingOptionDto?.popup?.height || '90vh',
+ )
e.popup.option('resizeEnabled', gridDto.gridOptions.editingOptionDto?.popup?.resizeEnabled)
e.popup.option('fullScreen', isPopupFullScreen)
@@ -282,11 +360,13 @@ const SchedulerView = (props: SchedulerViewProps) => {
if (newFullScreenState) {
e.popup.option('width', '100%')
e.popup.option('height', '100%')
+ e.popup.option('maxHeight', '100%')
} else {
e.popup.option('width', gridDto.gridOptions.editingOptionDto?.popup?.width || 600)
+ e.popup.option('height', 'auto')
e.popup.option(
- 'height',
- gridDto.gridOptions.editingOptionDto?.popup?.height || 'auto',
+ 'maxHeight',
+ gridDto.gridOptions.editingOptionDto?.popup?.height || '90vh',
)
}
},
@@ -429,7 +509,9 @@ const SchedulerView = (props: SchedulerViewProps) => {
editorScript: i.editorScript,
}
- if (i.fieldName?.indexOf(':') >= 0) {
+ if (i.captionName) {
+ item.label = { text: translate('::' + i.captionName) }
+ } else if (i.fieldName?.indexOf(':') >= 0) {
item.label = { text: captionize(i.fieldName.split(':')[1]) }
}
@@ -446,15 +528,25 @@ const SchedulerView = (props: SchedulerViewProps) => {
return item
}
+ const isVisibleFormItem = (item: SimpleItemWithColData) => {
+ if (currentMode === 'new') {
+ return item.canCreate && item.allowAdding
+ }
+
+ if (currentMode === 'edit') {
+ return item.canUpdate && item.allowEditing
+ }
+
+ return false
+ }
+
sortedFormDto.forEach((e: any) => {
// Items'ları da order'a göre sırala
const sortedItems = (e.items || [])
.slice()
- .sort((a: any, b: any) =>
- (a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1,
- )
+ .sort((a: any, b: any) => ((a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1))
- const groupItems = sortedItems.map(mapFormItem)
+ const groupItems = sortedItems.map(mapFormItem).filter(isVisibleFormItem)
if (e.itemType !== 'tabbed') {
// Grup kullanmadan direkt items'ları ekle - form'un colCount'u geçerli olsun
@@ -478,14 +570,7 @@ const SchedulerView = (props: SchedulerViewProps) => {
(a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1,
)
.map(mapFormItem)
- .filter((a: any) => {
- if (currentMode === 'new') {
- return a.canCreate || a.canRead
- } else if (currentMode === 'edit') {
- return a.canUpdate || a.canRead
- }
- return false
- }),
+ .filter(isVisibleFormItem),
}
}),
})
@@ -575,10 +660,12 @@ const SchedulerView = (props: SchedulerViewProps) => {
gridDto.gridOptions.schedulerOptionDto?.recurrenceExceptionExpr
}
startDayHour={gridDto.gridOptions.schedulerOptionDto?.startDayHour || 8}
- endDayHour={gridDto.gridOptions.schedulerOptionDto?.endDayHour || 18}
+ endDayHour={gridDto.gridOptions.schedulerOptionDto?.endDayHour || 20}
currentView={currentView}
onCurrentViewChange={onCurrentViewChange}
onAppointmentFormOpening={onAppointmentFormOpening}
+ appointmentRender={renderAppointment}
+ appointmentTooltipRender={renderAppointmentTooltip}
onAppointmentAdding={() => {
props.refreshData?.()
}}
@@ -610,28 +697,36 @@ const SchedulerView = (props: SchedulerViewProps) => {
| 5
| 6) || 1
}
- adaptivityEnabled={true}
+ adaptivityEnabled={false}
>