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
This commit is contained in:
@@ -987,6 +987,18 @@ celerity_register_resource_map(array(
|
||||
),
|
||||
'disk' => '/rsrc/js/application/differential/behavior-show-all-comments.js',
|
||||
),
|
||||
'javelin-behavior-differential-show-field-details' =>
|
||||
array(
|
||||
'uri' => '/res/1dfd4d10/rsrc/js/application/differential/behavior-show-field-details.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
0 => 'javelin-behavior',
|
||||
1 => 'javelin-stratcom',
|
||||
2 => 'javelin-dom',
|
||||
),
|
||||
'disk' => '/rsrc/js/application/differential/behavior-show-field-details.js',
|
||||
),
|
||||
'javelin-behavior-differential-show-more' =>
|
||||
array(
|
||||
'uri' => '/res/e92c5272/rsrc/js/application/differential/behavior-show-more.js',
|
||||
|
||||
@@ -52,6 +52,8 @@ final class DifferentialLintFieldSpecification
|
||||
$lmsg = DifferentialRevisionUpdateHistoryView::getDiffLintMessage($diff);
|
||||
$ldata = $this->getDiffProperty('arc:lint');
|
||||
$ltail = null;
|
||||
$have_details = false;
|
||||
|
||||
if ($ldata) {
|
||||
$ldata = igroup($ldata, 'path');
|
||||
$lint_messages = array();
|
||||
@@ -78,11 +80,20 @@ final class DifferentialLintFieldSpecification
|
||||
),
|
||||
$line_link);
|
||||
}
|
||||
if ($description != '') {
|
||||
$have_details = true;
|
||||
}
|
||||
$message_markup[] = hsprintf(
|
||||
'<li>'.
|
||||
'<span class="lint-severity-%s">%s</span> (%s) %s '.
|
||||
'at line '.$line_link.
|
||||
'<p>%s</p>'.
|
||||
javelin_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'sigil' => 'differential-field-detail',
|
||||
'style' => 'display: none;',
|
||||
),
|
||||
'%s').
|
||||
'</li>',
|
||||
$severity,
|
||||
ucwords($severity),
|
||||
@@ -106,6 +117,17 @@ final class DifferentialLintFieldSpecification
|
||||
'</div>';
|
||||
}
|
||||
|
||||
Javelin::initBehavior('differential-show-field-details');
|
||||
if ($have_details) {
|
||||
$lmsg .= ' - '.javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#details',
|
||||
'sigil' => 'differential-show-field-details',
|
||||
),
|
||||
'Details');
|
||||
}
|
||||
|
||||
return $lstar.' '.$lmsg.$ltail;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
phutil_require_module('phabricator', 'applications/differential/field/specification/base');
|
||||
phutil_require_module('phabricator', 'applications/differential/view/revisionupdatehistory');
|
||||
phutil_require_module('phabricator', 'infrastructure/javelin/api');
|
||||
phutil_require_module('phabricator', 'infrastructure/javelin/markup');
|
||||
|
||||
phutil_require_module('phutil', 'markup');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
@@ -53,6 +53,7 @@ final class DifferentialUnitFieldSpecification
|
||||
$postponed_count = 0;
|
||||
$udata = $this->getDiffProperty('arc:unit');
|
||||
$utail = null;
|
||||
$have_details = false;
|
||||
|
||||
if ($udata) {
|
||||
$unit_messages = array();
|
||||
@@ -66,6 +67,10 @@ final class DifferentialUnitFieldSpecification
|
||||
$userdata = phutil_utf8_shorten(idx($test, 'userdata'), 512);
|
||||
$userdata = $engine->markupText($userdata);
|
||||
|
||||
if ($userdata != '') {
|
||||
$have_details = true;
|
||||
}
|
||||
|
||||
$unit_messages[] =
|
||||
'<li>'.
|
||||
'<span class="unit-result-'.phutil_escape_html($result).'">'.
|
||||
@@ -73,7 +78,13 @@ final class DifferentialUnitFieldSpecification
|
||||
'</span>'.
|
||||
' '.
|
||||
phutil_escape_html($name).
|
||||
'<p>'.$userdata.'</p>'.
|
||||
javelin_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'sigil' => 'differential-field-detail',
|
||||
'style' => 'display: none;',
|
||||
),
|
||||
$userdata).
|
||||
'</li>';
|
||||
|
||||
} else if ($result == DifferentialUnitTestResult::RESULT_POSTPONED) {
|
||||
@@ -98,6 +109,17 @@ final class DifferentialUnitFieldSpecification
|
||||
$umsg = $postponed_count.' '.$umsg;
|
||||
}
|
||||
|
||||
Javelin::initBehavior('differential-show-field-details');
|
||||
if ($have_details) {
|
||||
$umsg .= ' - '.javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#details',
|
||||
'sigil' => 'differential-show-field-details',
|
||||
),
|
||||
'Details');
|
||||
}
|
||||
|
||||
return $ustar.' '.$umsg.$utail;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ phutil_require_module('phabricator', 'applications/differential/constants/unitte
|
||||
phutil_require_module('phabricator', 'applications/differential/field/specification/base');
|
||||
phutil_require_module('phabricator', 'applications/differential/view/revisionupdatehistory');
|
||||
phutil_require_module('phabricator', 'applications/markup/engine');
|
||||
phutil_require_module('phabricator', 'infrastructure/javelin/api');
|
||||
phutil_require_module('phabricator', 'infrastructure/javelin/markup');
|
||||
|
||||
phutil_require_module('phutil', 'markup');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
Reference in New Issue
Block a user