@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.

Copy the "line-chart" behavior to "line-chart-legacy" to keep "Maniphest > Reports" working

Summary:
Ref T13279. Charting changes alter how the "line-chart" behavior works, but the "Burnup Chart" still relies on the old behavior.

Although I'm intending to remove "Maniphest > Reports" once Facts is a minimally sufficient replacement, copy this behavior to keep it working until we're ready to pull the trigger.

Also fix a leftover typo from D20435.

Test Plan: Viewed a legacy Maniphest burnup rate report.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13279

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

+136 -2
+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', 401 402 'rsrc/js/application/maniphest/behavior-line-chart.js' => 'ad258e28', 402 403 'rsrc/js/application/maniphest/behavior-list-edit.js' => 'c687e867', 403 404 'rsrc/js/application/owners/OwnersPathEditor.js' => '2a8b62d9', ··· 627 628 'javelin-behavior-launch-icon-composer' => 'a17b84f1', 628 629 'javelin-behavior-lightbox-attachments' => 'c7e748bf', 629 630 'javelin-behavior-line-chart' => 'ad258e28', 631 + 'javelin-behavior-line-chart-legacy' => 'faf3ab6b', 630 632 'javelin-behavior-linked-container' => '74446546', 631 633 'javelin-behavior-maniphest-batch-selector' => '139ef688', 632 634 'javelin-behavior-maniphest-list-editor' => 'c687e867', ··· 2179 2181 ), 2180 2182 'fa74cc35' => array( 2181 2183 'phui-oi-list-view-css', 2184 + ), 2185 + 'faf3ab6b' => array( 2186 + 'javelin-behavior', 2187 + 'javelin-dom', 2188 + 'javelin-vector', 2189 + 'phui-chart-css', 2182 2190 ), 2183 2191 'fcb0c07d' => array( 2184 2192 'phui-chart-css',
+1 -1
src/applications/maniphest/controller/ManiphestReportController.php
··· 382 382 require_celerity_resource('d3'); 383 383 require_celerity_resource('phui-chart-css'); 384 384 385 - Javelin::initBehavior('line-chart', array( 385 + Javelin::initBehavior('line-chart-legacy', array( 386 386 'hardpoint' => $id, 387 387 'x' => array( 388 388 $burn_x,
+1 -1
src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
··· 436 436 // We can tell the client what it should check out by making "HEAD" 437 437 // point somewhere. However: 438 438 // 439 - // (1) If we don't set "receive.denyDelteCurrent" to "ignore" and a user 439 + // (1) If we don't set "receive.denyDeleteCurrent" to "ignore" and a user 440 440 // tries to delete the default branch, Git raises an error and refuses. 441 441 // We want to allow this; we already have sufficient protections around 442 442 // dangerous changes and do not need to special case the default branch.
+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 + });