@wger-project/react-components 25.10.24 → 25.11.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunks/{browser-ponyfill-DL_vVusK.js → browser-ponyfill-CyEkMYuR.js} +3 -3
- package/build/chunks/{browser-ponyfill-DL_vVusK.js.map → browser-ponyfill-CyEkMYuR.js.map} +1 -1
- package/build/locales/fil/translation.json +3 -0
- package/build/locales/sk/translation.json +26 -1
- package/build/main.js +137 -235
- package/build/main.js.map +1 -1
- package/package.json +14 -14
- package/src/components/BodyWeight/Form/WeightForm.tsx +3 -4
- package/src/components/BodyWeight/WeightChart/index.tsx +26 -29
- package/src/components/Exercises/Add/Step1Basics.test.tsx +4 -1
- package/src/components/Exercises/Detail/ExerciseDetailEdit.tsx +43 -27
- package/src/components/Exercises/Detail/ExerciseDetailView.tsx +57 -17
- package/src/components/Exercises/Detail/Head/ExerciseDeleteDialog.tsx +3 -4
- package/src/components/Exercises/Detail/OverviewCard.test.tsx +7 -11
- package/src/components/Exercises/ExerciseOverview.tsx +8 -8
- package/src/components/Exercises/Filter/NameAutcompleter.tsx +41 -39
- package/src/components/Exercises/Filter/NameAutocompleter.test.tsx +2 -1
- package/src/components/Exercises/Overview/ExerciseGrid.tsx +1 -2
- package/src/components/Exercises/forms/ExerciseAliases.tsx +78 -21
- package/src/components/Exercises/forms/yupValidators.ts +7 -4
- package/src/components/Exercises/models/exercise.ts +55 -43
- package/src/components/Measurements/Screens/MeasurementCategoryDetail.test.tsx +4 -2
- package/src/components/Measurements/widgets/MeasurementChart.tsx +27 -30
- package/src/components/Nutrition/components/BmiCalculator.tsx +40 -42
- package/src/components/Nutrition/widgets/charts/MacrosPieChart.tsx +17 -19
- package/src/components/Nutrition/widgets/charts/NutritionDiaryChart.tsx +39 -38
- package/src/components/Nutrition/widgets/charts/NutritionalValuesDashboardChart.tsx +27 -29
- package/src/components/Nutrition/widgets/charts/NutritionalValuesPlannedLoggedChart.tsx +20 -19
- package/src/components/WorkoutRoutines/Detail/WorkoutStats.tsx +17 -19
- package/src/components/WorkoutRoutines/widgets/DayDetails.tsx +3 -3
- package/src/components/WorkoutRoutines/widgets/LogWidgets.tsx +35 -38
- package/src/components/WorkoutRoutines/widgets/SlotDetails.tsx +4 -4
- package/src/components/WorkoutRoutines/widgets/forms/SessionLogsForm.tsx +4 -4
- package/src/services/exerciseTranslation.ts +24 -9
- package/src/services/measurements.ts +15 -2
- package/src/services/responseType.ts +3 -29
- package/src/tests/exerciseTestdata.ts +61 -55
- package/src/tests/exercises/searchResponse.ts +49 -22
- package/src/tests/responseApi.ts +25 -14
|
@@ -46,16 +46,16 @@ export const testEquipment = [
|
|
|
46
46
|
testEquipmentRocks,
|
|
47
47
|
];
|
|
48
48
|
|
|
49
|
-
export const testExerciseSquats = new Exercise(
|
|
50
|
-
345,
|
|
51
|
-
"c788d643-150a-4ac7-97ef-84643c6419bf",
|
|
52
|
-
testCategoryLegs,
|
|
53
|
-
[testEquipmentBarbell, testEquipmentRocks],
|
|
54
|
-
[testMuscleBiggus, testMuscleRectusAbdominis],
|
|
55
|
-
[],
|
|
56
|
-
[],
|
|
57
|
-
null,
|
|
58
|
-
[
|
|
49
|
+
export const testExerciseSquats = new Exercise({
|
|
50
|
+
id: 345,
|
|
51
|
+
uuid: "c788d643-150a-4ac7-97ef-84643c6419bf",
|
|
52
|
+
category: testCategoryLegs,
|
|
53
|
+
equipment: [testEquipmentBarbell, testEquipmentRocks],
|
|
54
|
+
muscles: [testMuscleBiggus, testMuscleRectusAbdominis],
|
|
55
|
+
musclesSecondary: [],
|
|
56
|
+
images: [],
|
|
57
|
+
variationId: null,
|
|
58
|
+
translations: [
|
|
59
59
|
new Translation(111,
|
|
60
60
|
'583281c7-2362-48e7-95d5-8fd6c455e0fb',
|
|
61
61
|
'Squats',
|
|
@@ -74,18 +74,18 @@ export const testExerciseSquats = new Exercise(
|
|
|
74
74
|
]
|
|
75
75
|
)
|
|
76
76
|
]
|
|
77
|
-
);
|
|
77
|
+
});
|
|
78
78
|
|
|
79
|
-
export const testExerciseBenchPress = new Exercise(
|
|
80
|
-
2,
|
|
81
|
-
"abcdef-150a-4ac7-97ef-84643c6419bf",
|
|
82
|
-
testCategoryLegs,
|
|
83
|
-
[testEquipmentBarbell, testEquipmentRocks],
|
|
84
|
-
[testMuscleDacttilaris, testMuscleDeltoid],
|
|
85
|
-
[],
|
|
86
|
-
[],
|
|
87
|
-
1,
|
|
88
|
-
[
|
|
79
|
+
export const testExerciseBenchPress = new Exercise({
|
|
80
|
+
id: 2,
|
|
81
|
+
uuid: "abcdef-150a-4ac7-97ef-84643c6419bf",
|
|
82
|
+
category: testCategoryLegs,
|
|
83
|
+
equipment: [testEquipmentBarbell, testEquipmentRocks],
|
|
84
|
+
muscles: [testMuscleDacttilaris, testMuscleDeltoid],
|
|
85
|
+
musclesSecondary: [],
|
|
86
|
+
images: [],
|
|
87
|
+
variationId: 1,
|
|
88
|
+
translations: [
|
|
89
89
|
new Translation(111,
|
|
90
90
|
'583281c7-2362-48e7-95d5-8fd6c455e0fb',
|
|
91
91
|
'Benchpress',
|
|
@@ -93,17 +93,19 @@ export const testExerciseBenchPress = new Exercise(
|
|
|
93
93
|
2
|
|
94
94
|
),
|
|
95
95
|
]
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
[],
|
|
104
|
-
[],
|
|
105
|
-
|
|
106
|
-
[
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export const testExerciseCurls = new Exercise({
|
|
99
|
+
id: 3,
|
|
100
|
+
uuid: "abcdef-150a-4ac7-97ef-84643c6419bf",
|
|
101
|
+
lastUpdateGlobal: new Date(),
|
|
102
|
+
category: testCategoryArms,
|
|
103
|
+
equipment: [testEquipmentDumbbell],
|
|
104
|
+
muscles: [testMuscleBiggus, testMuscleDacttilaris],
|
|
105
|
+
musclesSecondary: [],
|
|
106
|
+
images: [],
|
|
107
|
+
variationId: 1,
|
|
108
|
+
translations: [
|
|
107
109
|
new Translation(111,
|
|
108
110
|
'583281c7-2362-48e7-95d5-8fd6c455e0fb',
|
|
109
111
|
'Curls',
|
|
@@ -111,17 +113,19 @@ export const testExerciseCurls = new Exercise(
|
|
|
111
113
|
2
|
|
112
114
|
),
|
|
113
115
|
]
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
[],
|
|
122
|
-
[],
|
|
123
|
-
|
|
124
|
-
[
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export const testExerciseCrunches = new Exercise({
|
|
119
|
+
id: 4,
|
|
120
|
+
uuid: "abcdef-150a-4ac7-97ef-84643c6419bf",
|
|
121
|
+
lastUpdateGlobal: new Date(),
|
|
122
|
+
category: testCategoryChest,
|
|
123
|
+
equipment: [testEquipmentRocks],
|
|
124
|
+
muscles: [testMuscleDeltoid],
|
|
125
|
+
musclesSecondary: [],
|
|
126
|
+
images: [],
|
|
127
|
+
variationId: null,
|
|
128
|
+
translations: [
|
|
125
129
|
new Translation(111,
|
|
126
130
|
'583281c7-2362-48e7-95d5-8fd6c455e0fb',
|
|
127
131
|
'Crunches',
|
|
@@ -129,17 +133,19 @@ export const testExerciseCrunches = new Exercise(
|
|
|
129
133
|
2
|
|
130
134
|
),
|
|
131
135
|
]
|
|
132
|
-
);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
[],
|
|
140
|
-
[],
|
|
141
|
-
|
|
142
|
-
[
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export const testExerciseSkullCrusher = new Exercise({
|
|
139
|
+
id: 5,
|
|
140
|
+
uuid: "abcdef-150a-4ac7-97ef-84643c6419bf",
|
|
141
|
+
lastUpdateGlobal: new Date(),
|
|
142
|
+
category: testCategoryArms,
|
|
143
|
+
equipment: [testEquipmentBarbell],
|
|
144
|
+
muscles: [testMuscleRectusAbdominis],
|
|
145
|
+
musclesSecondary: [],
|
|
146
|
+
images: [],
|
|
147
|
+
variationId: 2,
|
|
148
|
+
translations: [
|
|
143
149
|
new Translation(111,
|
|
144
150
|
'583281c7-2362-48e7-95d5-8fd6c455e0fb',
|
|
145
151
|
'Skull crusher',
|
|
@@ -147,7 +153,7 @@ export const testExerciseSkullCrusher = new Exercise(
|
|
|
147
153
|
2
|
|
148
154
|
),
|
|
149
155
|
]
|
|
150
|
-
);
|
|
156
|
+
});
|
|
151
157
|
|
|
152
158
|
export const testExercises = [
|
|
153
159
|
testExerciseSquats,
|
|
@@ -1,23 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { Category } from "components/Exercises/models/category";
|
|
2
|
+
import { Exercise } from "components/Exercises/models/exercise";
|
|
3
|
+
import { Translation } from "components/Exercises/models/translation";
|
|
4
|
+
|
|
5
|
+
export const searchResponse: Exercise[] = [
|
|
6
|
+
new Exercise({
|
|
7
|
+
id: 998,
|
|
8
|
+
uuid: "uuid-998",
|
|
9
|
+
lastUpdateGlobal: new Date(),
|
|
10
|
+
category: new Category(8, "Bauch"),
|
|
11
|
+
equipment: [],
|
|
12
|
+
muscles: [],
|
|
13
|
+
musclesSecondary: [],
|
|
14
|
+
images: [],
|
|
15
|
+
variationId: null,
|
|
16
|
+
translations: [
|
|
17
|
+
new Translation(
|
|
18
|
+
1149, // id
|
|
19
|
+
"uuid-1149", // uuid
|
|
20
|
+
"Crunches an Negativbank", // name
|
|
21
|
+
"", // description
|
|
22
|
+
1 // language (German)
|
|
23
|
+
)
|
|
24
|
+
],
|
|
25
|
+
videos: [],
|
|
26
|
+
authors: []
|
|
27
|
+
}),
|
|
28
|
+
new Exercise({
|
|
29
|
+
id: 979,
|
|
30
|
+
uuid: "uuid-979",
|
|
31
|
+
lastUpdateGlobal: new Date(),
|
|
32
|
+
category: new Category(11, "Brust"),
|
|
33
|
+
equipment: [],
|
|
34
|
+
muscles: [],
|
|
35
|
+
musclesSecondary: [],
|
|
36
|
+
images: [],
|
|
37
|
+
variationId: null,
|
|
38
|
+
translations: [
|
|
39
|
+
new Translation(
|
|
40
|
+
1213, // id
|
|
41
|
+
"uuid-1213", // uuid
|
|
42
|
+
"Crunches am Seil", // name
|
|
43
|
+
"", // description
|
|
44
|
+
1 // language (German)
|
|
45
|
+
)
|
|
46
|
+
],
|
|
47
|
+
videos: [],
|
|
48
|
+
authors: []
|
|
49
|
+
})
|
|
23
50
|
];
|
package/src/tests/responseApi.ts
CHANGED
|
@@ -41,20 +41,21 @@ const image = new ExerciseImage(
|
|
|
41
41
|
true
|
|
42
42
|
);
|
|
43
43
|
|
|
44
|
-
export const testApiExercise1 = new Exercise(
|
|
45
|
-
345,
|
|
46
|
-
"c788d643-150a-4ac7-97ef-84643c6419bf",
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
export const testApiExercise1 = new Exercise({
|
|
45
|
+
id: 345,
|
|
46
|
+
uuid: "c788d643-150a-4ac7-97ef-84643c6419bf",
|
|
47
|
+
lastUpdateGlobal: new Date("2025-11-22T19:32:02.590941+01:00"),
|
|
48
|
+
category: category,
|
|
49
|
+
equipment: [equipment1, equipment2],
|
|
50
|
+
muscles: [muscle1],
|
|
51
|
+
musclesSecondary: [muscle2],
|
|
52
|
+
images: [image],
|
|
53
|
+
variationId: 228,
|
|
54
|
+
translations: [
|
|
54
55
|
testExerciseTranslation1,
|
|
55
56
|
testExerciseTranslation2
|
|
56
57
|
],
|
|
57
|
-
[
|
|
58
|
+
videos: [
|
|
58
59
|
new ExerciseVideo(
|
|
59
60
|
1,
|
|
60
61
|
"b1c934fa-c4f8-4d84-8cb4-7802be0d284c",
|
|
@@ -62,12 +63,13 @@ export const testApiExercise1 = new Exercise(
|
|
|
62
63
|
false
|
|
63
64
|
)
|
|
64
65
|
],
|
|
65
|
-
[
|
|
66
|
+
authors: [
|
|
66
67
|
"wger.de",
|
|
67
68
|
"author 1",
|
|
68
|
-
"somebody else"
|
|
69
|
+
"somebody else",
|
|
70
|
+
"Mr. T"
|
|
69
71
|
]
|
|
70
|
-
);
|
|
72
|
+
});
|
|
71
73
|
|
|
72
74
|
|
|
73
75
|
export const responseApiExerciseInfo = {
|
|
@@ -77,6 +79,9 @@ export const responseApiExerciseInfo = {
|
|
|
77
79
|
"results": [{
|
|
78
80
|
"id": 345,
|
|
79
81
|
"uuid": "c788d643-150a-4ac7-97ef-84643c6419bf",
|
|
82
|
+
"created": "2023-08-06T10:17:17.422900+02:00",
|
|
83
|
+
"last_update": "2025-11-22T14:17:20.119332+01:00",
|
|
84
|
+
"last_update_global": "2025-11-22T19:32:02.590941+01:00",
|
|
80
85
|
"category": {
|
|
81
86
|
"id": 10,
|
|
82
87
|
"name": "Abs"
|
|
@@ -192,6 +197,12 @@ export const responseApiExerciseInfo = {
|
|
|
192
197
|
"wger.de",
|
|
193
198
|
"author 1",
|
|
194
199
|
"somebody else"
|
|
200
|
+
],
|
|
201
|
+
"total_authors_history": [
|
|
202
|
+
"wger.de",
|
|
203
|
+
"author 1",
|
|
204
|
+
"somebody else",
|
|
205
|
+
"Mr. T"
|
|
195
206
|
]
|
|
196
207
|
}]
|
|
197
208
|
};
|