Implement planning layout and enhance training module functionality
Deploy Development / deploy (push) Failing after 23s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Failing after 6s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Has been cancelled

- Added a new PlanningLayout component to manage the training planning interface, allowing for better organization of related pages.
- Introduced a FormActionBar component across various modals and forms to standardize action buttons for saving and canceling.
- Updated the TrainingPlanningPageRoot and TrainingPlanningUnitFormModal to utilize the new FormActionBar for improved user experience.
- Enhanced the TrainingModuleEditPage and TrainingFrameworkProgramEditPage with save and close functionality, streamlining the editing process.
- Refactored existing modals to incorporate the new layout and action bar, ensuring consistency across the application.
This commit is contained in:
Lars committed 2026-05-19 10:02:39 +02:00
1 parent 82705f0c3e
commit 4fee5a2b47
14 files changed
+525 -207

No files matched your search

@@ -1,5 +1,6 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import FormActionBar from '../FormActionBar'
import api from '../../utils/api'
import { useToast } from '../../context/ToastContext'
import { useAuth } from '../../context/AuthContext'
@@ -160,17 +161,16 @@ export default function SaveExercisesAsModuleModal({
}}
>
<div
className="card"
className="card modal-panel--form"
style={{
maxWidth: 'min(560px, 100%)',
width: '100%',
padding: '1.25rem',
maxHeight: '90vh',
overflowY: 'auto',
}}
>
<h2 style={{ marginTop: 0, marginBottom: '0.65rem' }}>Übungen als Trainingsmodul</h2>
<p style={{ fontSize: '0.88rem', color: 'var(--text2)', lineHeight: 1.45, marginBottom: '1rem' }}>
<h2 style={{ marginTop: 0, marginBottom: '0.65rem', flexShrink: 0 }}>Übungen als Trainingsmodul</h2>
<p style={{ fontSize: '0.88rem', color: 'var(--text2)', lineHeight: 1.45, marginBottom: '1rem', flexShrink: 0 }}>
Es werden die <strong>gespeicherten</strong> Übungspositionen der Einheit vom{' '}
<strong>{unitLabel || '…'}</strong> verwendet. Speichere die Planung vorher, wenn du den aktuellen Stand
brauchst.
@@ -183,7 +183,8 @@ export default function SaveExercisesAsModuleModal({
) : candidates.length === 0 ? (
<p style={{ color: 'var(--text2)' }}>In dieser Einheit sind keine Übungen im Ablauf hinterlegt.</p>
) : (
<form onSubmit={handleSubmit}>
<form id="save-module-form" className="modal-form-shell" onSubmit={handleSubmit}>
<div className="modal-form-shell__body">
<div style={{ marginBottom: '1rem' }}>
<label className="form-label">Modultitel</label>
<input
@@ -286,14 +287,17 @@ export default function SaveExercisesAsModuleModal({
</div>
) : null}
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '10px', justifyContent: 'flex-end' }}>
<button type="button" className="btn btn-secondary" onClick={onClose} disabled={submitting}>
Abbrechen
</button>
<button type="submit" className="btn btn-primary" disabled={submitting || !candidates.length}>
{submitting ? 'Speichern…' : 'Modul anlegen'}
</button>
</div>
<FormActionBar
placement="bottom"
variant="modal"
formId="save-module-form"
saving={submitting}
showSave={false}
saveAndCloseLabel="Modul anlegen"
onCancel={onClose}
/>
</form>
)}