[PR #5131] [MERGED] User action heatmap #17659

Closed
opened 2025-11-02 14:49:07 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5131
Author: @kolaente
Created: 10/20/2018
Status: Merged
Merged: 10/23/2018
Merged by: @lunny

Base: masterHead: feature/commit-heatmap


📝 Commits (10+)

  • 26bb85f Added basic heatmap data
  • f27fe68 Added extra case for sqlite
  • af87a62 Built basic heatmap into user profile
  • 562257c Get contribution data from api & styling
  • 1a36952 Fixed lint & added extra group by statements for all database types
  • 1ae7ed2 generated swagger spec
  • 7823d45 generated swagger spec
  • 3f2562a generated swagger spec
  • a1d3fb7 fixed swagger spec
  • 5d99fc5 fmt

📊 Changes

27 files changed (+649 additions, -1 deletions)

View changed files

📝 docs/content/doc/advanced/config-cheat-sheet.en-us.md (+1 -0)
integrations/api_user_heatmap_test.go (+30 -0)
📝 models/fixtures/action.yml (+1 -0)
📝 models/unit_tests.go (+1 -0)
models/user_heatmap.go (+40 -0)
models/user_heatmap_test.go (+33 -0)
📝 modules/setting/setting.go (+2 -0)
📝 options/locale/locale_en-US.ini (+1 -0)
📝 public/css/index.css (+1 -1)
📝 public/less/_base.less (+17 -0)
📝 public/less/_user.less (+4 -0)
📝 public/vendor/VERSIONS (+9 -0)
📝 public/vendor/librejs.html (+15 -0)
public/vendor/plugins/calendar-heatmap/calendar-heatmap.css (+27 -0)
public/vendor/plugins/calendar-heatmap/calendar-heatmap.js (+311 -0)
public/vendor/plugins/d3/d3.v4.min.js (+2 -0)
public/vendor/plugins/moment/moment.min.js (+1 -0)
📝 routers/api/v1/api.go (+8 -0)
📝 routers/api/v1/swagger/user.go (+8 -0)
📝 routers/api/v1/user/user.go (+39 -0)

...and 7 more files

📄 Description

This pr adds heatmaps to user's profile, just like the ones on github or gitlab. It takes every action from the action table to build the grid, this means things like issue comments are also included, not only code commits. The fetching is done via a new api endpoint.
I also added a config option to globally disable this.

With some tests, it does not seem like this is something which draws a lot performance (takes ~0.005 sec on a prod gitea server), so I see no reason to implement extra caching.

@markuman I saw your example and tried to re-use some things frontend wise, but unfortualy, the code is minified, so I couldn't use it. Feel free to comment if you have some ideas on how to improve the frontend code, js is not my strength.

Closes #6 and #4918

Screenshot

image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/5131 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 10/20/2018 **Status:** ✅ Merged **Merged:** 10/23/2018 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `feature/commit-heatmap` --- ### 📝 Commits (10+) - [`26bb85f`](https://github.com/go-gitea/gitea/commit/26bb85f076dc19cc9796a10534966f4da88a1c02) Added basic heatmap data - [`f27fe68`](https://github.com/go-gitea/gitea/commit/f27fe685fc857f44e7c454591a43846298b08bb6) Added extra case for sqlite - [`af87a62`](https://github.com/go-gitea/gitea/commit/af87a62edcb91ab50f5b9d8a8d07dd318997e623) Built basic heatmap into user profile - [`562257c`](https://github.com/go-gitea/gitea/commit/562257c713be1bf499af1b30445a1b0b59d1fb34) Get contribution data from api & styling - [`1a36952`](https://github.com/go-gitea/gitea/commit/1a36952cb4ecc6190d4166f91b11ddcc1d357631) Fixed lint & added extra group by statements for all database types - [`1ae7ed2`](https://github.com/go-gitea/gitea/commit/1ae7ed2e8f2b963232e63f0cbace573adc56badf) generated swagger spec - [`7823d45`](https://github.com/go-gitea/gitea/commit/7823d45e70ce5ac67546855838ec008e35fe1ed0) generated swagger spec - [`3f2562a`](https://github.com/go-gitea/gitea/commit/3f2562af0e406b935581d41c3e6299956b75a49d) generated swagger spec - [`a1d3fb7`](https://github.com/go-gitea/gitea/commit/a1d3fb72d2e88d2b5823528f28f94f2d141f7a19) fixed swagger spec - [`5d99fc5`](https://github.com/go-gitea/gitea/commit/5d99fc584ff8b069cea5f8fb195ff66dc97f1a30) fmt ### 📊 Changes **27 files changed** (+649 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/doc/advanced/config-cheat-sheet.en-us.md` (+1 -0) ➕ `integrations/api_user_heatmap_test.go` (+30 -0) 📝 `models/fixtures/action.yml` (+1 -0) 📝 `models/unit_tests.go` (+1 -0) ➕ `models/user_heatmap.go` (+40 -0) ➕ `models/user_heatmap_test.go` (+33 -0) 📝 `modules/setting/setting.go` (+2 -0) 📝 `options/locale/locale_en-US.ini` (+1 -0) 📝 `public/css/index.css` (+1 -1) 📝 `public/less/_base.less` (+17 -0) 📝 `public/less/_user.less` (+4 -0) 📝 `public/vendor/VERSIONS` (+9 -0) 📝 `public/vendor/librejs.html` (+15 -0) ➕ `public/vendor/plugins/calendar-heatmap/calendar-heatmap.css` (+27 -0) ➕ `public/vendor/plugins/calendar-heatmap/calendar-heatmap.js` (+311 -0) ➕ `public/vendor/plugins/d3/d3.v4.min.js` (+2 -0) ➕ `public/vendor/plugins/moment/moment.min.js` (+1 -0) 📝 `routers/api/v1/api.go` (+8 -0) 📝 `routers/api/v1/swagger/user.go` (+8 -0) 📝 `routers/api/v1/user/user.go` (+39 -0) _...and 7 more files_ </details> ### 📄 Description This pr adds heatmaps to user's profile, just like the ones on github or gitlab. It takes every action from the `action` table to build the grid, this means things like issue comments are also included, not only code commits. The fetching is done via a new api endpoint. I also added a config option to globally disable this. With some tests, it does not seem like this is something which draws a lot performance (takes ~0.005 sec on a prod gitea server), so I see no reason to implement extra caching. @markuman I saw your example and tried to re-use some things frontend wise, but unfortualy, the code is minified, so I couldn't use it. Feel free to comment if you have some ideas on how to improve the frontend code, js is not my strength. Closes #6 and #4918 ## Screenshot ![image](https://user-images.githubusercontent.com/13721712/47258352-53284400-d49a-11e8-813f-f9f93cec9942.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 14:49:10 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17659