Commit Graph

2910 Commits

Author SHA1 Message Date
João Vitória Silva
f1c55a7947 Move UserDistanceStatsComponent to users directory
Renamed UserDistanceStatsComponent and its i18n files from the activities to the users directory for better organization. Updated all relevant imports and i18n paths. Also updated the Crowdin configuration to include the new users component path. Minor docstring update in user_goals router to clarify date argument.
2025-09-01 13:27:04 +01:00
João Vitória Silva
f2cc34329e Refactor userGoalsService and remove genericUtils
Simplified userGoalsService by removing data transformation logic and direct dependencies on utility functions. Deleted genericUtils.js as it is no longer used. Also removed debug logs from router and adjusted router initialization order in main.js.
2025-09-01 13:18:08 +01:00
João Vitória Silva
6861bd46ea Refactor formatting utils to use translation function
Updated all formatting utility functions (e.g., formatDistance, formatPace, formatCalories, etc.) to accept a translation function `t` for proper localization. Refactored all component usages to pass the translation function accordingly. This change improves i18n support and ensures all user-facing strings are localized. Also added debug logging in the router and updated user goals service to use the new formatting signatures.
2025-09-01 13:07:31 +01:00
João Vitória Silva
18868d39c6 Add route meta for auth and improve navigation guards
Introduces a meta.requiresAuth property to all routes for clearer authentication requirements. Refactors the navigation guard to use this meta property, redirecting unauthenticated users to login and preserving intended destination. Also adds scroll behavior to restore saved position or scroll to top.
2025-09-01 11:46:16 +01:00
João Vitória Silva
5f570e250d Refactor i18n to dynamic import and lazy loading
Replaces static import and manual message construction for translations with a dynamic import and lazy loading approach. This reduces boilerplate, simplifies locale and component management, and improves maintainability for adding new languages or components.
2025-09-01 11:40:20 +01:00
João Vitória Silva
1345b124b8 Add empty settingsUserGoals.json for multiple locales
Added empty settingsUserGoals.json files for ca, de, es, fr, nl, and pt locales and registered them in i18n/index.js. Also cleaned up the us version by removing unused goal-related strings, keeping only those relevant to fetching and displaying goals.
2025-09-01 11:29:07 +01:00
João Vitória Silva
6cfad29333 Add user goals import to profile data import
Extended the profile data import functionality to include user goals. Updated documentation, data mapping, and import logic to handle user goals alongside other user-related data.
2025-09-01 11:21:56 +01:00
João Vitória Silva
7227ff79bb Add user goals to profile export and fix import paths
User goals are now included in the profile data export ZIP, with corresponding updates to the backend export logic and counts. Refactored backend user goals CRUD to clarify function naming. Fixed import paths for Goals components in frontend Settings views and adjusted icon spacing in GoalsListComponent.
2025-09-01 11:08:06 +01:00
João Vitória Silva
f6ec8085aa Fix loading state handling in user settings components
Corrects the initialization and management of the isLoading state in SettingsUserGoals.vue and SettingsUsersZone.vue. Ensures loading indicators are set appropriately during async data fetching on component mount.
2025-09-01 10:57:58 +01:00
João Vitória Silva
3759b6d869 Refactor user goals components and remove confirm modal
Renamed SettingsGoals components and i18n files to SettingsUserGoals for clarity and consistency. Updated all relevant imports and translation keys. Removed the reusable ConfirmComponent and its example. Also removed the unused 'parse-duration' dependency from package.json and updated several frontend dependencies.
2025-08-30 22:56:20 +01:00
João Vitória Silva
d6697bf748 Add goal editing support and improve goal units handling
Implemented goal editing functionality in the frontend, including edit modals, event handling, and service methods. Updated backend schemas to introduce UserGoalEdit for partial updates. Improved unit conversion utilities and ensured correct display and conversion of distance and elevation based on user settings. Added success/error messages for editing and deleting goals, and refactored related code for clarity and maintainability.
2025-08-30 22:43:56 +01:00
João Vitória Silva
51559d5c3c Refactor user goal schemas and improve goal creation UX
Refactored backend user goal schemas to introduce UserGoalBase, UserGoalCreate, and UserGoalRead for clearer API boundaries and stricter validation. Updated CRUD and router logic to use new schemas and improved error handling. On the frontend, enhanced goal creation flow to optimistically add new goals to the list, display success notifications, and show more detailed goal information in the list. Added new i18n string for successful goal addition.
2025-08-28 10:42:16 +01:00
João Vitória Silva
297e814d43 Refactor user goals schema and migration structure
Consolidates UserGoalBase and UserGoal into a single UserGoal schema, updates related CRUD and router signatures, and adjusts the Alembic migration to match the new model structure. The migration now includes additional goal fields, changes interval to non-nullable, and updates comments for clarity. Also updates the gear.created_at column comment for consistency.
2025-08-27 09:15:52 +01:00
João Vitória Silva
1c8cf29f7c Refactor user goal schema with enums and stricter validation
Replaces string/int fields for interval, activity_type, and goal_type with Enum/IntEnum types for better type safety. Adds field-level non-negative integer constraints and a model-level validator to ensure only the correct goal value is set based on goal_type. Updates model configuration for stricter validation and assignment.
2025-08-26 23:28:56 +01:00
João Vitória Silva
4d4fb6784c Refactor user goals to support new goal types
Updated backend and frontend to support new goal types and structure for user goals, including new fields such as goal_type and goal_activities_number. Adjusted validation, models, and API schema accordingly. Added new Vue components for managing goals in the settings area and updated i18n files for multiple languages.
2025-08-26 22:59:15 +01:00
João Vitória Silva
50c3a7a51f Merge branch 'master' into 0.14.0 2025-08-20 09:50:41 +01:00
João Vitória Silva
0e17fafe45 Handle string datetimes in serialize_activity
Added a helper to convert string datetime fields to datetime objects before applying timezone formatting in serialize_activity. This prevents errors when activity fields are provided as ISO format strings.
v0.13.4
2025-08-19 21:49:54 +01:00
João Vitória Silva
61e21224a3 Bump dependencies 2025-08-19 21:45:01 +01:00
João Vitória Silva
337d486f19 Merge branch 'pr/314' into pre-release 2025-08-19 21:42:50 +01:00
João Vitória Silva
b163150724 Merge branch 'pr/312' into pre-release 2025-08-19 21:25:15 +01:00
João Vitória Silva
86699a15f5 Use let for minutes and seconds in pace formatters
Changed variable declarations for minutes and seconds from const to let in pace formatting functions to allow for reassignment when seconds round up to 60.
2025-08-19 21:20:53 +01:00
João Vitória Silva
fe3df4c855 Add fetchNotificationById method to navbar mobile
Introduces a new async function to fetch a notification by its ID and prepend it to the notifications list if not already present. Increments the unread count if the notification is unread and handles errors with a user-facing message.
2025-08-19 21:06:32 +01:00
João Vitória Silva
cc06dbb857 Set geocode as default REVERSE_GEO_PROVIDER
Changed the default value of REVERSE_GEO_PROVIDER from 'nominatim' to 'geocode' in the configuration and updated the documentation to reflect this new default.
2025-08-19 10:27:10 +01:00
Sameer Morar
10b6d11002 Merge remote-tracking branch 'refs/remotes/origin/Bug-283-activity-dates' into Bug-283-activity-dates 2025-08-19 11:37:15 +10:00
Sameer Morar
6f43912502 Remove unnecessary parentheses. 2025-08-19 11:35:57 +10:00
João Vitória Silva
ea8b4d05c7 Fix casing for 'Yes' in environment variables table
Corrected the casing of 'yes' to 'Yes' in the GEOCODES_MAPS_RATE_LIMIT row for consistency with other entries in the table.
2025-08-18 22:37:08 +01:00
João Vitória Silva
c422005fa9 Add Nominatim as reverse geocoding provider
Introduces support for Nominatim as a reverse geocoding provider alongside geocode and photon. Updates configuration and documentation to include NOMINATIM_API_HOST and NOMINATIM_API_USE_HTTPS environment variables, sets Nominatim as the default provider, and refactors related logic in utils.py.
2025-08-18 22:28:30 +01:00
João Vitória Silva
1cc298a669 Merge remote-tracking branch 'origin/l10n_pre-release' into pre-release 2025-08-18 21:26:41 +01:00
João Vitória Silva
1afa2acba9 Fix KeyError in TCX speed stats extraction
Replaced direct dictionary access with .get() when extracting 'max' speed from lap.tpx_ext_stats to prevent KeyError if 'Speed' or 'max' keys are missing.
2025-08-18 21:26:26 +01:00
João Vitória Silva
10fc68dd10 New translations activityitems.json (Portuguese) 2025-08-18 17:57:31 +01:00
João Vitória Silva
bca74b0d93 New translations editactivitymodalcomponent.json (Portuguese) 2025-08-18 17:57:29 +01:00
miacono
730585f508 fix HR zones assignment 2025-08-18 18:55:57 +02:00
João Vitória Silva
cbbb7d6315 New translations activityitems.json (Portuguese) 2025-08-18 16:46:05 +01:00
João Vitória Silva
ca70f60474 New translations activityitems.json (Dutch) 2025-08-18 16:46:04 +01:00
João Vitória Silva
5b1cd3ddc5 New translations activityitems.json (Catalan) 2025-08-18 16:46:03 +01:00
João Vitória Silva
eb1750093a New translations activityitems.json (Spanish) 2025-08-18 16:46:02 +01:00
João Vitória Silva
d83650255d New translations activityitems.json (French) 2025-08-18 16:46:00 +01:00
João Vitória Silva
4308f50ffd New translations editactivitymodalcomponent.json (Portuguese) 2025-08-18 16:44:11 +01:00
João Vitória Silva
7bdf37b811 New translations editactivitymodalcomponent.json (German) 2025-08-18 16:44:10 +01:00
João Vitória Silva
c2a6b6d51c New translations editactivitymodalcomponent.json (Catalan) 2025-08-18 16:44:08 +01:00
João Vitória Silva
21d9425213 New translations editactivitymodalcomponent.json (Spanish) 2025-08-18 16:44:07 +01:00
João Vitória Silva
a6e62bf498 New translations editactivitymodalcomponent.json (French) 2025-08-18 16:44:05 +01:00
João Vitória Silva
d67a2aff96 New translations activityitems.json (German) 2025-08-18 16:43:13 +01:00
João Vitória Silva
77e0bf6d3d New translations editactivitymodalcomponent.json (Dutch) 2025-08-18 16:42:59 +01:00
João Vitória Silva
77ccf4a184 Handle tuple values for category fields in activity sets
Updated the create_activity_sets function to properly extract values from tuples for the category and category_subtype fields. Also fixed logging to use core_logger.print_to_log for error reporting.
2025-08-18 16:41:31 +01:00
João Vitória Silva
bbccf98bc4 Add 'Track run' activity type and update dependencies
Introduces 'Track run' as a new activity type in the backend, updating mappings and distance calculations accordingly. Removes debug print statements from FIT utils. Updates backend dependencies in poetry.lock and pyproject.toml, and bumps API version to v0.13.4. Adds new ignore rules for import error files in .gitignore. Minor updates to frontend components and i18n files.
2025-08-18 16:31:35 +01:00
Sameer Morar
d80b5571c5 Merge branch 'joaovitoriasilva:master' into Bug-283-activity-dates 2025-08-19 01:11:52 +10:00
Sameer Morar
2fafaeddeb Resolve #215 and #283 by:
Create tz_applied fields in the schema object.
Only apply timezone adjustments to the tz_applied fields.
Changed references to start_time and created_at to use their corresponding tz_applied fields.
2025-08-19 01:09:17 +10:00
João Vitória Silva
b00379e031 Merge remote-tracking branch 'origin/l10n_pre-release' into pre-release 2025-08-18 16:06:32 +01:00
João Vitória Silva
d43bf1c888 Merge pull request #309 from dataprolet/master 2025-08-11 18:33:06 +01:00