@wger-project/react-components 25.11.17 → 25.12.5
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/assets/index.css +1 -1
- package/build/locales/de/translation.json +13 -4
- package/build/locales/en/translation.json +9 -0
- package/build/locales/hi/translation.json +5 -0
- package/build/locales/nl/translation.json +242 -238
- package/build/locales/pt_BR/translation.json +340 -255
- package/build/main.js +154 -150
- package/build/main.js.map +1 -1
- package/package.json +6 -3
- package/src/components/Dashboard/ConfigurableDashboard.tsx +228 -0
- package/src/components/Dashboard/DashboardCard.tsx +121 -0
- package/src/components/Dashboard/EmptyCard.tsx +3 -3
- package/src/components/Dashboard/GoalCard.tsx +71 -0
- package/src/components/Dashboard/NutritionCard.tsx +88 -96
- package/src/components/Dashboard/RoutineCard.tsx +54 -69
- package/src/components/Dashboard/WeightCard.tsx +36 -42
- 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 +1 -1
- package/src/components/Exercises/Detail/OverviewCard.test.tsx +7 -11
- package/src/components/Exercises/ExerciseOverview.tsx +6 -6
- 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/WorkoutRoutines/Detail/WorkoutStats.tsx +1 -1
- package/src/components/WorkoutRoutines/widgets/forms/DayTypeSelect.tsx +1 -2
- package/src/components/WorkoutRoutines/widgets/forms/SlotForm.tsx +0 -4
- package/src/index.tsx +0 -46
- package/src/routes.tsx +82 -79
- package/src/services/exerciseTranslation.ts +5 -6
- package/src/services/measurements.ts +15 -2
- package/src/services/video.test.ts +4 -4
- package/src/tests/exerciseTestdata.ts +61 -55
- package/src/tests/exercises/searchResponse.ts +31 -29
- package/src/tests/responseApi.ts +25 -14
- package/src/components/Dashboard/Dashboard.tsx +0 -22
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import React, { useState } from "react";
|
|
31
31
|
import { useTranslation } from "react-i18next";
|
|
32
32
|
import { useParams } from "react-router-dom";
|
|
33
|
-
import { CartesianGrid, Legend, Line, LineChart,
|
|
33
|
+
import { CartesianGrid, Legend, Line, LineChart, Tooltip, XAxis, YAxis } from 'recharts';
|
|
34
34
|
import { getLanguageByShortName } from "services";
|
|
35
35
|
import { generateChartColors } from "utils/colors";
|
|
36
36
|
import { makeLink, WgerLink } from "utils/url";
|
|
@@ -10,8 +10,7 @@ interface DayTypeSelectProps {
|
|
|
10
10
|
|
|
11
11
|
export const DayTypeSelect = (props: DayTypeSelectProps) => {
|
|
12
12
|
const { t } = useTranslation();
|
|
13
|
-
const [field
|
|
14
|
-
|
|
13
|
+
const [field] = useField(props.fieldName);
|
|
15
14
|
const options = [
|
|
16
15
|
{
|
|
17
16
|
value: 'custom',
|
|
@@ -10,10 +10,6 @@ export const SlotForm = (props: { slot: Slot, routineId: number }) => {
|
|
|
10
10
|
const editSlotQuery = useEditSlotQuery(props.routineId);
|
|
11
11
|
const [slotComment, setSlotComment] = useState<string>(props.slot.comment);
|
|
12
12
|
|
|
13
|
-
const handleChange = (value: string) => {
|
|
14
|
-
setSlotComment(value);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
13
|
const handleBlur = () => {
|
|
18
14
|
editSlotQuery.mutate(Slot.clone(props.slot, { comment: slotComment }));
|
|
19
15
|
};
|
package/src/index.tsx
CHANGED
|
@@ -4,9 +4,6 @@ import { ThemeProvider } from '@mui/material/styles';
|
|
|
4
4
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
5
5
|
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|
6
6
|
import { LoadingWidget } from "components/Core/LoadingWidget/LoadingWidget";
|
|
7
|
-
import { NutritionCard } from "components/Dashboard/NutritionCard";
|
|
8
|
-
import { RoutineCard } from "components/Dashboard/RoutineCard";
|
|
9
|
-
import { WeightCard } from "components/Dashboard/WeightCard";
|
|
10
7
|
import { IngredientSearch } from "components/Nutrition/components/IngredientSearch";
|
|
11
8
|
import React, { Suspense } from 'react';
|
|
12
9
|
import { createRoot } from "react-dom/client";
|
|
@@ -123,49 +120,6 @@ renderComponentShadowDom('react-page');
|
|
|
123
120
|
/*
|
|
124
121
|
* Components used in the wger django app, don't change the IDs here
|
|
125
122
|
*/
|
|
126
|
-
const weightDashboard = document.getElementById("react-weight-dashboard");
|
|
127
|
-
if (weightDashboard) {
|
|
128
|
-
const root = createRoot(weightDashboard);
|
|
129
|
-
root.render(
|
|
130
|
-
<Suspense fallback={<LoadingWidget />}>
|
|
131
|
-
<ThemeProvider theme={theme}>
|
|
132
|
-
<QueryClientProvider client={queryClient}>
|
|
133
|
-
<WeightCard />
|
|
134
|
-
</QueryClientProvider>
|
|
135
|
-
</ThemeProvider>
|
|
136
|
-
</Suspense>
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const nutritionDashboard = document.getElementById('react-nutrition-dashboard');
|
|
141
|
-
if (nutritionDashboard) {
|
|
142
|
-
const root = createRoot(nutritionDashboard);
|
|
143
|
-
root.render(
|
|
144
|
-
<Suspense fallback={<LoadingWidget />}>
|
|
145
|
-
<ThemeProvider theme={theme}>
|
|
146
|
-
<QueryClientProvider client={queryClient}>
|
|
147
|
-
<NutritionCard />
|
|
148
|
-
</QueryClientProvider>
|
|
149
|
-
</ThemeProvider>
|
|
150
|
-
</Suspense>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const routineDashboard = document.getElementById('react-routine-dashboard');
|
|
155
|
-
if (routineDashboard) {
|
|
156
|
-
const root = createRoot(routineDashboard);
|
|
157
|
-
root.render(
|
|
158
|
-
<Suspense fallback={<LoadingWidget />}>
|
|
159
|
-
<ThemeProvider theme={theme}>
|
|
160
|
-
<QueryClientProvider client={queryClient}>
|
|
161
|
-
<RoutineCard />
|
|
162
|
-
</QueryClientProvider>
|
|
163
|
-
</ThemeProvider>
|
|
164
|
-
</Suspense>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
123
|
const ingredientSearchBox = document.getElementById("react-ingredient-search");
|
|
170
124
|
if (ingredientSearchBox) {
|
|
171
125
|
const root = createRoot(ingredientSearchBox);
|
package/src/routes.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfigurableDashboard } from "components/Dashboard/ConfigurableDashboard";
|
|
2
2
|
import { ExerciseOverview } from "components/Exercises/ExerciseOverview";
|
|
3
3
|
import { MeasurementCategoryDetail } from "components/Measurements/Screens/MeasurementCategoryDetail";
|
|
4
4
|
import { MeasurementCategoryOverview } from "components/Measurements/Screens/MeasurementCategoryOverview";
|
|
@@ -42,96 +42,99 @@ import { Route, Routes } from "react-router-dom";
|
|
|
42
42
|
* See also src/utils/url.ts
|
|
43
43
|
*/
|
|
44
44
|
export const WgerRoutes = () => {
|
|
45
|
-
return
|
|
46
|
-
<
|
|
45
|
+
return (
|
|
46
|
+
<Routes>
|
|
47
|
+
<Route path="/:lang">
|
|
48
|
+
<Route path="routine">
|
|
49
|
+
<Route index element={<RoutineOverview />} />
|
|
50
|
+
<Route path="overview" element={<RoutineOverview />} />
|
|
51
|
+
<Route path="calendar" element={<Calendar />} />
|
|
52
|
+
<Route path="add" element={<RoutineAdd />} />
|
|
47
53
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
<Route path=":routineId">
|
|
55
|
+
<Route path="day/:dayId">
|
|
56
|
+
<Route path="add-logs" element={<SessionAdd />} />
|
|
57
|
+
</Route>
|
|
58
|
+
<Route path="edit">
|
|
59
|
+
<Route index element={<RoutineEdit />} />
|
|
60
|
+
<Route path="progression/:slotId" element={<SlotProgressionEdit />} />
|
|
61
|
+
</Route>
|
|
53
62
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<Route path="
|
|
57
|
-
|
|
58
|
-
<Route path="edit">
|
|
59
|
-
<Route index element={<RoutineEdit />} />
|
|
60
|
-
<Route path="progression/:slotId" element={<SlotProgressionEdit />} />
|
|
63
|
+
<Route path="view" element={<RoutineDetail />} />
|
|
64
|
+
<Route path="table" element={<RoutineDetailsTable />} />
|
|
65
|
+
<Route path="logs" element={<WorkoutLogs />} />
|
|
66
|
+
<Route path="statistics" element={<WorkoutStats />} />
|
|
61
67
|
</Route>
|
|
62
68
|
|
|
63
|
-
<Route path="
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<Route path="view" element={<TemplateDetail />} />
|
|
69
|
+
<Route path="templates">
|
|
70
|
+
<Route path=":routineId">
|
|
71
|
+
<Route path="view" element={<TemplateDetail />} />
|
|
72
|
+
</Route>
|
|
73
|
+
<Route path="overview">
|
|
74
|
+
<Route path="private" element={<PrivateTemplateOverview />} />
|
|
75
|
+
<Route path="public" element={<PublicTemplateOverview />} />
|
|
76
|
+
</Route>
|
|
72
77
|
</Route>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
</Route>
|
|
79
|
+
<Route path="measurement">
|
|
80
|
+
<Route index element={<MeasurementCategoryOverview />} />
|
|
81
|
+
<Route path="overview" element={<MeasurementCategoryOverview />} />
|
|
82
|
+
<Route path="category/:categoryId" element={<MeasurementCategoryDetail />}></Route>
|
|
83
|
+
</Route>
|
|
84
|
+
<Route path="exercise">
|
|
85
|
+
<Route index element={<ExerciseOverview />} />
|
|
86
|
+
<Route path="overview" element={<ExerciseOverview />} />
|
|
87
|
+
<Route path=":exerciseId" element={<ExerciseDetailPage />}>
|
|
88
|
+
<Route path="view" element={<ExerciseDetailPage />}>
|
|
89
|
+
<Route path=":slug" element={<ExerciseDetailPage />} />
|
|
90
|
+
</Route>
|
|
76
91
|
</Route>
|
|
92
|
+
<Route path="contribute" element={<AddExercise />} />
|
|
77
93
|
</Route>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<Route index element={<MeasurementCategoryOverview />} />
|
|
82
|
-
<Route path="overview" element={<MeasurementCategoryOverview />} />
|
|
83
|
-
<Route path="category/:categoryId" element={<MeasurementCategoryDetail />}>
|
|
94
|
+
<Route path="weight">
|
|
95
|
+
<Route path="overview" element={<WeightOverview />} />
|
|
96
|
+
<Route path="add" element={<AddWeight />} />
|
|
84
97
|
</Route>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
98
|
+
<Route path="nutrition">
|
|
99
|
+
<Route path="overview" element={<PlansOverview />} />
|
|
100
|
+
<Route path=":planId">
|
|
101
|
+
<Route path="view" element={<PlanDetail />} />
|
|
102
|
+
<Route path=":date" element={<NutritionDiaryOverview />} />
|
|
103
|
+
<Route path="diary" element={<NutritionDiaryOverview />} />
|
|
104
|
+
</Route>
|
|
105
|
+
<Route path="calculator">
|
|
106
|
+
<Route path="bmi" element={<BmiCalculator />} />
|
|
107
|
+
<Route path="calories" element={<CaloriesCalculator />} />
|
|
108
|
+
</Route>
|
|
109
|
+
<Route path="ingredient">
|
|
110
|
+
<Route path="overview" element={<Ingredients />} />
|
|
92
111
|
</Route>
|
|
93
112
|
</Route>
|
|
94
|
-
<Route path="
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<Route path="add" element={<AddWeight />} />
|
|
99
|
-
</Route>
|
|
100
|
-
<Route path="nutrition">
|
|
101
|
-
<Route path="overview" element={<PlansOverview />} />
|
|
102
|
-
<Route path=":planId">
|
|
103
|
-
<Route path="view" element={<PlanDetail />} />
|
|
104
|
-
<Route path=":date" element={<NutritionDiaryOverview />} />
|
|
105
|
-
<Route path="diary" element={<NutritionDiaryOverview />} />
|
|
113
|
+
<Route path="software">
|
|
114
|
+
<Route path="about-us" element={<About />} />
|
|
115
|
+
<Route path="api" element={<ApiPage />} />
|
|
116
|
+
<Route path="equipment" element={<Equipments />} />
|
|
106
117
|
</Route>
|
|
107
|
-
<Route path="
|
|
108
|
-
|
|
109
|
-
<Route path="
|
|
118
|
+
<Route path="login" element={<Login />} />
|
|
119
|
+
<Route path="user">
|
|
120
|
+
<Route path="preferences" element={<Preferences />} />
|
|
110
121
|
</Route>
|
|
111
|
-
<Route path="
|
|
112
|
-
<Route
|
|
122
|
+
<Route path="dashboard">
|
|
123
|
+
<Route index element={<ConfigurableDashboard />} />
|
|
124
|
+
<Route path="" element={<ConfigurableDashboard />} />
|
|
113
125
|
</Route>
|
|
114
126
|
</Route>
|
|
115
|
-
<Route path="
|
|
116
|
-
<Route path="about-us" element={<About />} />
|
|
117
|
-
<Route path="api" element={<ApiPage />} />
|
|
118
|
-
<Route path="equipment" element={<Equipments />} />
|
|
119
|
-
</Route>
|
|
120
|
-
<Route path="login" element={<Login />} />
|
|
121
|
-
<Route path="user">
|
|
122
|
-
<Route path="preferences" element={<Preferences />} />
|
|
123
|
-
</Route>
|
|
124
|
-
</Route>
|
|
125
|
-
<Route path="/" element={<Dashboard />} />
|
|
127
|
+
<Route path="/" element={<ConfigurableDashboard />} />
|
|
126
128
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
{/* This route matches when no other route match, so a 404 */}
|
|
130
|
+
<Route
|
|
131
|
+
path="*"
|
|
132
|
+
element={
|
|
133
|
+
<main style={{ padding: "1rem" }}>
|
|
134
|
+
<p>404, Page NOT FOUND</p>
|
|
135
|
+
</main>
|
|
136
|
+
}
|
|
137
|
+
/>
|
|
138
|
+
</Routes>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
@@ -14,7 +14,6 @@ export const EXERCISE_TRANSLATION_PATH = 'exercise-translation';
|
|
|
14
14
|
*/
|
|
15
15
|
export const getExerciseTranslations = async (id: number): Promise<Translation[]> => {
|
|
16
16
|
const url = makeUrl(EXERCISE_PATH, { query: { exercise: id } });
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
17
|
const { data } = await axios.get<ResponseType<Translation>>(url, {
|
|
19
18
|
headers: makeHeader(),
|
|
20
19
|
});
|
|
@@ -26,7 +25,7 @@ export const getExerciseTranslations = async (id: number): Promise<Translation[]
|
|
|
26
25
|
/*
|
|
27
26
|
* Search for exercises by name using the exerciseinfo endpoint
|
|
28
27
|
*/
|
|
29
|
-
export const searchExerciseTranslations = async (name: string,languageCode: string = ENGLISH_LANGUAGE_CODE,searchEnglish: boolean = true): Promise<Exercise[]> => {
|
|
28
|
+
export const searchExerciseTranslations = async (name: string, languageCode: string = ENGLISH_LANGUAGE_CODE, searchEnglish: boolean = true): Promise<Exercise[]> => {
|
|
30
29
|
const languages = [languageCode];
|
|
31
30
|
if (languageCode !== LANGUAGE_SHORT_ENGLISH && searchEnglish) {
|
|
32
31
|
languages.push(LANGUAGE_SHORT_ENGLISH);
|
|
@@ -34,19 +33,19 @@ export const searchExerciseTranslations = async (name: string,languageCode: stri
|
|
|
34
33
|
|
|
35
34
|
const url = makeUrl('exerciseinfo', {
|
|
36
35
|
query: {
|
|
37
|
-
name__search: name,
|
|
38
|
-
language__code: languages.join(','),
|
|
36
|
+
"name__search": name,
|
|
37
|
+
"language__code": languages.join(','),
|
|
39
38
|
limit: 50,
|
|
40
39
|
}
|
|
41
40
|
});
|
|
42
41
|
|
|
43
42
|
try {
|
|
44
43
|
const { data } = await axios.get<ResponseType<Exercise>>(url);
|
|
45
|
-
|
|
44
|
+
|
|
46
45
|
if (!data || !data.results || !Array.isArray(data.results)) {
|
|
47
46
|
return [];
|
|
48
47
|
}
|
|
49
|
-
|
|
48
|
+
|
|
50
49
|
const adapter = new ExerciseAdapter();
|
|
51
50
|
return data.results.map((item: unknown) => adapter.fromJson(item));
|
|
52
51
|
} catch {
|
|
@@ -2,6 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import { MeasurementCategory, MeasurementCategoryAdapter } from "components/Measurements/models/Category";
|
|
3
3
|
import { MeasurementEntry, MeasurementEntryAdapter } from "components/Measurements/models/Entry";
|
|
4
4
|
import { ApiMeasurementCategoryType } from 'types';
|
|
5
|
+
import { API_MAX_PAGE_SIZE } from "utils/consts";
|
|
5
6
|
import { dateToYYYYMMDD } from "utils/date";
|
|
6
7
|
import { fetchPaginated } from 'utils/requests';
|
|
7
8
|
import { makeHeader, makeUrl } from "utils/url";
|
|
@@ -20,8 +21,14 @@ export const getMeasurementCategories = async (options?: MeasurementQueryOptions
|
|
|
20
21
|
const adapter = new MeasurementCategoryAdapter();
|
|
21
22
|
const entryAdapter = new MeasurementEntryAdapter();
|
|
22
23
|
const categories: MeasurementCategory[] = [];
|
|
24
|
+
const categoryUrl = makeUrl(API_MEASUREMENTS_CATEGORY_PATH, {
|
|
25
|
+
query: {
|
|
26
|
+
limit: API_MAX_PAGE_SIZE,
|
|
27
|
+
...filtersetQueryCategories
|
|
28
|
+
}
|
|
29
|
+
});
|
|
23
30
|
|
|
24
|
-
for await (const page of fetchPaginated(
|
|
31
|
+
for await (const page of fetchPaginated(categoryUrl, makeHeader())) {
|
|
25
32
|
for (const catData of page) {
|
|
26
33
|
categories.push(adapter.fromJson(catData));
|
|
27
34
|
}
|
|
@@ -30,7 +37,13 @@ export const getMeasurementCategories = async (options?: MeasurementQueryOptions
|
|
|
30
37
|
// Load entries for each category
|
|
31
38
|
const entryResponses = categories.map(async (category) => {
|
|
32
39
|
const out: MeasurementEntry[] = [];
|
|
33
|
-
const url = makeUrl(API_MEASUREMENTS_ENTRY_PATH, {
|
|
40
|
+
const url = makeUrl(API_MEASUREMENTS_ENTRY_PATH, {
|
|
41
|
+
query: {
|
|
42
|
+
category: category.id,
|
|
43
|
+
limit: API_MAX_PAGE_SIZE,
|
|
44
|
+
...filtersetQueryEntries,
|
|
45
|
+
}
|
|
46
|
+
});
|
|
34
47
|
|
|
35
48
|
// Collect all pages of entries
|
|
36
49
|
for await (const page of fetchPaginated(url, makeHeader())) {
|
|
@@ -11,17 +11,17 @@ describe("Exercise video service API tests", () => {
|
|
|
11
11
|
id: 1,
|
|
12
12
|
uuid: "b1c934fa-c4f8-4d84-8cb4-7802be0d284c",
|
|
13
13
|
exercise: 258,
|
|
14
|
-
exercise_uuid: "6260e3aa-e46b-4b4b-8ada-58bfd0922d3a",
|
|
14
|
+
"exercise_uuid": "6260e3aa-e46b-4b4b-8ada-58bfd0922d3a",
|
|
15
15
|
video: "http://localhost:8000/media/exercise-video/258/b1c934fa-c4f8-4d84-8cb4-7802be0d284c.mp4",
|
|
16
|
-
is_main: false,
|
|
16
|
+
"is_main": false,
|
|
17
17
|
size: 0,
|
|
18
18
|
duration: "0.00",
|
|
19
19
|
width: 0,
|
|
20
20
|
height: 0,
|
|
21
21
|
codec: "",
|
|
22
|
-
codec_long: "",
|
|
22
|
+
"codec_long": "",
|
|
23
23
|
license: 2,
|
|
24
|
-
license_author: null,
|
|
24
|
+
"license_author": null,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const video = new ExerciseVideo(
|
|
@@ -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,18 +1,19 @@
|
|
|
1
|
-
import { Exercise } from "components/Exercises/models/exercise";
|
|
2
1
|
import { Category } from "components/Exercises/models/category";
|
|
2
|
+
import { Exercise } from "components/Exercises/models/exercise";
|
|
3
3
|
import { Translation } from "components/Exercises/models/translation";
|
|
4
4
|
|
|
5
5
|
export const searchResponse: Exercise[] = [
|
|
6
|
-
new Exercise(
|
|
7
|
-
998,
|
|
8
|
-
"uuid-998",
|
|
9
|
-
new
|
|
10
|
-
|
|
11
|
-
[],
|
|
12
|
-
[],
|
|
13
|
-
[],
|
|
14
|
-
|
|
15
|
-
|
|
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: [
|
|
16
17
|
new Translation(
|
|
17
18
|
1149, // id
|
|
18
19
|
"uuid-1149", // uuid
|
|
@@ -20,20 +21,21 @@ export const searchResponse: Exercise[] = [
|
|
|
20
21
|
"", // description
|
|
21
22
|
1 // language (German)
|
|
22
23
|
)
|
|
23
|
-
],
|
|
24
|
-
[],
|
|
25
|
-
[]
|
|
26
|
-
),
|
|
27
|
-
new Exercise(
|
|
28
|
-
979,
|
|
29
|
-
"uuid-979",
|
|
30
|
-
new
|
|
31
|
-
|
|
32
|
-
[],
|
|
33
|
-
[],
|
|
34
|
-
[],
|
|
35
|
-
|
|
36
|
-
|
|
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: [
|
|
37
39
|
new Translation(
|
|
38
40
|
1213, // id
|
|
39
41
|
"uuid-1213", // uuid
|
|
@@ -41,8 +43,8 @@ export const searchResponse: Exercise[] = [
|
|
|
41
43
|
"", // description
|
|
42
44
|
1 // language (German)
|
|
43
45
|
)
|
|
44
|
-
],
|
|
45
|
-
[],
|
|
46
|
-
[]
|
|
47
|
-
)
|
|
46
|
+
],
|
|
47
|
+
videos: [],
|
|
48
|
+
authors: []
|
|
49
|
+
})
|
|
48
50
|
];
|