* Some refactors related repository model
* Move more methods out of repository
* Move repository into models/repo
* Fix test
* Fix test
* some improvements
* Remove unnecessary function
* DBContext is just a Context
This PR removes some of the specialness from the DBContext and makes it context
This allows us to simplify the GetEngine code to wrap around any context in future
and means that we can change our loadRepo(e Engine) functions to simply take contexts.
Signed-off-by: Andrew Thornton <[email protected]>
* fix unit tests
Signed-off-by: Andrew Thornton <[email protected]>
* another place that needs to set the initial context
Signed-off-by: Andrew Thornton <[email protected]>
* avoid race
Signed-off-by: Andrew Thornton <[email protected]>
* change attachment error
Signed-off-by: Andrew Thornton <[email protected]>
* chore: rewrite format.
* chore: update format
Signed-off-by: Bo-Yi Wu <[email protected]>
* chore: update format
Signed-off-by: Bo-Yi Wu <[email protected]>
* chore: Adjacent parameters with the same type should be grouped together
* chore: update format.
* Show total tracked time in issue and milestone list
Show total tracked time at issue page
Signed-off-by: Jonas Franz <[email protected]>
* Optimizing TotalTimes by using SumInt
Signed-off-by: Jonas Franz <[email protected]>
* Fixing wrong total times for milestones caused by a missing JOIN
Adding unit tests for total times
Signed-off-by: Jonas Franz <[email protected]>
* Logging error instead of ignoring it
Signed-off-by: Jonas Franz <[email protected]>
* Correcting spelling mistakes
Signed-off-by: Jonas Franz <[email protected]>
* Change error message to a short version
Signed-off-by: Jonas Franz <[email protected]>
* Add error handling to TotalTimes
Add variable for totalTimes
Signed-off-by: Jonas Franz <[email protected]>
* Introduce TotalTrackedTimes as variable of issue
Load TotalTrackedTimes by loading attributes of IssueList
Load TotalTrackedTimes by loading attributes of single issue
Add Sec2Time as helper to use it in templates
Signed-off-by: Jonas Franz <[email protected]>
* Fixed test + gofmt
Signed-off-by: Jonas Franz <[email protected]>
* Load TotalTrackedTimes via MilestoneList instead of single requests
Signed-off-by: Jonas Franz <[email protected]>
* Add documentation for MilestoneList
Signed-off-by: Jonas Franz <[email protected]>
* Add documentation for MilestoneList
Signed-off-by: Jonas Franz <[email protected]>
* Fix test
Signed-off-by: Jonas Franz <[email protected]>
* Change comment from SQL query to description
Signed-off-by: Jonas Franz <[email protected]>
* Fix unit test by using int64 instead of int
Signed-off-by: Jonas Franz <[email protected]>
* Fix unit test by using int64 instead of int
Signed-off-by: Jonas Franz <[email protected]>
* Check if timetracker is enabled
Signed-off-by: Jonas Franz <[email protected]>
* Fix test by enabling timetracking
Signed-off-by: Jonas Franz <[email protected]>