Add E-Bike ride activity type (ID 35)

Introduces E-Bike ride as a new activity type (ID 35) across backend, frontend, and documentation. Updates mappings, i18n labels, modal options, cycling type checks, icon assignment, and search filtering to support E-Bike rides.
This commit is contained in:
João Vitória Silva
2025-09-10 09:26:13 +01:00
parent 903b08b948
commit 4e39c74165
7 changed files with 22 additions and 8 deletions

View File

@@ -81,6 +81,7 @@ ACTIVITY_ID_TO_NAME = {
32: "Stand up paddling",
33: "Surf",
34: "Track run",
35: "E-Bike ride"
# Add other mappings as needed based on the full list in define_activity_type comments if required
# "AlpineSki",
# "BackcountrySki",
@@ -192,6 +193,9 @@ ACTIVITY_NAME_TO_ID.update(
"track running": 34,
"trackrun": 34,
"track": 34,
"EBikeRide": 35,
"ebikeride": 35,
"ebike_ride": 35,
}
)

View File

@@ -167,6 +167,7 @@ The table bellow details the activity types supported by Endurain.
| Mixed surface cycling | 29 |
| Virtual cycling | 7 |
| Indoor cycling | 28 |
| E-Bike cycling | 35 |
| Indoor swimming | 8 |
| Open water swimming | 9 |
| General workout | 10 |

View File

@@ -100,6 +100,9 @@
<option value="29">
{{ $t('editActivityModalComponent.modalEditActivityTypeOption29') }}
</option>
<option value="35">
{{ $t('editActivityModalComponent.modalEditActivityTypeOption35') }}
</option>
<option value="7">
{{ $t('editActivityModalComponent.modalEditActivityTypeOption7') }}
</option>

View File

@@ -33,5 +33,6 @@
"standUpPaddling": "Stand up paddling",
"surf": "Surf",
"trackRun": "Track run",
"ebikeRide": "E-Bike ride",
"labelWorkout": " workout"
}

View File

@@ -9,7 +9,6 @@
"modalEditActivityTypeLabel": "Type",
"modalEditActivityTypeOption1": "Run",
"modalEditActivityTypeOption2": "Trail run",
"modalEditActivityTypeOption34": "Track run",
"modalEditActivityTypeOption3": "Virtual run",
"modalEditActivityTypeOption4": "Ride",
"modalEditActivityTypeOption5": "Gravel ride",
@@ -41,6 +40,8 @@
"modalEditActivityTypeOption31": "Indoor walk",
"modalEditActivityTypeOption32": "Stand up paddling",
"modalEditActivityTypeOption33": "Surf",
"modalEditActivityTypeOption34": "Track run",
"modalEditActivityTypeOption35": "E-Bike ride",
"modalEditActivityVisibilityLabel": "Visibility",
"modalEditActivityVisibilityOption0": "Public",
"modalEditActivityVisibilityOption1": "Followers",

View File

@@ -8,7 +8,7 @@ import { formatDateMed, formatTime, formatSecondsToMinutes } from '@/utils/dateT
*/
const ACTIVITY_TYPES = [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34
28, 29, 30, 31, 32, 33, 34, 35
]
/**
@@ -55,7 +55,8 @@ const activityLabelMap = {
31: (t) => t('activityItems.indoorWalk'),
32: (t) => t('activityItems.standUpPaddling'),
33: (t) => t('activityItems.surf'),
34: (t) => t('activityItems.trackRun')
34: (t) => t('activityItems.trackRun'),
35: (t) => t('activityItems.ebikeRide')
}
/**
@@ -311,7 +312,8 @@ export function activityTypeIsCycling(activity) {
activity.activity_type === 7 ||
activity.activity_type === 27 ||
activity.activity_type === 28 ||
activity.activity_type === 29
activity.activity_type === 29 ||
activity.activity_type === 35
)
}
@@ -330,7 +332,8 @@ export function activityTypeNotCycling(activity) {
activity.activity_type !== 7 &&
activity.activity_type !== 27 &&
activity.activity_type !== 28 &&
activity.activity_type !== 29
activity.activity_type !== 29 &&
activity.activity_type !== 35
)
}
@@ -694,7 +697,8 @@ export function getIcon(typeId) {
31: ['fas', 'person-walking'],
32: ['fas', 'person-snowboarding'],
33: ['fas', 'person-snowboarding'],
34: ['fas', 'person-running'] // Track run icon might be better if available
34: ['fas', 'person-running'], // Track run icon might be better if available
35: ['fas', 'person-biking'],
}
return iconMap[typeId] || ['fas', 'dumbbell']

View File

@@ -256,11 +256,11 @@ const fetchGearResults = debounce(async (query) => {
function updateSearchResultsBasedOnActivityType() {
if (searchSelectActivityType.value === '1') {
searchResults.value = searchResultsOriginal.value.filter((user) =>
[1, 2, 3].includes(user.activity_type)
[1, 2, 3, 34].includes(user.activity_type)
)
} else if (searchSelectActivityType.value === '2') {
searchResults.value = searchResultsOriginal.value.filter((user) =>
[4, 5, 6, 7, 27, 28, 29].includes(user.activity_type)
[4, 5, 6, 7, 27, 28, 29, 35].includes(user.activity_type)
)
} else if (searchSelectActivityType.value === '3') {
searchResults.value = searchResultsOriginal.value.filter((user) =>