Add Github-Projects integration & support for task weighting#1
Add Github-Projects integration & support for task weighting#1markusheilig wants to merge 7 commits intoSengitU:masterfrom
Conversation
…jects cards since "github-api" supports pagination
SengitU
left a comment
There was a problem hiding this comment.
Hey @markusheilig ,
Thanks for taking your time to make this project more generic. We can also change the name of the project if you like. (Company names should never be in the project's name anyways :) )
I left some comments, but they're mostly about the syntactic sugar, feel free merge this with or without applying the destructuring changes. As I said, they're just syntactic sugar.
src/services/gh-projects.js
Outdated
|
|
||
| const fetchAllIssues = () => { | ||
| const headers = createAuthorizedHttpHeader(); | ||
| const issuesUrl = `${getGithubApiUrl()}/repos/mheilig/apprenticeship/issues`; |
There was a problem hiding this comment.
I would also recommend get this URL via environmental variable.
There was a problem hiding this comment.
I just realized, at the 6th commit or so you found a better way to do it! :)
src/services/gh-projects.js
Outdated
| return Promise.all([fetchAllIssues(), fetchDoneCards()]) | ||
| .then((values) => { | ||
| const allIssues = values[0]; | ||
| const doneCards = values[1]; |
There was a problem hiding this comment.
There are some shorthand notations you can use here. They are optional to use but in my opinion they make it easier to read. const [ allIssues, doneCards ] = values; will apply assign first element of the values to the allIssues and the second element to the doneCards.
You can also use this notation (note that this might be harder to see sometimes), .then(([ allIssues, doneCards ]) => {....
There was a problem hiding this comment.
Check out destructuring in es6katas for more about this: http://es6katas.org/
This PR contains two main features:
Integration for Github-Projects
You can visualize a Github-Projects board by configuring your github data via env-variables (see README.md) and append the http query parameter boardType=githubProjects to the url. In case the user decides to display a Github-Projects board, the header is also updated from "Data Visualisation Over Trello Board" to "Data Visualisation Over Github-Projects Board".
Support for weighting tasks
There are two ways to weight a task. The first one is by adding the label 'L' to a task in which case the task will be counted two times. The second one is by adding the label 'XL' to a task in which case the task will be counted three times. To enable task weighting you have to append the http query parameter weightTasks=true to the url.
Both changes do not affect any other existing behavior.