Show a question mark near bugs that could be tracked
This commit is contained in:
Родитель
ec834b7f4a
Коммит
a171af8176
45
dash.js
45
dash.js
|
@ -50,22 +50,22 @@ function prettyDate(date) {
|
|||
date = new Date(date);
|
||||
let today = new Date();
|
||||
|
||||
var hoursDiff = Math.round((today.getTime() - date.getTime()) / 3600000);
|
||||
let hoursDiff = Math.round((today.getTime() - date.getTime()) / 3600000);
|
||||
if (hoursDiff < 24) {
|
||||
return agoString(hoursDiff, 'hour');
|
||||
}
|
||||
|
||||
var daysDiff = Math.round((today.getTime() - date.getTime()) / 86400000);
|
||||
let daysDiff = Math.round((today.getTime() - date.getTime()) / 86400000);
|
||||
if (daysDiff < 10) {
|
||||
return agoString(daysDiff, 'day');
|
||||
}
|
||||
|
||||
var weeksDiff = Math.round((today.getTime() - date.getTime()) / (7 * 86400000));
|
||||
let weeksDiff = Math.round((today.getTime() - date.getTime()) / (7 * 86400000));
|
||||
if (weeksDiff < 3) {
|
||||
return agoString(weeksDiff, 'week');
|
||||
}
|
||||
|
||||
var monthsDiff = (today.getMonth() + 12 * today.getFullYear()) - (date.getMonth() + 12 * date.getFullYear());
|
||||
let monthsDiff = (today.getMonth() + 12 * today.getFullYear()) - (date.getMonth() + 12 * date.getFullYear());
|
||||
if (monthsDiff < 12) {
|
||||
return agoString(monthsDiff, 'month');
|
||||
}
|
||||
|
@ -77,44 +77,44 @@ function createGraph(data) {
|
|||
let startDay = data.find(d => d == null) === undefined ? 1 : 2;
|
||||
data = data.filter(d => d != null);
|
||||
|
||||
var margin = {top: 20, right: 20, bottom: 30, left: 50},
|
||||
let margin = {top: 20, right: 20, bottom: 30, left: 50},
|
||||
width = 700 - margin.left - margin.right,
|
||||
height = 200 - margin.top - margin.bottom;
|
||||
|
||||
var x = d3.time.scale()
|
||||
let x = d3.time.scale()
|
||||
.range([0, width]);
|
||||
|
||||
var y = d3.scale.linear()
|
||||
let y = d3.scale.linear()
|
||||
.range([height, 0]);
|
||||
|
||||
var xAxis = d3.svg.axis()
|
||||
let xAxis = d3.svg.axis()
|
||||
.scale(x)
|
||||
.tickFormat(d3.time.format('%d'))
|
||||
.ticks(data.length)
|
||||
.orient('bottom');
|
||||
|
||||
var yAxis = d3.svg.axis()
|
||||
let yAxis = d3.svg.axis()
|
||||
.scale(y)
|
||||
.orient('left');
|
||||
|
||||
var line = d3.svg.line()
|
||||
let line = d3.svg.line()
|
||||
.x(function(d, i) {
|
||||
var date = new Date();
|
||||
let date = new Date();
|
||||
date.setHours(0, 0, 0, 0);
|
||||
date.setDate(date.getDate() - startDay - i);
|
||||
return x(date);
|
||||
})
|
||||
.y(function(d, i) { return y(d); });
|
||||
|
||||
var svgElem = document.createElementNS(d3.ns.prefix.svg, 'svg');
|
||||
var svg = d3.select(svgElem)
|
||||
let svgElem = document.createElementNS(d3.ns.prefix.svg, 'svg');
|
||||
let svg = d3.select(svgElem)
|
||||
.attr('width', width + margin.left + margin.right)
|
||||
.attr('height', height + margin.top + margin.bottom)
|
||||
.append('g')
|
||||
.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
||||
|
||||
x.domain(d3.extent(data, function(d, i) {
|
||||
var date = new Date();
|
||||
let date = new Date();
|
||||
date.setHours(0, 0, 0, 0);
|
||||
date.setDate(date.getDate() - startDay - i);
|
||||
return date;
|
||||
|
@ -138,8 +138,12 @@ function createGraph(data) {
|
|||
return svgElem;
|
||||
}
|
||||
|
||||
function getVersion() {
|
||||
return Number(crashes.versions[0].substring(0, crashes.versions[0].indexOf('.')));
|
||||
}
|
||||
|
||||
function getFixedIn(bug) {
|
||||
let version = Number(crashes.versions[0].substring(0, crashes.versions[0].indexOf('.')));
|
||||
let version = getVersion();
|
||||
|
||||
if (bug['cf_status_firefox' + version] != '' &&
|
||||
bug['cf_status_firefox' + version] != 'affected') {
|
||||
|
@ -227,6 +231,17 @@ function addRow(signature, obj) {
|
|||
bugs.appendChild(exclamationMark);
|
||||
}
|
||||
|
||||
if (bug['cf_tracking_firefox' + getVersion()] !== '+' &&
|
||||
(bug.resolution === '' || fixedIn.length > 0)) {
|
||||
let questionMark = document.createElement('img');
|
||||
questionMark.title = 'TRACK?';
|
||||
questionMark.src = 'question_mark.svg';
|
||||
questionMark.width = 16;
|
||||
questionMark.height = 16;
|
||||
|
||||
bugs.appendChild(questionMark);
|
||||
}
|
||||
|
||||
bugs.appendChild(document.createElement('br'));
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" ?><svg height="16px" version="1.1" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><defs/><g fill="none" fill-rule="evenodd" id="Icons with numbers" stroke="none" stroke-width="1"><g fill="#000000" id="Group" transform="translate(-48.000000, -432.000000)"><path d="M54.8796844,443.0591 L54.8796844,445 L57.2307692,445 L57.2307692,443.0591 Z M56,448 C51.5817218,448 48,444.418278 48,440 C48,435.581722 51.5817218,432 56,432 C60.4182782,432 64,435.581722 64,440 C64,444.418278 60.4182782,448 56,448 Z M53.5700197,435.51041 C52.5864514,436.043208 52.0631167,436.947609 52,438.22364 L54.2800789,438.22364 C54.2800789,437.852024 54.4076253,437.493845 54.6627219,437.149093 C54.9178185,436.804341 55.3504243,436.631968 55.9605523,436.631968 C56.5811997,436.631968 57.0085458,436.771881 57.2426036,437.051713 C57.4766613,437.331544 57.5936884,437.641592 57.5936884,437.981867 C57.5936884,438.277369 57.4884955,438.548241 57.2781065,438.794493 L56.8205128,439.190732 L56.2445759,439.573539 C55.6765258,439.949633 55.3241295,440.282067 55.1873767,440.570853 C55.0506239,440.859639 54.9664696,441.382356 54.9349112,442.139019 L57.0650888,442.139019 C57.0703485,441.780835 57.1045362,441.516679 57.1676529,441.346541 C57.2675876,441.077903 57.4700839,440.842849 57.7751479,440.64137 L58.3353057,440.271995 C58.9033559,439.895901 59.28731,439.586972 59.4871795,439.345198 C59.8290615,438.946718 60,438.456461 60,437.874412 C60,436.925225 59.6068415,436.208867 58.8205128,435.725319 C58.0341841,435.241771 57.0466858,435 55.8579882,435 C54.9533157,435 54.1906671,435.170135 53.5700197,435.51041 Z M53.5700197,435.51041" id="Oval 318"/></g></g></svg>
|
После Ширина: | Высота: | Размер: 1.7 KiB |
Загрузка…
Ссылка в новой задаче