Update version to 0.8.147 and add functionality to save exercises as training modules
Test Suite / playwright-tests (push) Waiting to run
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Failing after 0s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Has been cancelled
Test Suite / playwright-tests (push) Waiting to run
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Failing after 0s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Has been cancelled
- Incremented app version to 0.8.147 and updated changelog to reflect the new version. - Introduced a new modal for saving exercises as training modules within the training planning interface. - Enhanced the TrainingPlanningPageRoot component to manage the new save module functionality, including state management for the modal. - Updated the TrainingPlanningUnitFormModal to include an option for saving exercises as a module, improving user experience in training planning.
This commit is contained in:
1 parent
7693139242
commit
a51f794945
5 files changed
+467
-6
No files matched your search
@@ -12,6 +12,7 @@ import TrainingPlanningModuleApplyModal from './TrainingPlanningModuleApplyModal
|
||||
import TrainingPlanningTrainerAssignModal from './TrainingPlanningTrainerAssignModal'
|
||||
import TrainingPlanningUnitFormModal from './TrainingPlanningUnitFormModal'
|
||||
import TrainingPublishToFrameworkModal from './TrainingPublishToFrameworkModal'
|
||||
import SaveExercisesAsModuleModal from './SaveExercisesAsModuleModal'
|
||||
/* Parallele Streams: Editor bleibt flache Abschnittsliste; `planLoc` pro Abschnitt steuert PUT `phases` vs. Legacy `sections`. */
|
||||
import {
|
||||
defaultSection,
|
||||
@@ -53,6 +54,10 @@ function TrainingPlanningPageRoot() {
|
||||
const [showModal, setShowModal] = useState(false)
|
||||
const [editingUnit, setEditingUnit] = useState(null)
|
||||
const [publishFrameworkOpen, setPublishFrameworkOpen] = useState(false)
|
||||
/** Einheit für „Rahmen-Session“-Dialog (Liste oder geöffnetes Bearbeiten) */
|
||||
const [publishFrameworkUnitId, setPublishFrameworkUnitId] = useState(null)
|
||||
const [saveModuleOpen, setSaveModuleOpen] = useState(false)
|
||||
const [saveModuleUnitId, setSaveModuleUnitId] = useState(null)
|
||||
/** Abschnitts-Editor bei Bearbeitung: Planung vs. Nachbereitung (Ist & Abweichungen) */
|
||||
const [sectionsEditMode, setSectionsEditMode] = useState('planning')
|
||||
const [draftPlanTemplateId, setDraftPlanTemplateId] = useState('')
|
||||
@@ -1853,6 +1858,28 @@ function TrainingPlanningPageRoot() {
|
||||
<button className="btn btn-secondary" onClick={() => handleEdit(unit)}>
|
||||
Bearbeiten
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
title="Gespeicherten Ablauf als Session eines Rahmenprogramms übernehmen"
|
||||
onClick={() => {
|
||||
setPublishFrameworkUnitId(unit.id)
|
||||
setPublishFrameworkOpen(true)
|
||||
}}
|
||||
>
|
||||
Rahmen-Session…
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
title="Gespeicherte Übungen aus dieser Einheit als Trainingsmodul speichern"
|
||||
onClick={() => {
|
||||
setSaveModuleUnitId(unit.id)
|
||||
setSaveModuleOpen(true)
|
||||
}}
|
||||
>
|
||||
Übungen → Modul…
|
||||
</button>
|
||||
{mayConfigureSessionAssignments(unit) ? (
|
||||
<button
|
||||
type="button"
|
||||
@@ -1959,9 +1986,29 @@ function TrainingPlanningPageRoot() {
|
||||
|
||||
<TrainingPublishToFrameworkModal
|
||||
open={publishFrameworkOpen}
|
||||
onClose={() => setPublishFrameworkOpen(false)}
|
||||
onSuccess={() => setShowModal(false)}
|
||||
unitId={editingUnit?.id}
|
||||
onClose={() => {
|
||||
setPublishFrameworkOpen(false)
|
||||
setPublishFrameworkUnitId(null)
|
||||
}}
|
||||
onSuccess={() => {
|
||||
setShowModal(false)
|
||||
setPublishFrameworkUnitId(null)
|
||||
}}
|
||||
unitId={publishFrameworkUnitId ?? editingUnit?.id}
|
||||
planningModalClubId={planningModalClubId}
|
||||
/>
|
||||
|
||||
<SaveExercisesAsModuleModal
|
||||
open={saveModuleOpen}
|
||||
onClose={() => {
|
||||
setSaveModuleOpen(false)
|
||||
setSaveModuleUnitId(null)
|
||||
}}
|
||||
onSuccess={() => {
|
||||
setShowModal(false)
|
||||
setSaveModuleUnitId(null)
|
||||
}}
|
||||
unitId={saveModuleUnitId ?? editingUnit?.id}
|
||||
planningModalClubId={planningModalClubId}
|
||||
/>
|
||||
|
||||
@@ -1985,7 +2032,18 @@ function TrainingPlanningPageRoot() {
|
||||
sectionsEditMode={sectionsEditMode}
|
||||
setSectionsEditMode={setSectionsEditMode}
|
||||
onSaveAsTemplate={handleSaveAsTemplate}
|
||||
onRequestPublishToFramework={() => setPublishFrameworkOpen(true)}
|
||||
onRequestPublishToFramework={() => {
|
||||
if (editingUnit?.id) {
|
||||
setPublishFrameworkUnitId(editingUnit.id)
|
||||
setPublishFrameworkOpen(true)
|
||||
}
|
||||
}}
|
||||
onRequestSaveAsModule={() => {
|
||||
if (editingUnit?.id) {
|
||||
setSaveModuleUnitId(editingUnit.id)
|
||||
setSaveModuleOpen(true)
|
||||
}
|
||||
}}
|
||||
onRequestTrainingModulePick={(ctx) => {
|
||||
void openModuleApplyModal(ctx)
|
||||
}}
|
||||
|
||||
Reference in new issue
Block a user