Enhance full-page editor layout and integrate form editor actions
Deploy Development / deploy (push) Successful in 41s
Test Suite / pytest-backend (push) Successful in 37s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Failing after 6m4s

- Updated CSS styles for the full-page editor, introducing a sticky header and mobile dock for improved navigation.
- Refactored App component to include FormEditorActionsProvider and FormEditorBottomSlot for better form handling.
- Simplified TrainingUnitFormShell by removing the FormActionBar, streamlining the form structure and enhancing usability.
This commit is contained in:
Lars committed 2026-05-19 11:18:54 +02:00
1 parent 734d943d73
commit 6a9351874f
6 files changed
+253 -137

No files matched your search

@@ -0,0 +1,48 @@
import React, { useMemo } from 'react'
import { Link } from 'react-router-dom'
import FormActionBar from './FormActionBar'
import { useFormEditorActions } from '../context/FormEditorActionsContext'
/**
* Vollseiten-Editor: sticky Kopfzeile (Desktop) + Mobile-Dock via FormEditorActionsProvider.
*/
export default function PageFormEditorChrome({
title,
backTo,
backLabel = 'Zurück',
actionConfig,
children,
testId,
}) {
useFormEditorActions(actionConfig)
const headerBar = useMemo(() => {
if (!actionConfig) return null
return (
<FormActionBar
{...actionConfig}
placement="top"
variant="page"
/>
)
}, [actionConfig])
return (
<div className="page-form-editor" data-testid={testId}>
<header className="page-form-editor__header">
<div className="page-form-editor__intro">
{backTo ? (
<Link to={backTo} className="page-form-editor__back">
← {backLabel}
</Link>
) : null}
<h1 className="page-form-editor__title">{title}</h1>
</div>
{headerBar ? (
<div className="page-form-editor__header-actions">{headerBar}</div>
) : null}
</header>
<div className="page-form-editor__body">{children}</div>
</div>
)
}
@@ -1,6 +1,5 @@
import React, { useEffect, useMemo, useState } from 'react'
import { Link } from 'react-router-dom'
import FormActionBar from '../FormActionBar'
import TrainingPlanExerciseVisibilityPanel from '../TrainingPlanExerciseVisibilityPanel'
import TrainingUnitSectionsEditor from '../TrainingUnitSectionsEditor'
import { activeClubMemberships } from '../../utils/activeClub'
@@ -16,7 +15,6 @@ export default function TrainingUnitFormShell({
setFormData,
onSaveOnly,
onSaveAndClose,
onCancel,
draftPlanTemplateId,
onDraftTemplateSelect,
planTemplates,
@@ -33,7 +31,6 @@ export default function TrainingUnitFormShell({
onRequestTrainingModulePick,
onRequestExercisePick,
onPeekExercise,
saving = false,
formId = 'planning-unit-form',
}) {
const [newTplVisibility, setNewTplVisibility] = useState('private')
@@ -52,14 +49,9 @@ export default function TrainingUnitFormShell({
}, [planningClubId, memberClubs])
return (
<div className="planning-unit-edit-host__body" data-testid="planning-unit-form">
<h1 className="page-title" style={{ marginBottom: '1rem', flexShrink: 0 }}>
{editingUnit ? 'Trainingseinheit bearbeiten' : 'Neue Trainingseinheit'}
</h1>
<form
id={formId}
className="card page-form-shell page-form-shell--fill"
className="card page-form-shell"
style={{ padding: 'clamp(14px, 3vw, 1.75rem)' }}
onSubmit={(e) => (onSaveAndClose ? onSaveAndClose(e) : onSaveOnly?.(e))}
>
@@ -488,20 +480,6 @@ export default function TrainingUnitFormShell({
/>
</div>
</div>
<FormActionBar
placement="bottom"
variant="page"
formId={formId}
saving={saving}
isNew={!editingUnit}
onSave={onSaveOnly ? () => onSaveOnly() : undefined}
onSaveAndClose={onSaveAndClose ? () => onSaveAndClose() : undefined}
onCancel={onCancel}
showSave={Boolean(onSaveOnly)}
showSaveAndClose
/>
</form>
</div>
)
}