feat: add quick create draft functionality in ExercisePickerModal
Deploy Development / deploy (push) Successful in 37s
Test Suite / pytest-backend (push) Successful in 7s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 22s
Deploy Development / deploy (push) Successful in 37s
Test Suite / pytest-backend (push) Successful in 7s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 22s
- Introduced a quick create draft feature allowing users to create private exercise drafts directly from the ExercisePickerModal. - Added state management for quick create inputs including title and summary, with validation for minimum title length. - Updated the Dashboard to display a preview of private exercise drafts, enhancing user visibility of pending exercises. - Enabled quick create functionality in TrainingFrameworkProgramEditPage and TrainingPlanningPage for streamlined exercise management.
This commit is contained in:
1 parent
ff8fd78a31
commit
c6a7d668c5
4 files changed
+156
-2
No files matched your search
@@ -115,10 +115,15 @@ function Dashboard() {
|
||||
}),
|
||||
])
|
||||
if (!cancelled) {
|
||||
const drafts = Array.isArray(draftList) ? draftList : []
|
||||
setPhase0Stats({
|
||||
year,
|
||||
draftCount: Array.isArray(draftList) ? draftList.length : 0,
|
||||
draftCapped: Array.isArray(draftList) && draftList.length >= 100,
|
||||
draftCount: drafts.length,
|
||||
draftCapped: drafts.length >= 100,
|
||||
draftPreview: drafts.slice(0, 8).map((ex) => ({
|
||||
id: ex.id,
|
||||
title: ex.title || `Übung #${ex.id}`,
|
||||
})),
|
||||
mineCount: Array.isArray(mineList) ? mineList.length : 0,
|
||||
mineCapped: Array.isArray(mineList) && mineList.length >= 100,
|
||||
ytdCompletedCount: Array.isArray(ytdCompleted) ? ytdCompleted.length : 0,
|
||||
@@ -233,6 +238,29 @@ function Dashboard() {
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
{!phase0Err && phase0Stats?.draftPreview?.length ? (
|
||||
<div className="card dashboard-draft-preview" style={{ marginTop: '1rem' }}>
|
||||
<h3 className="dashboard-preview-card__title" style={{ marginTop: 0 }}>
|
||||
Entwürfe fertigstellen
|
||||
</h3>
|
||||
<p className="muted" style={{ marginTop: '0.35rem', marginBottom: '0.85rem', fontSize: '0.92rem' }}>
|
||||
Private Übungs-Entwürfe (z. B. aus der Planung) — Ziel, Durchführung und Details in der Bearbeitung
|
||||
ergänzen.
|
||||
</p>
|
||||
<ul className="dashboard-preview-card__list">
|
||||
{phase0Stats.draftPreview.map((ex) => (
|
||||
<li key={ex.id}>
|
||||
<Link to={`/exercises/${ex.id}/edit`} className="dashboard-preview-card__link">
|
||||
{ex.title}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<p style={{ margin: '0.75rem 0 0', fontSize: '0.86rem' }}>
|
||||
<Link to={draftsHref}>Alle Entwürfe in der Übersicht</Link>
|
||||
</p>
|
||||
</div>
|
||||
) : null}
|
||||
</section>
|
||||
|
||||
<section className="dashboard-section" aria-labelledby="dash-trainings-title">
|
||||
|
||||
@@ -1086,6 +1086,7 @@ export default function TrainingFrameworkProgramEditPage() {
|
||||
<ExercisePickerModal
|
||||
open={sectionPickerCtx != null}
|
||||
multiSelect
|
||||
enableQuickCreateDraft
|
||||
onClose={() => setSectionPickerCtx(null)}
|
||||
onSelectExercises={async (picked) => {
|
||||
if (!sectionPickerCtx || !picked?.length) return
|
||||
|
||||
@@ -2421,6 +2421,7 @@ function TrainingPlanningPage() {
|
||||
<ExercisePickerModal
|
||||
open={exercisePickerOpen}
|
||||
multiSelect
|
||||
enableQuickCreateDraft
|
||||
onClose={() => {
|
||||
setExercisePickerOpen(false)
|
||||
setExercisePickerTarget(null)
|
||||
|
||||
Reference in new issue
Block a user