Cwiczenia: usuniecie martwego pola trudnosc z katalogu (trudnosc pozostaje tylko jako ocena cwiczacego per seria 1-5; migracja DROP kolumny Exercise.difficulty)
This commit is contained in:
@@ -141,7 +141,6 @@ export interface Exercise {
|
||||
description: string | null;
|
||||
howTo: string | null;
|
||||
commonMistakes: string | null;
|
||||
difficulty: number;
|
||||
source: string;
|
||||
/** Liczba odwołań w planach treningowych. */
|
||||
planExercisesCount: number;
|
||||
|
||||
@@ -119,7 +119,6 @@ interface FormState {
|
||||
name: string;
|
||||
primaryMuscle: string;
|
||||
secondaryMuscles: string[];
|
||||
difficulty: string;
|
||||
description: string;
|
||||
howTo: string;
|
||||
commonMistakes: string;
|
||||
@@ -132,7 +131,6 @@ const EMPTY: FormState = {
|
||||
name: '',
|
||||
primaryMuscle: '',
|
||||
secondaryMuscles: [],
|
||||
difficulty: '3',
|
||||
description: '',
|
||||
howTo: '',
|
||||
commonMistakes: '',
|
||||
@@ -218,7 +216,6 @@ export default function Exercises() {
|
||||
description: form.description || null,
|
||||
howTo: form.howTo || null,
|
||||
commonMistakes: form.commonMistakes || null,
|
||||
difficulty: form.difficulty ? parseInt(form.difficulty, 10) : undefined,
|
||||
equipmentIds: form.equipmentIds,
|
||||
...flags,
|
||||
};
|
||||
@@ -282,7 +279,6 @@ export default function Exercises() {
|
||||
name: ex.name,
|
||||
primaryMuscle: ex.primaryMuscle,
|
||||
secondaryMuscles: ex.secondaryMuscles,
|
||||
difficulty: String(ex.difficulty),
|
||||
description: ex.description ?? '',
|
||||
howTo: ex.howTo ?? '',
|
||||
commonMistakes: ex.commonMistakes ?? '',
|
||||
@@ -347,7 +343,6 @@ export default function Exercises() {
|
||||
{CARD_FLAG_CHIPS[k]}
|
||||
</Badge>
|
||||
))}
|
||||
<Badge color="gray">trudność {ex.difficulty}</Badge>
|
||||
{ex.planExercisesCount > 0 && (
|
||||
<Badge color="yellow">
|
||||
{ex.planExercisesCount === 1 ? '1 plan' : `${ex.planExercisesCount} planów`}
|
||||
@@ -418,31 +413,19 @@ export default function Exercises() {
|
||||
placeholder="np. Wyciskanie sztangi leżąc"
|
||||
/>
|
||||
</Field>
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<Field label="Główny mięsień">
|
||||
<Select
|
||||
value={form.primaryMuscle}
|
||||
onChange={(e) => setForm((f) => ({ ...f, primaryMuscle: e.target.value }))}
|
||||
>
|
||||
<option value="">— wybierz —</option>
|
||||
{primaryOptions.map((o) => (
|
||||
<option key={o.value} value={o.value}>
|
||||
{o.label}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
</Field>
|
||||
<Field label="Trudność (1–10)">
|
||||
<Input
|
||||
type="number"
|
||||
min="1"
|
||||
max="10"
|
||||
value={form.difficulty}
|
||||
onChange={(e) => setForm((f) => ({ ...f, difficulty: e.target.value }))}
|
||||
placeholder="np. 3"
|
||||
/>
|
||||
</Field>
|
||||
</div>
|
||||
<Field label="Główny mięsień">
|
||||
<Select
|
||||
value={form.primaryMuscle}
|
||||
onChange={(e) => setForm((f) => ({ ...f, primaryMuscle: e.target.value }))}
|
||||
>
|
||||
<option value="">— wybierz —</option>
|
||||
{primaryOptions.map((o) => (
|
||||
<option key={o.value} value={o.value}>
|
||||
{o.label}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
</Field>
|
||||
<Field label="Mięśnie pomocnicze">
|
||||
{secondaryOptions.length === 0 ? (
|
||||
<p className="text-dim text-[0.875rem]">
|
||||
|
||||
Reference in New Issue
Block a user