-
-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add import and export buttons/functions #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add import and export buttons/functions #205
Conversation
@joaovitoriasilva, review before merging any changes to your branch again, to avoid causing another big conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds import/export functionality for user data by extending backend APIs, updating frontend service utilities, and adding corresponding UI elements with localization entries.
- Refactor serviceUtils to support blob responses and file uploads
- Add
exportData
/importData
methods inprofileService
and update UI localization - Implement
/profile/export
and/profile/import
endpoints in backend
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
frontend/app/src/utils/serviceUtils.js | Refactored HTTP helper functions; added blob support and file upload methods |
frontend/app/src/services/profileService.js | Added exportData and importData methods |
frontend/app/src/i18n/us/components/settings/*.json | Added import/export button labels and messages |
frontend/app/src/i18n/pt/generalItems.json | Added new keys (note: translations may be incorrect) |
frontend/app/src/i18n/fr/components/settings/*.json | Added new keys (note: one English string remains untranslated) |
frontend/app/.env | Changed VITE_ENDURAIN_HOST to localhost |
backend/app/profile/router.py | Added ZIP export/import endpoints but missing import for StreamingResponse |
Comments suppressed due to low confidence (8)
frontend/app/src/utils/serviceUtils.js:129
- It looks like the closing brace at line 129 ends
fetchPostFileRequest
prematurely, causing thereturn fetchWithRetry(url, options)
to be outside the function body. Please fix the brace placement so that the return is inside the function.
}
frontend/app/src/utils/serviceUtils.js:143
- Similarly, this brace ends
fetchPostFormUrlEncoded
too early, so the subsequentreturn fetchWithRetry
is outside the function. Adjust braces to include the return in the function body.
}
frontend/app/src/utils/serviceUtils.js:156
- This closing brace ends
fetchPostRequest
before its return statement. Ensure the return is inside the function by moving or removing this extra brace.
}
frontend/app/src/utils/serviceUtils.js:169
- The brace here prematurely closes
fetchPutRequest
, placing thereturn fetchWithRetry
outside the function. Please correct the function structure.
}
frontend/app/src/utils/serviceUtils.js:181
- This closing brace ends
fetchDeleteRequest
too early, causing a syntax error for the return statement. Re-align braces to keep the return inside the function.
}
backend/app/profile/router.py:271
- The code uses
StreamingResponse
but it's not imported. Addfrom fastapi.responses import StreamingResponse
(or equivalent) at the top of the file to avoid a NameError.
return StreamingResponse(
frontend/app/src/i18n/pt/generalItems.json:55
- The Portuguese locale file contains French strings (
Annuler
,Chargement
). Please correct these entries to their Portuguese equivalents.
"cancel": "Annuler",
frontend/app/src/i18n/fr/components/settings/settingsUserProfileZoneComponent.json:72
- This French locale entry is still in English. Please provide the proper French translation.
"successUpdateUserPrivacySettings": "User privacy settings updated successfully",
[backend] fix for export_profile_data exporting data as objects and not as a dict [backend] added additional user data to export logic [backend] export should now only include .fit files related to the user [frontend] re added .env file
[backend] added missing user info to export logic [frontend] moved to composition API in some files [frontend] added new ModalComponentUploadFile [frontend] moved modal logic to upload activity on HomeView to new modal [frontend] added new section on settingsUserProfileZoneComponent for import and export to be aligned with rest of the code [frontend] moved modal logic to upload activity on settingsUserProfileZoneComponent to new modal
[frontend] change button icons and spacing [frontend] change download file name [frontend] added notification promise logic to import to be aligned with rest of the code
Hi, export logic reviewed. Import is next |
[backend] replaced hardcoded file and directory paths throughout the backend with constants defined in core.config for better maintainability and configurability. Updated all relevant modules, including activity, profile, server settings, and user utilities [backend] improved the export profile data logic [backend] add user image if available to export logic [frontend] added a beta tag to the export data section in the frontend.
[backend] gear and user tables working on import [backend] added new methods to laps, sets, streams, sets to get all entries based on array of activity ids to make DB calls more efficient [backend] added edit_health_target function to health_targets crud for import feature [backend] added edit_user_integrations function to user_integrations crud for import feature [frontend] moved to composition API in some files [frontend] added spinner to import and export buttons and proper disabled on the buttons [frontend] improve, simplified uploadImportFile with notivue notifications and removed unused functions [frontend] fixed US translations [frontend] made API calls with files uniform
[backend] added support for user_default_gear to import feature [frontend] fix issue joaovitoriasilva#218
[backend] added support for user_privacy_settings and user_integrations to import feature
[backend] added support for activities, health_data, user image and user activity files to import feature [backend] fixed issue on health_data where date on health_data table was set has unique, not allowing two or more users have an entry for the same day [docs] fixed volumes on docker examples and docs based on change made on v0.12.4 [docs] added volume server_images on getting started
Merged on pre-release |
Description
This PR introduces the “Import and Export Data” button to the user settings page, allowing users to export their data in a compressed file and also select and upload a .zip backup file they previously exported.
Related issues: closes #175