Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Layout changes. Now showing actual bugs. Added third party sites.

  • Loading branch information...
commit 5a823fcabbfd5e52d735530097e07d0c866de1d8 1 parent c17a447
Stefan Arentz authored

Showing 2 changed files with 68 additions and 11 deletions. Show diff stats Hide diff stats

  1. +24 0 index.html
  2. +44 11 index.js
24 index.html
@@ -41,6 +41,7 @@ <h2 class="form-signin-heading">Please sign in</h2>
41 41
42 42 <div ng-controller="PageController" ng-show="ready && loggedIn">
43 43
  44 +
44 45 <div class="navbar navbar-inverse navbar-fixed-top">
45 46 <div class="navbar-inner">
46 47 <div class="container">
@@ -81,6 +82,9 @@ <h2 class="form-signin-heading">Please sign in</h2>
81 82 <li ng-class="{active: filterName == 'mofo'}">
82 83 <a href="#" ng-click="filter('mofo')">MoFo Sites</a>
83 84 </li>
  85 + <li ng-class="{active: filterName == 'thirdparty'}">
  86 + <a href="#" ng-click="filter('thirdparty')">Third-Party Sites</a>
  87 + </li>
84 88 </ul>
85 89
86 90 <ul class="nav nav-pills pull-right">
@@ -94,7 +98,26 @@ <h2 class="form-signin-heading">Please sign in</h2>
94 98 <a href="#" ng-click="sort('name')">Sort by Name</a>
95 99 </li>
96 100 </ul>
  101 + </div>
  102 +
  103 + <div ng-show="!loading" class="container">
  104 +
  105 + <h3>Showing {{sites.length}} sites with {{sitesBugCount}} unresolved web security bugs :-(</h3>
  106 +
  107 + <div ng-repeat="site in sites">
  108 + <h4 style="text-overflow: hidden; text-transform:uppercase;" class="site-title-big">#{{$index+1}} {{site.name}} <span class="label label-{{site.averageAgeLabel}} pull-right">{{site.averageAge}} days</span> </h4>
  109 + <ul style="list-style: none;">
  110 + <li ng-repeat="bug in site.bugs">
  111 + <span style="width: 30px; margin-right: 6px; text-align: center;" class="label label-{{bug.shortStatusColor}}">{{bug.shortStatus}}</span>
  112 + <a href="https://bugzilla.mozilla.org/show_bug.cgi?id={{bug.id}}" target="_blank">
  113 + <span class="bug-{{bug.status}}">{{bug.id}} {{bug.summary}}</span>
  114 + </a>
  115 + </li>
  116 + </ul>
  117 + </div>
  118 +
97 119
  120 +<!--
98 121 <table ng-show="!loading" class="table table-striped">
99 122 <thead>
100 123 <tr>
@@ -113,6 +136,7 @@ <h2 class="form-signin-heading">Please sign in</h2>
113 136 <td><span class="label label-{{site.averageAgeLabel}}">{{site.averageAge}} days</span></td>
114 137 </tr>
115 138 </table>
  139 +-->
116 140 </div>
117 141 </div>
118 142
55 index.js
... ... @@ -1,4 +1,3 @@
1   -
2 1 var app = angular.module('blockers', []);
3 2
4 3 app.run(function($rootScope, sessionService, bugzillaService) {
@@ -200,6 +199,7 @@ app.controller('PageController', function ($scope, $http, bugzillaService) {
200 199
201 200 $scope.bugs = [];
202 201 $scope.sites = {};
  202 + $scope.sitesBugCount = 0;
203 203 $scope.projectReviewBugs = [];
204 204 $scope.blockingBugs = {};
205 205
@@ -214,10 +214,18 @@ app.controller('PageController', function ($scope, $http, bugzillaService) {
214 214
215 215 const MOCO_SITES = ["www.mozilla.com", "plugins.mozilla.org", "forums.mozilla.org", "addons.mozilla.org", "developer.mozilla.org", "vreplay.mozilla.com"];
216 216 const MOFO_SITES = ["www.drumbeat.org", "donate.mozilla.org", "thimble.webmaker.org", "2011.mozillafestival.org", "popcorn.webmadecontent.org", "popcorn.webmaker.org"];
  217 + const THIRD_PARTY_SITES = ["vreplay.mozilla.org"];
217 218
218 219 $scope.filterName = "all";
219 220 $scope.sortName = "count";
220 221
  222 + var countTotalBugs = function() {
  223 + return _.chain($scope.sites)
  224 + .map(function (site) {return site.new + site.unconfirmed;})
  225 + .reduce(function (memo, num) {return memo + num;}, 0)
  226 + .value();
  227 + };
  228 +
221 229 $scope.filter = function(what) {
222 230 $scope.filterName = what;
223 231
@@ -234,8 +242,12 @@ app.controller('PageController', function ($scope, $http, bugzillaService) {
234 242 $scope.sites = _.filter($scope.allSites, function(site) {return MOFO_SITES.indexOf(site.name) != -1;});
235 243 break;
236 244 }
  245 + case "thirdparty": {
  246 + $scope.sites = _.filter($scope.allSites, function(site) {return THIRD_PARTY_SITES.indexOf(site.name) != -1;});
  247 + }
237 248 }
238 249
  250 + $scope.sitesBugCount = countTotalBugs();
239 251 $scope.sort($scope.sortName);
240 252 };
241 253
@@ -263,7 +275,7 @@ app.controller('PageController', function ($scope, $http, bugzillaService) {
263 275 // First we get the project review bugs
264 276
265 277 var options = {
266   - include_fields:"id,creation_time,summary,status,whiteboard",
  278 + include_fields:"id,creation_time,summary,status,resolution,whiteboard",
267 279 advanced: [["status_whiteboard", "substring", "[site:"], ["bug_group", "substring", "websites-security"]]
268 280 };
269 281
@@ -280,20 +292,41 @@ app.controller('PageController', function ($scope, $http, bugzillaService) {
280 292 $scope.bugs = data.bugs;
281 293 $scope.loading = false;
282 294
  295 + var shortStatus = function(bug) {
  296 + switch (bug.status) {
  297 + case "UNCONFIRMED":
  298 + return {status: "UNC", color: "info"};
  299 + case "NEW":
  300 + return {status: "NEW", color: "info"};
  301 + case "RESOLVED":
  302 + return {status: bug.resolution.substr(0,3), color: "default"};
  303 + case "VERIFIED":
  304 + return {status: bug.resolution.substr(0,3), color: "default"};
  305 + case "REOPENED":
  306 + return {status: "NEW", color: "info"};
  307 + case "ASSIGNED":
  308 + return {status: "ASS", color: "info"};
  309 + }
  310 + return {status: "UNK", color: "default"};
  311 + };
  312 +
283 313 // Loop over all bugs and group sites
284 314
285 315 var sites = {};
286 316 _.each($scope.bugs, function(bug) {
287   - bugzillaService.cleanupBug(bug);
288   - _.each(parseSites(bug['whiteboard']), function (site) {
289   - if (!sites[site]) {
290   - sites[site] = {name:site,unconfirmed:0,resolved:0,new:0,verified:0,averageAge:0};
291   - }
292   - sites[site][bug.status.toLowerCase()]++;
293   - if (bug.status === 'UNCONFIRMED' || bug.status === 'NEW') {
  317 + if (bug.status === 'UNCONFIRMED' || bug.status === 'NEW' || bug.status === "REOPENED" || bug.status == "ASSIGNED") {
  318 + bugzillaService.cleanupBug(bug);
  319 + bug.shortStatus = shortStatus(bug).status;
  320 + bug.shortStatusColor = shortStatus(bug).color;
  321 + _.each(parseSites(bug['whiteboard']), function (site) {
  322 + if (!sites[site]) {
  323 + sites[site] = {name:site,unconfirmed:0,resolved:0,new:0,verified:0,averageAge:0,bugs:[]};
  324 + }
  325 + sites[site].bugs.push(bug);
  326 + sites[site][bug.status.toLowerCase()]++;
294 327 sites[site].averageAge += bug.age;
295   - }
296   - });
  328 + });
  329 + }
297 330 });
298 331
299 332 _.each(sites, function(site) {

0 comments on commit 5a823fc

Please sign in to comment.
Something went wrong with that request. Please try again.