From eb8ef35122e1bab7e9f289f3e6d5d682957f3d98 Mon Sep 17 00:00:00 2001 From: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> Date: Sun, 21 Jul 2019 19:12:16 +0900 Subject: [PATCH 1/3] Fix activity calendar for desktop widget (#5200) * Fix activity calendar for desktop widget * fetch past 21 weeks for activity widgets * Cleanup * forEach -> map * Revert "forEach -> map" This reverts commit b72e180ee4a788ff1a3c2955a061646561b2b735. --- .../desktop/views/components/activity.calendar.vue | 12 ++++++------ .../app/desktop/views/components/activity.chart.vue | 2 +- src/client/app/desktop/views/components/activity.vue | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/app/desktop/views/components/activity.calendar.vue b/src/client/app/desktop/views/components/activity.calendar.vue index 9e3e6f0818..da74a97f68 100644 --- a/src/client/app/desktop/views/components/activity.calendar.vue +++ b/src/client/app/desktop/views/components/activity.calendar.vue @@ -5,7 +5,7 @@ :x="record.x" :y="record.date.weekday" rx="1" ry="1" fill="transparent"> - {{ record.date.year }}/{{ record.date.month }}/{{ record.date.day }} + {{ record.date.year }}/{{ record.date.month + 1 }}/{{ record.date.day }} { + let x = 20; + this.data.slice().forEach((d, i) => { d.x = x; const date = new Date(year, month, day - i); d.date = { year: date.getFullYear(), month: date.getMonth(), - day: date.getDate() + day: date.getDate(), + weekday: date.getDay() }; - d.date.weekday = (new Date(d.date.year, d.date.month - 1, d.date.day)).getDay(); d.v = peak == 0 ? 0 : d.total / (peak / 2); if (d.v > 1) d.v = 1; @@ -58,7 +58,7 @@ export default Vue.extend({ const cl = 15 + ((1 - d.v) * 80); d.color = `hsl(${ch}, ${cs}%, ${cl}%)`; - if (d.date.weekday == 6) x++; + if (d.date.weekday == 0) x--; }); } }); diff --git a/src/client/app/desktop/views/components/activity.chart.vue b/src/client/app/desktop/views/components/activity.chart.vue index 7a5004e998..648b64a3fe 100644 --- a/src/client/app/desktop/views/components/activity.chart.vue +++ b/src/client/app/desktop/views/components/activity.chart.vue @@ -46,7 +46,7 @@ export default Vue.extend({ props: ['data'], data() { return { - viewBoxX: 140, + viewBoxX: 147, viewBoxY: 60, zoom: 1, pos: 0, diff --git a/src/client/app/desktop/views/components/activity.vue b/src/client/app/desktop/views/components/activity.vue index 7bb942ac09..2cac125041 100644 --- a/src/client/app/desktop/views/components/activity.vue +++ b/src/client/app/desktop/views/components/activity.vue @@ -48,7 +48,7 @@ export default Vue.extend({ this.$root.api('charts/user/notes', { userId: this.user.id, span: 'day', - limit: 7 * 20 + limit: 7 * 21 }).then(activity => { this.activity = activity.diffs.normal.map((_, i) => ({ total: activity.diffs.normal[i] + activity.diffs.reply[i] + activity.diffs.renote[i], From 3c1192d6bf76444b4d9204612c9c5300c16919d0 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 21 Jul 2019 20:27:43 +0900 Subject: [PATCH 2/3] Unignore .vscode/extensions.json (#5208) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9ccb36a9ee..e438ad890c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Visual Studio Code /.vscode +!/.vscode/extensions.json # Intelij-IDEA /.idea From 8b5104d56473ce0f5ee8319f93d61f3f5cb907a0 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 21 Jul 2019 21:57:15 +0900 Subject: [PATCH 3/3] Update deprecated vscode extension (#5209) --- .vscode/extensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 36cfce106e..40b781b552 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,10 +2,10 @@ "recommendations": [ "ducksoupdev.vue2", "editorconfig.editorconfig", - "eg2.tslint", "eg2.vscode-npm-script", "hollowtree.vue-snippets", "ms-vscode.typescript-javascript-grammar", + "ms-vscode.vscode-typescript-tslint-plugin", "octref.vetur", "sysoev.language-stylus" ]