-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Github-Projects integration & support for task weighting #1
base: master
Are you sure you want to change the base?
Conversation
…jects cards since "github-api" supports pagination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also recommend get this URL via environmental variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.