Skip to content
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

User action heatmap #5131

Merged
merged 34 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
26bb85f
Added basic heatmap data
kolaente Oct 20, 2018
f27fe68
Added extra case for sqlite
kolaente Oct 20, 2018
af87a62
Built basic heatmap into user profile
kolaente Oct 20, 2018
562257c
Get contribution data from api & styling
kolaente Oct 20, 2018
1a36952
Fixed lint & added extra group by statements for all database types
kolaente Oct 20, 2018
1ae7ed2
generated swagger spec
kolaente Oct 20, 2018
7823d45
generated swagger spec
kolaente Oct 20, 2018
3f2562a
generated swagger spec
kolaente Oct 20, 2018
a1d3fb7
fixed swagger spec
kolaente Oct 20, 2018
5d99fc5
fmt
kolaente Oct 20, 2018
63cf602
Added tests
kolaente Oct 20, 2018
b01dcd2
Added setting to enable/disable user heatmap
kolaente Oct 20, 2018
cac8299
Added locale for loading text
kolaente Oct 20, 2018
a831999
Removed UseTiDB
kolaente Oct 20, 2018
068eaaf
Merge branch 'master' into feature/commit-heatmap
kolaente Oct 20, 2018
fdd3132
Updated librejs & moment.js
kolaente Oct 20, 2018
dd04de8
Merge remote-tracking branch 'origin/feature/commit-heatmap' into fea…
kolaente Oct 20, 2018
86aa012
Merge branch 'master' into feature/commit-heatmap
kolaente Oct 20, 2018
8fb9857
Merge branch 'master' into feature/commit-heatmap
kolaente Oct 20, 2018
3a85ca7
Fixed import order
kolaente Oct 20, 2018
bed8f3c
Merge remote-tracking branch 'origin/feature/commit-heatmap' into fea…
kolaente Oct 20, 2018
6e9519f
Fixed heatmap in postgresql
kolaente Oct 21, 2018
6d724e6
Update docs/content/doc/advanced/config-cheat-sheet.en-us.md
sapk Oct 21, 2018
7ecaeac
Merge branch 'master' into feature/commit-heatmap
kolaente Oct 21, 2018
9db3069
Added copyright header
kolaente Oct 21, 2018
2ea5a1e
Fixed a bug to show the heatmap for the actual user instead of the cu…
kolaente Oct 21, 2018
06846be
Added integration test for heatmaps
kolaente Oct 21, 2018
20a35d6
Added a heatmap on the dashboard
kolaente Oct 21, 2018
81d98ed
Fixed timestamp parsing
kolaente Oct 21, 2018
e441242
Merge branch 'master' into feature/commit-heatmap
kolaente Oct 21, 2018
8de8db1
Hide heatmap on mobile
kolaente Oct 21, 2018
9c0e184
optimized postgresql group by query
kolaente Oct 21, 2018
727171a
Improved sqlite group by statement
kolaente Oct 22, 2018
e8a7559
Merge branch 'master' into feature/commit-heatmap
lunny Oct 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
generated swagger spec
  • Loading branch information
kolaente committed Oct 20, 2018
commit 1ae7ed2e8f2b963232e63f0cbace573adc56badf
7 changes: 7 additions & 0 deletions routers/api/v1/swagger/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package swagger

import (
api "code.gitea.io/sdk/gitea"
"code.gitea.io/gitea/models"
)

// User
Expand Down Expand Up @@ -34,3 +35,9 @@ type swaggerModelEditUserOption struct {
// in:body
Options api.EditUserOption
}

// swagger:model UserHeatmapData
type swaggerModelUserHeatmapData struct {
// in:body
Body []models.UserHeatmapData `json:"body"`
}
10 changes: 4 additions & 6 deletions routers/api/v1/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ func GetAuthenticatedUser(ctx *context.APIContext) {

// GetUserHeatmapData is the handler to get a users heatmap
func GetUserHeatmapData(ctx *context.APIContext) {

// swagger:operation GET /users/{username}/heatmap user GetUserHeatmapData
// swagger:operation GET /users/{username}/heatmap user userGetHeatmapData
// ---
// summary: Get a user's heatmap
// produces:
Expand All @@ -150,10 +149,9 @@ func GetUserHeatmapData(ctx *context.APIContext) {
// required: true
// responses:
// "200":
// schema:
// type: array
// items:
// "$ref": "#/definitions/UserHeatmap"
// type: array
// items:
// "$ref": "#/definitions/UserHeatmapData"
// "404":
// "$ref": "#/responses/notFound"
u, err := models.GetUserByName(ctx.Params(":username"))
Expand Down
29 changes: 28 additions & 1 deletion templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"version": "1.1.1"
},
"basePath": "{{AppSubUrl}}/api/v1",
"basePath": "/api/v1",
"paths": {
"/admin/users": {
"post": {
Expand Down Expand Up @@ -5377,6 +5377,33 @@
}
}
},
"/users/{username}/heatmap": {
"get": {
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Get a user's heatmap",
"operationId": "userGetHeatmapData",
"parameters": [
{
"type": "string",
"description": "username of user to get",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"404": {
"$ref": "#/responses/notFound"
}
}
}
},
"/users/{username}/keys": {
"get": {
"produces": [
Expand Down