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

Hide lint and unit error details

Summary:
Before: {F10754}

After: {F10753}

Test Plan:
View revision with lint warnings and unit errors.
Click on Details.
Click on Details.
Click on Details.
Click on Details.

Reviewers: asukhachev, epriestley

Reviewed By: epriestley

CC: aran, Koolvin

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

vrana 4cc61687 4f9e5323

+93 -2
+12
src/__celerity_resource_map__.php
··· 987 987 ), 988 988 'disk' => '/rsrc/js/application/differential/behavior-show-all-comments.js', 989 989 ), 990 + 'javelin-behavior-differential-show-field-details' => 991 + array( 992 + 'uri' => '/res/1dfd4d10/rsrc/js/application/differential/behavior-show-field-details.js', 993 + 'type' => 'js', 994 + 'requires' => 995 + array( 996 + 0 => 'javelin-behavior', 997 + 1 => 'javelin-stratcom', 998 + 2 => 'javelin-dom', 999 + ), 1000 + 'disk' => '/rsrc/js/application/differential/behavior-show-field-details.js', 1001 + ), 990 1002 'javelin-behavior-differential-show-more' => 991 1003 array( 992 1004 'uri' => '/res/e92c5272/rsrc/js/application/differential/behavior-show-more.js',
+23 -1
src/applications/differential/field/specification/lint/DifferentialLintFieldSpecification.php
··· 52 52 $lmsg = DifferentialRevisionUpdateHistoryView::getDiffLintMessage($diff); 53 53 $ldata = $this->getDiffProperty('arc:lint'); 54 54 $ltail = null; 55 + $have_details = false; 56 + 55 57 if ($ldata) { 56 58 $ldata = igroup($ldata, 'path'); 57 59 $lint_messages = array(); ··· 78 80 ), 79 81 $line_link); 80 82 } 83 + if ($description != '') { 84 + $have_details = true; 85 + } 81 86 $message_markup[] = hsprintf( 82 87 '<li>'. 83 88 '<span class="lint-severity-%s">%s</span> (%s) %s '. 84 89 'at line '.$line_link. 85 - '<p>%s</p>'. 90 + javelin_render_tag( 91 + 'div', 92 + array( 93 + 'sigil' => 'differential-field-detail', 94 + 'style' => 'display: none;', 95 + ), 96 + '%s'). 86 97 '</li>', 87 98 $severity, 88 99 ucwords($severity), ··· 104 115 implode("\n", $lint_messages). 105 116 '</ul>'. 106 117 '</div>'; 118 + } 119 + 120 + Javelin::initBehavior('differential-show-field-details'); 121 + if ($have_details) { 122 + $lmsg .= ' - '.javelin_render_tag( 123 + 'a', 124 + array( 125 + 'href' => '#details', 126 + 'sigil' => 'differential-show-field-details', 127 + ), 128 + 'Details'); 107 129 } 108 130 109 131 return $lstar.' '.$lmsg.$ltail;
+2
src/applications/differential/field/specification/lint/__init__.php
··· 8 8 9 9 phutil_require_module('phabricator', 'applications/differential/field/specification/base'); 10 10 phutil_require_module('phabricator', 'applications/differential/view/revisionupdatehistory'); 11 + phutil_require_module('phabricator', 'infrastructure/javelin/api'); 12 + phutil_require_module('phabricator', 'infrastructure/javelin/markup'); 11 13 12 14 phutil_require_module('phutil', 'markup'); 13 15 phutil_require_module('phutil', 'utils');
+23 -1
src/applications/differential/field/specification/unit/DifferentialUnitFieldSpecification.php
··· 53 53 $postponed_count = 0; 54 54 $udata = $this->getDiffProperty('arc:unit'); 55 55 $utail = null; 56 + $have_details = false; 56 57 57 58 if ($udata) { 58 59 $unit_messages = array(); ··· 66 67 $userdata = phutil_utf8_shorten(idx($test, 'userdata'), 512); 67 68 $userdata = $engine->markupText($userdata); 68 69 70 + if ($userdata != '') { 71 + $have_details = true; 72 + } 73 + 69 74 $unit_messages[] = 70 75 '<li>'. 71 76 '<span class="unit-result-'.phutil_escape_html($result).'">'. ··· 73 78 '</span>'. 74 79 ' '. 75 80 phutil_escape_html($name). 76 - '<p>'.$userdata.'</p>'. 81 + javelin_render_tag( 82 + 'div', 83 + array( 84 + 'sigil' => 'differential-field-detail', 85 + 'style' => 'display: none;', 86 + ), 87 + $userdata). 77 88 '</li>'; 78 89 79 90 } else if ($result == DifferentialUnitTestResult::RESULT_POSTPONED) { ··· 96 107 if ($postponed_count > 0 && 97 108 $diff->getUnitStatus() == DifferentialUnitStatus::UNIT_POSTPONED) { 98 109 $umsg = $postponed_count.' '.$umsg; 110 + } 111 + 112 + Javelin::initBehavior('differential-show-field-details'); 113 + if ($have_details) { 114 + $umsg .= ' - '.javelin_render_tag( 115 + 'a', 116 + array( 117 + 'href' => '#details', 118 + 'sigil' => 'differential-show-field-details', 119 + ), 120 + 'Details'); 99 121 } 100 122 101 123 return $ustar.' '.$umsg.$utail;
+2
src/applications/differential/field/specification/unit/__init__.php
··· 11 11 phutil_require_module('phabricator', 'applications/differential/field/specification/base'); 12 12 phutil_require_module('phabricator', 'applications/differential/view/revisionupdatehistory'); 13 13 phutil_require_module('phabricator', 'applications/markup/engine'); 14 + phutil_require_module('phabricator', 'infrastructure/javelin/api'); 15 + phutil_require_module('phabricator', 'infrastructure/javelin/markup'); 14 16 15 17 phutil_require_module('phutil', 'markup'); 16 18 phutil_require_module('phutil', 'utils');
+31
webroot/rsrc/js/application/differential/behavior-show-field-details.js
··· 1 + /** 2 + * @provides javelin-behavior-differential-show-field-details 3 + * @requires javelin-behavior 4 + * javelin-stratcom 5 + * javelin-dom 6 + */ 7 + 8 + JX.behavior('differential-show-field-details', function() { 9 + 10 + JX.Stratcom.listen( 11 + 'click', 12 + 'differential-show-field-details', 13 + function(e) { 14 + var node = e.getNode('tag:td'); 15 + var data = JX.Stratcom.getData(node); 16 + var details = JX.DOM.scry( 17 + node, 18 + 'div', 19 + 'differential-field-detail'); 20 + for (var i=0; i < details.length; i++) { 21 + if (!data.detailsShown) { 22 + JX.DOM.show(details[i]); 23 + } else { 24 + JX.DOM.hide(details[i]); 25 + } 26 + } 27 + data.detailsShown = !data.detailsShown; 28 + e.kill(); 29 + }); 30 + 31 + });