mobile
mobile copied to clipboard
Use project IDs internaly to manage projects
Fixes #1969
This PR adds foundational work for supporting project IDs in mobile app. Besides issue mentioned above this is preliminary work for #1008, #1102, #576, project renaming etc.
Outline of the changes done:
- core
- CoreUtils
- refactor
-
getFullProjectName(),extractProjectName()has been moved fromMerginApi
- Project
-
LocalProjectsupports UUID type of IDs + newgenerateProjectId() -
MerginProjectsupports UUID type of IDs + newfullname() -
LocalProjectsListchanged to HashMapLocalProjectsDictwith ID as key
-
- LocalProjectsManager
- keeps projects in HashMap
- delete
projectFromMerginName(), it was used only by tests - new
updateProjectId()necessary function for creating new projects on server ( server returns new ID for already existing projects, app needs to adapt to it) - general refactor and move from project fullnames to project IDs as parameters in functions
- MerginApi
- general refactor, a lot of the functions are never called from QML for example
-
listProjectsByName()stays until there isv2endpoint for IDs - delete
migrateProjectToMergin()just a wrapper forcreateProject()( i think it was used just by tests) - delete
projectDiffableFiles()not used anywhere - move
getFullProjectName()&extractProjectName()to utils - change
deleteProject()to use immediate deletion instead of scheduled, we use it only internally for project management - remove
topicparameter fromnetworkErrorOccured()it was only used by tests (they use http error codes now) - new
projectIdChanged()signal to trigger update of local project ID to server generated ID - new
getProjectDetails()it's leaner version ofgetProjectInfo(), the response won't contain versioning history -
Transactionsnow keep projectId as key - generally everything what could be, was moved to use project IDs, the synchronization workflow couldn't, so for communication with API we use project names but internally the project ID is propagated and used where possible
- when a local project is "migrated" to mergin there is new request for new project ID generated on server that is further processed and local ID is changed to match server ID
- CoreUtils
- app
- QML
- just refactor to support project IDs
- C++
- ActiveProject
- new
projectId()to get project ID of active project
- new
- Main
- rework to project IDs
- ProjectsModel
- replaced
listProjectsByName()byfetchProjectsById() - reworked slots to use project IDs
- removed
porjectNames(), it was used internally and is not necessary since we moved to IDs
- replaced
- ProjectWizard
- refactor, most importantly moved from deprecated
QVariant::typetoQMetaType
- refactor, most importantly moved from deprecated
- SynchronizationManager
- keeps synchronization processes by project ID
- reworked to use project IDs instead of project names
- ActiveProject
- Tests
- mostly refactor & minor changes
- replaced
findProjectByName()with template function - moved descriptive inline test function comments to header file or written new ones
- QML
Pull Request Test Coverage Report for Build 15041670829
Details
- 0 of 0 changed or added relevant lines in 0 files are covered.
- 634 unchanged lines in 14 files lost coverage.
- Overall coverage increased (+0.3%) to 60.661%
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| input/app/projectwizard.h | 1 | 50.0% |
| input/core/merginapi.h | 1 | 97.56% |
| input/core/merginprojectstatusmodel.h | 1 | 0.0% |
| input/core/project.cpp | 1 | 97.22% |
| input/app/projectsmodel.h | 3 | 25.0% |
| input/core/project.h | 16 | 46.15% |
| input/app/variablesmanager.cpp | 19 | 60.28% |
| input/core/localprojectsmanager.cpp | 21 | 78.74% |
| input/core/coreutils.cpp | 31 | 82.61% |
| input/app/projectsmodel.cpp | 41 | 69.52% |
| <!-- | Total: | 634 |
| Totals | |
|---|---|
| Change from base Build 15018608869: | 0.3% |
| Covered Lines: | 8202 |
| Relevant Lines: | 13521 |
💛 - Coveralls
From our discussion earlier today:
For sync:
For listing downloaded projects: