diff --git a/frontend/src/components/EventForm.tsx b/frontend/src/components/EventForm.tsx index bf4fe1d..227c412 100644 --- a/frontend/src/components/EventForm.tsx +++ b/frontend/src/components/EventForm.tsx @@ -64,6 +64,8 @@ export default function EventForm({ eventId, initialDate, occurrenceStart, scope const [historyOpen, setHistoryOpen] = useState(false) const [history, setHistory] = useState(null) + const [deptsOpen, setDeptsOpen] = useState(false) + const [assigneesOpen, setAssigneesOpen] = useState(false) useEffect(() => { fetchCalendars().then(setCalendars).catch(() => {}) @@ -303,51 +305,77 @@ export default function EventForm({ eventId, initialDate, occurrenceStart, scope )}
- {editingOccurrence ? ( -
- {selectedDepts.length === 0 && None} - {selectedDepts.map(d => {d.name})} -
+ <> + +
+ {selectedDepts.length === 0 && None} + {selectedDepts.map(d => {d.name})} +
+ ) : ( -
- {departments.map(dept => ( - - ))} - {departments.length === 0 && No departments configured.} +
+
setDeptsOpen(v => !v)}> + Departments + + {selectedDepts.length === 0 ? 'None selected' : selectedDepts.map(d => d.name).join(', ')} + + +
+ {deptsOpen && ( +
+ {departments.map(dept => ( + + ))} + {departments.length === 0 && No departments configured.} +
+ )}
)}
- {editingOccurrence ? ( -
- {selectedAssignees.length === 0 && None} - {selectedAssignees.map(a => {a.name})} -
+ <> + +
+ {selectedAssignees.length === 0 && None} + {selectedAssignees.map(a => {a.name})} +
+ ) : ( -
- {users.map(u => ( - - ))} - {users.length === 0 && No staff available.} +
+
setAssigneesOpen(v => !v)}> + Assignees + + {selectedAssignees.length === 0 ? 'None selected' : selectedAssignees.map(a => a.name).join(', ')} + + +
+ {assigneesOpen && ( +
+ {users.map(u => ( + + ))} + {users.length === 0 && No staff available.} +
+ )}
)}