-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Remove fetch request from heatmap #13623
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
24bf247
Remove fetch request from heatmap
silverwind 1e2dadc
rename and error display
silverwind f514078
also log the js error
silverwind 6be8f24
add error handler
silverwind 16ac779
remove useless inline style and hide divider on small screens
silverwind 6be4db7
Update routers/user/home.go
silverwind bc2cd4a
Update routers/user/profile.go
silverwind 2d293c2
Merge branch 'master' into heatmap-initial
jolheiser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
templates/user/dashboard/heatmap.tmpl → templates/user/heatmap.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
<div id="user-heatmap" style="padding-right: 40px"> | ||
<activity-heatmap :locale="locale" :suburl="suburl" :user="heatmapUser"> | ||
{{if .HeatmapData}} | ||
<div id="user-heatmap" data-heatmap-data="{{Json .HeatmapData}}"> | ||
<div slot="loading"> | ||
<div class="ui active centered inline indeterminate text loader" id="loading-heatmap">{{.i18n.Tr "user.heatmap.loading"}}</div> | ||
</div> | ||
</activity-heatmap> | ||
</div> | ||
</div> | ||
<div class="ui divider"></div> | ||
{{end}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Vue from 'vue'; | ||
|
||
import ActivityHeatmap from '../components/ActivityHeatmap.vue'; | ||
|
||
export default async function initHeatmap() { | ||
const el = document.getElementById('user-heatmap'); | ||
if (!el) return; | ||
|
||
try { | ||
const values = JSON.parse(el.dataset.heatmapData).map(({contributions, timestamp}) => { | ||
return {date: new Date(timestamp * 1000), count: contributions}; | ||
}); | ||
|
||
const View = Vue.extend({ | ||
render: (createElement) => createElement(ActivityHeatmap, {props: {values}}), | ||
}); | ||
|
||
new View().$mount(el); | ||
} catch (err) { | ||
console.error(err); | ||
el.textContent = 'Heatmap failed to load'; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
#user-heatmap { | ||
width: 107%; // Fixes newest contributions not showing | ||
width: 100%; | ||
text-align: center; | ||
position: relative; | ||
min-height: 125px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
svg:not(:root) { | ||
overflow: inherit; | ||
padding: 0 !important; | ||
} | ||
|
||
text { | ||
fill: currentColor !important; | ||
} | ||
|
||
@media @mediaLgAndDown { | ||
& { | ||
&, | ||
& + .divider { | ||
display: none; | ||
} | ||
} | ||
|
||
.total-contributions { | ||
text-align: left; | ||
margin-top: 0; | ||
font-size: 11px; | ||
position: absolute; | ||
bottom: 0; | ||
left: 25px; | ||
} | ||
} | ||
|
||
.heatmap-container { | ||
position: relative; | ||
} | ||
|
||
.heatmap-container .total-contributions { | ||
font-size: 11px; | ||
position: absolute; | ||
bottom: 0; | ||
left: 25px; | ||
} | ||
|
||
@media @mediaLgAndDown { | ||
.heatmap-container .total-contributions { | ||
left: 21px; | ||
@media @mediaLgAndDown { | ||
.total-contributions { | ||
left: 21px; | ||
} | ||
} | ||
} | ||
|
||
@media (max-width: 1000px) { | ||
.heatmap-container .total-contributions { | ||
font-size: 10px; | ||
left: 17px; | ||
bottom: -2px; | ||
@media (max-width: 1000px) { | ||
.total-contributions { | ||
font-size: 10px; | ||
left: 17px; | ||
bottom: -2px; | ||
} | ||
} | ||
} | ||
|
||
.heatmap-container text { | ||
fill: currentColor !important; | ||
.user.profile #user-heatmap { | ||
min-height: 135px; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.