@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove the legacy chart behavior from Maniphest

Summary: Depends on D20486. Ref T13279. Now that the "Reports" UI uses a panel to draw a real chart from Facts, throw away the copy of the old code.

Test Plan: `grep`

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13279

Differential Revision: https://secure.phabricator.com/D20487

-134
-8
resources/celerity/map.php
··· 398 398 'rsrc/js/application/herald/PathTypeahead.js' => 'ad486db3', 399 399 'rsrc/js/application/herald/herald-rule-editor.js' => '0922e81d', 400 400 'rsrc/js/application/maniphest/behavior-batch-selector.js' => '139ef688', 401 - 'rsrc/js/application/maniphest/behavior-line-chart-legacy.js' => 'faf3ab6b', 402 401 'rsrc/js/application/maniphest/behavior-line-chart.js' => 'ad258e28', 403 402 'rsrc/js/application/maniphest/behavior-list-edit.js' => 'c687e867', 404 403 'rsrc/js/application/owners/OwnersPathEditor.js' => '2a8b62d9', ··· 628 627 'javelin-behavior-launch-icon-composer' => 'a17b84f1', 629 628 'javelin-behavior-lightbox-attachments' => 'c7e748bf', 630 629 'javelin-behavior-line-chart' => 'ad258e28', 631 - 'javelin-behavior-line-chart-legacy' => 'faf3ab6b', 632 630 'javelin-behavior-linked-container' => '74446546', 633 631 'javelin-behavior-maniphest-batch-selector' => '139ef688', 634 632 'javelin-behavior-maniphest-list-editor' => 'c687e867', ··· 2181 2179 ), 2182 2180 'fa74cc35' => array( 2183 2181 'phui-oi-list-view-css', 2184 - ), 2185 - 'faf3ab6b' => array( 2186 - 'javelin-behavior', 2187 - 'javelin-dom', 2188 - 'javelin-vector', 2189 - 'phui-chart-css', 2190 2182 ), 2191 2183 'fcb0c07d' => array( 2192 2184 'phui-chart-css',
-126
webroot/rsrc/js/application/maniphest/behavior-line-chart-legacy.js
··· 1 - /** 2 - * @provides javelin-behavior-line-chart-legacy 3 - * @requires javelin-behavior 4 - * javelin-dom 5 - * javelin-vector 6 - * phui-chart-css 7 - */ 8 - 9 - JX.behavior('line-chart-legacy', function(config) { 10 - 11 - function fn(n) { 12 - return n + '(' + JX.$A(arguments).slice(1).join(', ') + ')'; 13 - } 14 - 15 - var h = JX.$(config.hardpoint); 16 - var d = JX.Vector.getDim(h); 17 - 18 - var padding = { 19 - top: 24, 20 - left: 48, 21 - bottom: 48, 22 - right: 32 23 - }; 24 - 25 - var size = { 26 - frameWidth: d.x, 27 - frameHeight: d.y, 28 - }; 29 - 30 - size.width = size.frameWidth - padding.left - padding.right; 31 - size.height = size.frameHeight - padding.top - padding.bottom; 32 - 33 - var x = d3.time.scale() 34 - .range([0, size.width]); 35 - 36 - var y = d3.scale.linear() 37 - .range([size.height, 0]); 38 - 39 - var xAxis = d3.svg.axis() 40 - .scale(x) 41 - .orient('bottom'); 42 - 43 - var yAxis = d3.svg.axis() 44 - .scale(y) 45 - .orient('left'); 46 - 47 - var svg = d3.select('#' + config.hardpoint).append('svg') 48 - .attr('width', size.frameWidth) 49 - .attr('height', size.frameHeight) 50 - .attr('class', 'chart'); 51 - 52 - var g = svg.append('g') 53 - .attr('transform', fn('translate', padding.left, padding.top)); 54 - 55 - g.append('rect') 56 - .attr('class', 'inner') 57 - .attr('width', size.width) 58 - .attr('height', size.height); 59 - 60 - var line = d3.svg.line() 61 - .x(function(d) { return x(d.date); }) 62 - .y(function(d) { return y(d.count); }); 63 - 64 - var data = []; 65 - for (var ii = 0; ii < config.x[0].length; ii++) { 66 - data.push( 67 - { 68 - date: new Date(config.x[0][ii] * 1000), 69 - count: +config.y[0][ii] 70 - }); 71 - } 72 - 73 - x.domain(d3.extent(data, function(d) { return d.date; })); 74 - 75 - var yex = d3.extent(data, function(d) { return d.count; }); 76 - yex[0] = 0; 77 - yex[1] = yex[1] * 1.05; 78 - y.domain(yex); 79 - 80 - g.append('path') 81 - .datum(data) 82 - .attr('class', 'line') 83 - .attr('d', line); 84 - 85 - g.append('g') 86 - .attr('class', 'x axis') 87 - .attr('transform', fn('translate', 0, size.height)) 88 - .call(xAxis); 89 - 90 - g.append('g') 91 - .attr('class', 'y axis') 92 - .attr('transform', fn('translate', 0, 0)) 93 - .call(yAxis); 94 - 95 - var div = d3.select('body') 96 - .append('div') 97 - .attr('class', 'chart-tooltip') 98 - .style('opacity', 0); 99 - 100 - g.selectAll('dot') 101 - .data(data) 102 - .enter() 103 - .append('circle') 104 - .attr('class', 'point') 105 - .attr('r', 3) 106 - .attr('cx', function(d) { return x(d.date); }) 107 - .attr('cy', function(d) { return y(d.count); }) 108 - .on('mouseover', function(d) { 109 - var d_y = d.date.getFullYear(); 110 - 111 - // NOTE: Javascript months are zero-based. See PHI1017. 112 - var d_m = d.date.getMonth() + 1; 113 - 114 - var d_d = d.date.getDate(); 115 - 116 - div 117 - .html(d_y + '-' + d_m + '-' + d_d + ': ' + d.count) 118 - .style('opacity', 0.9) 119 - .style('left', (d3.event.pageX - 60) + 'px') 120 - .style('top', (d3.event.pageY - 38) + 'px'); 121 - }) 122 - .on('mouseout', function() { 123 - div.style('opacity', 0); 124 - }); 125 - 126 - });