-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.user.js
More file actions
55 lines (44 loc) · 1.78 KB
/
Copy pathinstall.user.js
File metadata and controls
55 lines (44 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// ==UserScript==
// @name SM - Toggl time chart for GitHub issues
// @description Aggregate logged time from Toggl and display it on GitHub issues.
// @author Spreadmonitor
// @namespace spreadmonitor
// @website https://github.com/spreadmonitor-playground/github-logged-time
// @iconURL https://spreadmonitor.com/assets/logo.svg
// @version 0.8
// @downloadURL https://cdn.jsdelivr.net/gh/spreadmonitor-playground/github-logged-time@latest/src/install.user.js
// @noframes
// @run-at document-end
// @match https://github.com/**/issues/*
// @connect toggl.com
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @require https://canvasjs.com/assets/script/canvasjs.min.js
// @require https://cdn.jsdelivr.net/gh/spreadmonitor-playground/github-logged-time@0.8.0/src/add_style.js
// @require https://cdn.jsdelivr.net/gh/spreadmonitor-playground/github-logged-time@0.8.0/src/main.js
// ==/UserScript==
(function () {
'use strict';
/**
* Your personal Toggl API key from https://toggl.com/app/profile.
* @type { string | null }
*/
const togglApiKey = null;
/**
* A mapper object for pairing Github project names to Toggl project IDs.
*
* Note: One Github project maybe tracked in multiple Toggl projects. This scenario allows
* you to have a meta repository on Github where all issues are handled for a customer, but
* the time logging still happens per project basis.
*
* @type {{ [key: string]: number[] }}
*/
const projectIdMap = {};
/**
* A mapper object for pairing Toggle usernames to Github usernames.
*
* @type {{ [key: string] : string }}
*/
const usernameMap = {};
new GithubLoggedTimeChart({ togglApiKey, projectIdMap, usernameMap });
})();