Compare commits
3 Commits
718ecefd46
...
b3dd46195d
| Author | SHA1 | Date | |
|---|---|---|---|
| b3dd46195d | |||
| 54294ce7e9 | |||
| 5141a1f3ac |
@@ -22,6 +22,10 @@ const props = defineProps({
|
|||||||
inModal: {
|
inModal: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
|
draggable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
platform: {
|
platform: {
|
||||||
type: String,
|
type: String,
|
||||||
}
|
}
|
||||||
@@ -523,6 +527,8 @@ const updateItem = async () => {
|
|||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
<UDashboardNavbar
|
<UDashboardNavbar
|
||||||
v-else
|
v-else
|
||||||
|
:data-draggable-handle="props.draggable ? '' : undefined"
|
||||||
|
:class="props.draggable ? 'cursor-move select-none' : undefined"
|
||||||
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
||||||
>
|
>
|
||||||
<template #center>
|
<template #center>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
import { useDraggable } from '@vueuse/core'
|
||||||
|
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
@@ -31,6 +32,23 @@ const loaded = ref(false)
|
|||||||
const items = ref([])
|
const items = ref([])
|
||||||
const item = ref({})
|
const item = ref({})
|
||||||
|
|
||||||
|
const isDraggableVendorCreate = computed(() => props.type === "vendors" && props.mode === "create")
|
||||||
|
const draggableWindow = ref(null)
|
||||||
|
const initialWindowPosition = import.meta.client
|
||||||
|
? {
|
||||||
|
x: Math.max(16, (window.innerWidth - Math.min(1024, window.innerWidth - 32)) / 2),
|
||||||
|
y: Math.max(16, Math.min(96, window.innerHeight * 0.1)),
|
||||||
|
}
|
||||||
|
: { x: 16, y: 16 }
|
||||||
|
|
||||||
|
const { style: draggableWindowStyle } = useDraggable(draggableWindow, {
|
||||||
|
initialValue: initialWindowPosition,
|
||||||
|
onStart: (_position, event) => {
|
||||||
|
const target = event.target
|
||||||
|
return target instanceof Element && Boolean(target.closest('[data-draggable-handle]'))
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
if(props.mode === "show") {
|
if(props.mode === "show") {
|
||||||
//Load Data for Show
|
//Load Data for Show
|
||||||
@@ -60,7 +78,30 @@ setupPage()
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UModal :fullscreen="props.mode === 'show'">
|
<div
|
||||||
|
v-if="isDraggableVendorCreate"
|
||||||
|
ref="draggableWindow"
|
||||||
|
:style="draggableWindowStyle"
|
||||||
|
class="fixed z-[999] flex h-[80vh] max-h-[calc(100vh-2rem)] w-[calc(100vw-2rem)] max-w-5xl flex-col overflow-hidden resize rounded-xl border border-gray-200 bg-white shadow-2xl dark:border-gray-800 dark:bg-gray-900"
|
||||||
|
>
|
||||||
|
<EntityEdit
|
||||||
|
v-if="loaded"
|
||||||
|
:type="props.type"
|
||||||
|
:item="item"
|
||||||
|
:inModal="true"
|
||||||
|
:draggable="true"
|
||||||
|
@return-data="(data) => emit('returnData', data)"
|
||||||
|
:createQuery="props.createQuery"
|
||||||
|
:mode="props.mode"
|
||||||
|
/>
|
||||||
|
<UProgress
|
||||||
|
v-else
|
||||||
|
animation="carousel"
|
||||||
|
class="m-5 mt-10"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<UModal v-else :fullscreen="props.mode === 'show'">
|
||||||
<template #content>
|
<template #content>
|
||||||
<EntityShow
|
<EntityShow
|
||||||
v-if="loaded && props.mode === 'show'"
|
v-if="loaded && props.mode === 'show'"
|
||||||
|
|||||||
@@ -184,12 +184,16 @@ const resolvedPlanningBoardConfig = computed(() => {
|
|||||||
const normalizedStartTime = /^\d{2}:\d{2}$/.test(String(config.startTime || "")) ? String(config.startTime) : "06:00"
|
const normalizedStartTime = /^\d{2}:\d{2}$/.test(String(config.startTime || "")) ? String(config.startTime) : "06:00"
|
||||||
const normalizedEndTime = /^\d{2}:\d{2}$/.test(String(config.endTime || "")) ? String(config.endTime) : "21:00"
|
const normalizedEndTime = /^\d{2}:\d{2}$/.test(String(config.endTime || "")) ? String(config.endTime) : "21:00"
|
||||||
const normalizedSlotMinutes = Number(config.slotMinutes)
|
const normalizedSlotMinutes = Number(config.slotMinutes)
|
||||||
|
const normalizedWeekStartsOn = Number(config.weekStartsOn)
|
||||||
const allowedSlotMinutes = [15, 30, 60, 120, 180]
|
const allowedSlotMinutes = [15, 30, 60, 120, 180]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
startTime: normalizedStartTime,
|
startTime: normalizedStartTime,
|
||||||
endTime: normalizedEndTime,
|
endTime: normalizedEndTime,
|
||||||
slotMinutes: allowedSlotMinutes.includes(normalizedSlotMinutes) ? normalizedSlotMinutes : 180
|
slotMinutes: allowedSlotMinutes.includes(normalizedSlotMinutes) ? normalizedSlotMinutes : 180,
|
||||||
|
weekStartsOn: Number.isInteger(normalizedWeekStartsOn) && normalizedWeekStartsOn >= 1 && normalizedWeekStartsOn <= 5
|
||||||
|
? normalizedWeekStartsOn
|
||||||
|
: 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -295,6 +299,7 @@ const visibleDraftEventIds = computed(() =>
|
|||||||
const calendarOptions = computed(() => ({
|
const calendarOptions = computed(() => ({
|
||||||
schedulerLicenseKey: "CC-Attribution-NonCommercial-NoDerivatives",
|
schedulerLicenseKey: "CC-Attribution-NonCommercial-NoDerivatives",
|
||||||
locale: deLocale,
|
locale: deLocale,
|
||||||
|
firstDay: resolvedPlanningBoardConfig.value.weekStartsOn,
|
||||||
plugins: [resourceTimelinePlugin, interactionPlugin],
|
plugins: [resourceTimelinePlugin, interactionPlugin],
|
||||||
initialView: calendarView.value,
|
initialView: calendarView.value,
|
||||||
initialDate: calendarCurrentDate.value,
|
initialDate: calendarCurrentDate.value,
|
||||||
@@ -349,6 +354,7 @@ const calendarOptions = computed(() => ({
|
|||||||
resourceTimelineWeek: {
|
resourceTimelineWeek: {
|
||||||
type: "resourceTimeline",
|
type: "resourceTimeline",
|
||||||
duration: { days: 7 },
|
duration: { days: 7 },
|
||||||
|
dateAlignment: "week",
|
||||||
buttonText: "Woche",
|
buttonText: "Woche",
|
||||||
slotDuration: { minutes: resolvedPlanningBoardConfig.value.slotMinutes },
|
slotDuration: { minutes: resolvedPlanningBoardConfig.value.slotMinutes },
|
||||||
snapDuration: { minutes: resolvedPlanningBoardConfig.value.slotMinutes },
|
snapDuration: { minutes: resolvedPlanningBoardConfig.value.slotMinutes },
|
||||||
|
|||||||
@@ -130,10 +130,19 @@ const planningBoardTimeGridOptions = [
|
|||||||
{ label: "180 Minuten", value: 180 }
|
{ label: "180 Minuten", value: 180 }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const planningBoardWeekStartOptions = [
|
||||||
|
{ label: "Montag", value: 1 },
|
||||||
|
{ label: "Dienstag", value: 2 },
|
||||||
|
{ label: "Mittwoch", value: 3 },
|
||||||
|
{ label: "Donnerstag", value: 4 },
|
||||||
|
{ label: "Freitag", value: 5 }
|
||||||
|
]
|
||||||
|
|
||||||
const planningBoardConfig = reactive({
|
const planningBoardConfig = reactive({
|
||||||
startTime: auth.activeTenantData?.calendarConfig?.planningBoard?.startTime || "06:00",
|
startTime: auth.activeTenantData?.calendarConfig?.planningBoard?.startTime || "06:00",
|
||||||
endTime: auth.activeTenantData?.calendarConfig?.planningBoard?.endTime || "21:00",
|
endTime: auth.activeTenantData?.calendarConfig?.planningBoard?.endTime || "21:00",
|
||||||
slotMinutes: auth.activeTenantData?.calendarConfig?.planningBoard?.slotMinutes || 180
|
slotMinutes: auth.activeTenantData?.calendarConfig?.planningBoard?.slotMinutes || 180,
|
||||||
|
weekStartsOn: auth.activeTenantData?.calendarConfig?.planningBoard?.weekStartsOn ?? 1
|
||||||
})
|
})
|
||||||
|
|
||||||
const canManageMcpTokens = computed(() => Boolean(auth.user?.is_admin || auth.hasPermission("mcp.tokens.write")))
|
const canManageMcpTokens = computed(() => Boolean(auth.user?.is_admin || auth.hasPermission("mcp.tokens.write")))
|
||||||
@@ -238,6 +247,7 @@ const setupPage = async () => {
|
|||||||
planningBoardConfig.startTime = auth.activeTenantData?.calendarConfig?.planningBoard?.startTime || "06:00"
|
planningBoardConfig.startTime = auth.activeTenantData?.calendarConfig?.planningBoard?.startTime || "06:00"
|
||||||
planningBoardConfig.endTime = auth.activeTenantData?.calendarConfig?.planningBoard?.endTime || "21:00"
|
planningBoardConfig.endTime = auth.activeTenantData?.calendarConfig?.planningBoard?.endTime || "21:00"
|
||||||
planningBoardConfig.slotMinutes = auth.activeTenantData?.calendarConfig?.planningBoard?.slotMinutes || 180
|
planningBoardConfig.slotMinutes = auth.activeTenantData?.calendarConfig?.planningBoard?.slotMinutes || 180
|
||||||
|
planningBoardConfig.weekStartsOn = auth.activeTenantData?.calendarConfig?.planningBoard?.weekStartsOn ?? 1
|
||||||
}
|
}
|
||||||
|
|
||||||
const features = ref({ ...defaultFeatures, ...(auth.activeTenantData?.features || {}) })
|
const features = ref({ ...defaultFeatures, ...(auth.activeTenantData?.features || {}) })
|
||||||
@@ -571,7 +581,8 @@ const savePlanningBoardConfig = async () => {
|
|||||||
planningBoard: {
|
planningBoard: {
|
||||||
startTime: planningBoardConfig.startTime || "06:00",
|
startTime: planningBoardConfig.startTime || "06:00",
|
||||||
endTime: planningBoardConfig.endTime || "21:00",
|
endTime: planningBoardConfig.endTime || "21:00",
|
||||||
slotMinutes: Number(planningBoardConfig.slotMinutes) || 180
|
slotMinutes: Number(planningBoardConfig.slotMinutes) || 180,
|
||||||
|
weekStartsOn: Number(planningBoardConfig.weekStartsOn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -741,7 +752,7 @@ onMounted(() => {
|
|||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<h3 class="text-base font-semibold text-highlighted">Plantafel</h3>
|
<h3 class="text-base font-semibold text-highlighted">Plantafel</h3>
|
||||||
<p class="text-sm text-muted">Lege hier die Rahmenzeiten und den Rasterabstand für die Plantafel fest.</p>
|
<p class="text-sm text-muted">Lege hier Rahmenzeiten, Rasterabstand und Wochenbeginn für die Plantafel fest.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UFormField
|
<UFormField
|
||||||
@@ -767,6 +778,17 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
</UFormField>
|
</UFormField>
|
||||||
|
|
||||||
|
<UFormField
|
||||||
|
label="Wochenbeginn:"
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
v-model="planningBoardConfig.weekStartsOn"
|
||||||
|
:items="planningBoardWeekStartOptions"
|
||||||
|
label-key="label"
|
||||||
|
value-key="value"
|
||||||
|
/>
|
||||||
|
</UFormField>
|
||||||
|
|
||||||
<UButton
|
<UButton
|
||||||
class="mt-1"
|
class="mt-1"
|
||||||
@click="savePlanningBoardConfig"
|
@click="savePlanningBoardConfig"
|
||||||
|
|||||||
Reference in New Issue
Block a user