fix(plan): add 'Upravit celý rozsah' button, use class-based action rows
This commit is contained in:
@@ -203,6 +203,23 @@ export default function PlanWork() {
|
||||
setModalCell(null);
|
||||
}, [setHookModal]);
|
||||
|
||||
// Switch the modal from "day-in-range" to "edit-range" mode, keeping the
|
||||
// same cell context so the EditForm opens with the range's values.
|
||||
const switchToEditRange = useCallback(
|
||||
(entryId: number, userId: number, date: string) => {
|
||||
const cell = getCell(grid, userId, date);
|
||||
if (!cell) return;
|
||||
setModalCell(cell);
|
||||
setHookModal({
|
||||
kind: "edit-range",
|
||||
entryId,
|
||||
userId,
|
||||
date,
|
||||
});
|
||||
},
|
||||
[grid, setHookModal],
|
||||
);
|
||||
|
||||
// --- Mutation wrappers -----------------------------------------------------
|
||||
// The modal calls these with plain objects / ids. We resolve them to the
|
||||
// hook's mutateAsync calls and surface server errors as alerts.
|
||||
@@ -468,6 +485,7 @@ export default function PlanWork() {
|
||||
onUpdateOverride={updateOverrideFn}
|
||||
onDeleteOverride={deleteOverrideFn}
|
||||
onCreateOverrideFromRange={createOverrideFromRange}
|
||||
onSwitchToEditRange={switchToEditRange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user