Skip to content

Commit

Permalink
Adding Cycle and Wait Times
Browse files Browse the repository at this point in the history
  • Loading branch information
kevPo committed Nov 2, 2016
1 parent 4c78061 commit 2e67464
Show file tree
Hide file tree
Showing 27 changed files with 4,621 additions and 359 deletions.
13 changes: 13 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ module.exports = function (grunt) {
}
},
},
karma: {
options: {
configFile: 'karma.conf.js',
},
debug: {
browsers: ['Chrome'],
singleRun: false,
}
},
less: {
production: {
options: {
Expand Down Expand Up @@ -45,4 +54,8 @@ module.exports = function (grunt) {

grunt.registerTask('compile-less-dev', ['watch:less']);
grunt.registerTask('compile-less', ['less']);
grunt.registerTask('unit', [], function () {
grunt.loadNpmTasks('grunt-karma');
grunt.task.run('karma:debug');
});
};
10 changes: 8 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@ module.exports = function(config) {

// list of files / patterns to load in the browser
files: [
'lib/public/public/**/*.js',
'lib/static/static/js/vendor/jquery-1.11.0.min.js',
'lib/static/static/js/vendor/angular.min.js',
'lib/static/static/js/vendor/angular-mocks.js',
'lib/static/static/js/vendor/angular-route.min.js',
'lib/static/static/js/app.js',
'lib/static/static/js/**/*.js',
'tests/**/*.js'
],


// list of files to exclude
exclude: [
'lib/public/public/js/vendor/*'
'lib/public/public/js/vendor/*',
'tests/integration/*'
],


Expand Down
66 changes: 57 additions & 9 deletions lib/github/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,70 @@
var express = require('express');
var request = require('request');
var cache = require('memory-cache');

var app = module.exports = express();

app.get('/githubEvents/:issue', function(req, res) {
var eventData = [];

var issue = req.params.issue;
var path = req.query.path;
delete req.query["path"];
var eventKey = 'events_' + issue;

function getData(pageCounter) {
var url = 'https://api.github.com' + path + '?page=' + pageCounter;
request({
method: 'GET',
url: url,
qs: req.query,
headers: {
'Accept': 'application/vnd.github.v3+json',
'Authorization': 'token ' + req.session.access_token,
'User-Agent': 'Huburn'
},
json: true
},
function (error, response, body) {
if(!error && response.statusCode === 200) {
for(var eventIndex = 0; eventIndex < body.length; eventIndex++)
eventData.push(body[eventIndex]);

if(body.length < 30) {
cache.put(eventKey, eventData, 360000);
res.send(eventData);
}
else {
getData(pageCounter + 1);
}
}
});
};

var event = cache.get(eventKey);

if (event)
res.send(event);
else
getData(1);
});

app.get('/github', function(req, res) {
var path = req.query.path;
delete req.query["path"];

request({
method: 'GET',
url: 'https://api.github.com' + path,
qs: req.query,
headers: {
'Accept': 'application/vnd.github.v3+json',
'Authorization': 'token ' + req.session.access_token,
'User-Agent': 'Huburn'
}
}).pipe(res);
method: 'GET',
url: 'https://api.github.com' + path,
qs: req.query,
headers: {
'Accept': 'application/vnd.github.v3+json',
'Authorization': 'token ' + req.session.access_token,
'User-Agent': 'Huburn'
}
}, function (error, response, body) {
res.send(body);
});
});

app.get('/github-patch', function(req, res) {
Expand Down
102 changes: 96 additions & 6 deletions lib/static/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,100 @@ h1 {
text-align: center;
}

.centered-container {
margin: 0;
padding: 0;
color: @gray;
display: flex;
justify-content: center;
align-items: flex-end;
flex-wrap: wrap;
font-family: "HelveticaNeue-CondensedBold", "Helvetica Neue", "Arial Narrow", Arial, sans-serif;
text-transform: uppercase;
}

.space-between-container {
margin: 0;
margin-top: 20px;
padding: 0;
color: @gray;
display: flex;
align-items: flex-end;
justify-content: space-around;
flex-wrap: wrap;
font-family: "HelveticaNeue-CondensedBold", "Helvetica Neue", "Arial Narrow", Arial, sans-serif;
text-transform: uppercase;
}

.cycle-time-main {
text-align: center;
margin-bottom: 30px;
width: 225px;
>.cycle-time-value {
font-size: 8em;
margin-bottom: -25px;
}
}

.cycle-time-sub {
text-align: center;
margin-bottom: 30px;
width: 225px;
>.cycle-time-value {
font-size: 6em;
letter-spacing: 0;
margin-bottom: -15px;
}
}

.cycle-time {
background: @gray;
width: 225px;
height: 225px;
@media only screen and (max-width: 768px) {
margin-top: 10px;
}
padding-top: 1%;
color: white;
text-align: center;
letter-spacing: 1px;
position: relative;
}

.metric-heading {
font-size: 1.6em;
}

.sub-text {
font-size: 1em;
margin-top: -15px;
text-transform: uppercase;
}

.metric-sub {
background-color: #99CC00;
display: flex;
justify-content: center;
align-items: center;
height: 40px;
font-size: 1.8em;
position: absolute;
bottom: 0;
width: 225px;
>.sub-text {
margin: 0;
font-size: .6em;
margin-left: 10px;
text-transform: uppercase;
}
}

.metric-sub > .glyphicon {
margin-left: .5em;
line-height: 0;
top: 0;
}

.link-text {
font-size: 50px;
@media only screen and (max-width: 1200px) {
Expand Down Expand Up @@ -373,22 +467,18 @@ a:focus {
width: 190px;
}

.effort-distribution {
margin-bottom: 15px;
}

.donut {
display: inline-block;
height: 99px;
line-height: 15px;
margin: 8px;
text-align: center;
vertical-align: top;
width: 90px;
width: 95px;
}

path.color0 {
fill: @green;
fill: #99CC00;
}

path.color1 {
Expand Down
11 changes: 9 additions & 2 deletions lib/static/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
<ul class="nav navbar-nav navbar-right">
<li><a href="/repositories">Repositories</a>
</li>
<li ng-show="repo.length > 0"><a href="/burndown/{{repo}}">Burndown</a>
</li>
<li ng-show="repo.length > 0"><a href="/burnup/{{repo}}">Burnup</a>
</li>
<li ng-show="repo.length > 0"><a href="/availability/{{repo}}">Availability Calculator</a>
<li ng-show="repo.length > 0"><a href="/metrics/{{repo}}">Metrics</a>
</li>
<li ng-show="repo.length > 0"><a href="/burndown/{{repo}}">Burndown</a>
<li ng-show="repo.length > 0"><a href="/availability/{{repo}}">Availability Calculator</a>
</li>
<li><a href="https://github.com/Qualtrax/huburn">Huburn on GitHub</a>
</li>
Expand All @@ -57,8 +59,13 @@
<script src="js/burnupCalculator.js"></script>
<script src="js/velocityMetrics.js"></script>
<script src='js/services/gitHubService.js'></script>
<script src="js/services/cycleTimeService.js"></script>
<script src="js/services/metricService.js"></script>
<script src="js/services/issueService.js"></script>
<script src="js/services/dateService.js"></script>
<script src="js/controllers/burndownCtrl.js"></script>
<script src="js/controllers/burnupCtrl.js"></script>
<script src="js/controllers/metricsCtrl.js"></script>
<script src="js/controllers/repositoriesCtrl.js"></script>
<script src="js/controllers/availabilityCtrl.js"></script>
<script src="js/directives/huburnLoading.js"></script>
Expand Down
Loading

0 comments on commit 2e67464

Please sign in to comment.