mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Various fixes, particularly on the revision update workflow.
This commit is contained in:
parent
8b7755b834
commit
905870d793
26 changed files with 308 additions and 75 deletions
|
@ -15,6 +15,9 @@ $package_spec = array(
|
||||||
'aphront-typeahead-control-css',
|
'aphront-typeahead-control-css',
|
||||||
|
|
||||||
'phabricator-directory-css',
|
'phabricator-directory-css',
|
||||||
|
|
||||||
|
'phabricator-remarkup-css',
|
||||||
|
'syntax-highlighting-css',
|
||||||
),
|
),
|
||||||
'differential.pkg.css' => array(
|
'differential.pkg.css' => array(
|
||||||
'differential-core-view-css',
|
'differential-core-view-css',
|
||||||
|
@ -22,6 +25,16 @@ $package_spec = array(
|
||||||
'differential-revision-detail-css',
|
'differential-revision-detail-css',
|
||||||
'differential-revision-history-css',
|
'differential-revision-history-css',
|
||||||
'differential-table-of-contents-css',
|
'differential-table-of-contents-css',
|
||||||
|
'differential-revision-comment-css',
|
||||||
|
'differential-revision-add-comment-css',
|
||||||
|
'differential-revision-comment-list-css',
|
||||||
|
),
|
||||||
|
'differential.pkg.js' => array(
|
||||||
|
'javelin-behavior-differential-feedback-preview',
|
||||||
|
'javelin-behavior-differential-edit-inline-comments',
|
||||||
|
'javelin-behavior-differential-populate',
|
||||||
|
'javelin-behavior-differential-show-more',
|
||||||
|
'javelin-behavior-differential-diff-radios',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'differential-changeset-view-css' =>
|
'differential-changeset-view-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/4e0295a9/rsrc/css/application/differential/changeset-view.css',
|
'uri' => '/res/8b893b8e/rsrc/css/application/differential/changeset-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -163,7 +163,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'differential-table-of-contents-css' =>
|
'differential-table-of-contents-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/a4a7b2b5/rsrc/css/application/differential/table-of-contents.css',
|
'uri' => '/res/e68f6f05/rsrc/css/application/differential/table-of-contents.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -190,7 +190,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'phabricator-core-css' =>
|
'phabricator-core-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/39ce37c2/rsrc/css/core/core.css',
|
'uri' => '/res/41c62455/rsrc/css/core/core.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -255,7 +255,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-differential-diff-radios' =>
|
'javelin-behavior-differential-diff-radios' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/ea6b0062/rsrc/js/application/differential/behavior-diff-radios.js',
|
'uri' => '/res/fdeb3823/rsrc/js/application/differential/behavior-diff-radios.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -275,7 +275,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-differential-populate' =>
|
'javelin-behavior-differential-populate' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/f7efbf62/rsrc/js/application/differential/behavior-populate.js',
|
'uri' => '/res/a13dcd7e/rsrc/js/application/differential/behavior-populate.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -349,7 +349,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-workflow-dev' =>
|
'javelin-workflow-dev' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/7e690e16/rsrc/js/javelin/workflow.dev.js',
|
'uri' => '/res/c6b17f93/rsrc/js/javelin/workflow.dev.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -368,7 +368,7 @@ celerity_register_resource_map(array(
|
||||||
), array (
|
), array (
|
||||||
'packages' =>
|
'packages' =>
|
||||||
array (
|
array (
|
||||||
'1a33af6b' =>
|
'85861df3' =>
|
||||||
array (
|
array (
|
||||||
'name' => 'core.pkg.css',
|
'name' => 'core.pkg.css',
|
||||||
'symbols' =>
|
'symbols' =>
|
||||||
|
@ -384,11 +384,13 @@ celerity_register_resource_map(array(
|
||||||
8 => 'aphront-tokenizer-control-css',
|
8 => 'aphront-tokenizer-control-css',
|
||||||
9 => 'aphront-typeahead-control-css',
|
9 => 'aphront-typeahead-control-css',
|
||||||
10 => 'phabricator-directory-css',
|
10 => 'phabricator-directory-css',
|
||||||
|
11 => 'phabricator-remarkup-css',
|
||||||
|
12 => 'syntax-highlighting-css',
|
||||||
),
|
),
|
||||||
'uri' => '/res/pkg/1a33af6b/core.pkg.css',
|
'uri' => '/res/pkg/85861df3/core.pkg.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
),
|
),
|
||||||
'9d9c881c' =>
|
'86498b42' =>
|
||||||
array (
|
array (
|
||||||
'name' => 'differential.pkg.css',
|
'name' => 'differential.pkg.css',
|
||||||
'symbols' =>
|
'symbols' =>
|
||||||
|
@ -398,28 +400,55 @@ celerity_register_resource_map(array(
|
||||||
2 => 'differential-revision-detail-css',
|
2 => 'differential-revision-detail-css',
|
||||||
3 => 'differential-revision-history-css',
|
3 => 'differential-revision-history-css',
|
||||||
4 => 'differential-table-of-contents-css',
|
4 => 'differential-table-of-contents-css',
|
||||||
|
5 => 'differential-revision-comment-css',
|
||||||
|
6 => 'differential-revision-add-comment-css',
|
||||||
|
7 => 'differential-revision-comment-list-css',
|
||||||
),
|
),
|
||||||
'uri' => '/res/pkg/9d9c881c/differential.pkg.css',
|
'uri' => '/res/pkg/86498b42/differential.pkg.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
),
|
),
|
||||||
|
'30d594cf' =>
|
||||||
|
array (
|
||||||
|
'name' => 'differential.pkg.js',
|
||||||
|
'symbols' =>
|
||||||
|
array (
|
||||||
|
0 => 'javelin-behavior-differential-feedback-preview',
|
||||||
|
1 => 'javelin-behavior-differential-edit-inline-comments',
|
||||||
|
2 => 'javelin-behavior-differential-populate',
|
||||||
|
3 => 'javelin-behavior-differential-show-more',
|
||||||
|
4 => 'javelin-behavior-differential-diff-radios',
|
||||||
|
),
|
||||||
|
'uri' => '/res/pkg/30d594cf/differential.pkg.js',
|
||||||
|
'type' => 'js',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
'reverse' =>
|
'reverse' =>
|
||||||
array (
|
array (
|
||||||
'phabricator-core-css' => '1a33af6b',
|
'phabricator-core-css' => '85861df3',
|
||||||
'phabricator-core-buttons-css' => '1a33af6b',
|
'phabricator-core-buttons-css' => '85861df3',
|
||||||
'phabricator-standard-page-view' => '1a33af6b',
|
'phabricator-standard-page-view' => '85861df3',
|
||||||
'aphront-dialog-view-css' => '1a33af6b',
|
'aphront-dialog-view-css' => '85861df3',
|
||||||
'aphront-form-view-css' => '1a33af6b',
|
'aphront-form-view-css' => '85861df3',
|
||||||
'aphront-panel-view-css' => '1a33af6b',
|
'aphront-panel-view-css' => '85861df3',
|
||||||
'aphront-side-nav-view-css' => '1a33af6b',
|
'aphront-side-nav-view-css' => '85861df3',
|
||||||
'aphront-table-view-css' => '1a33af6b',
|
'aphront-table-view-css' => '85861df3',
|
||||||
'aphront-tokenizer-control-css' => '1a33af6b',
|
'aphront-tokenizer-control-css' => '85861df3',
|
||||||
'aphront-typeahead-control-css' => '1a33af6b',
|
'aphront-typeahead-control-css' => '85861df3',
|
||||||
'phabricator-directory-css' => '1a33af6b',
|
'phabricator-directory-css' => '85861df3',
|
||||||
'differential-core-view-css' => '9d9c881c',
|
'phabricator-remarkup-css' => '85861df3',
|
||||||
'differential-changeset-view-css' => '9d9c881c',
|
'syntax-highlighting-css' => '85861df3',
|
||||||
'differential-revision-detail-css' => '9d9c881c',
|
'differential-core-view-css' => '86498b42',
|
||||||
'differential-revision-history-css' => '9d9c881c',
|
'differential-changeset-view-css' => '86498b42',
|
||||||
'differential-table-of-contents-css' => '9d9c881c',
|
'differential-revision-detail-css' => '86498b42',
|
||||||
|
'differential-revision-history-css' => '86498b42',
|
||||||
|
'differential-table-of-contents-css' => '86498b42',
|
||||||
|
'differential-revision-comment-css' => '86498b42',
|
||||||
|
'differential-revision-add-comment-css' => '86498b42',
|
||||||
|
'differential-revision-comment-list-css' => '86498b42',
|
||||||
|
'javelin-behavior-differential-feedback-preview' => '30d594cf',
|
||||||
|
'javelin-behavior-differential-edit-inline-comments' => '30d594cf',
|
||||||
|
'javelin-behavior-differential-populate' => '30d594cf',
|
||||||
|
'javelin-behavior-differential-show-more' => '30d594cf',
|
||||||
|
'javelin-behavior-differential-diff-radios' => '30d594cf',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -23,6 +23,7 @@ phutil_register_library_map(array(
|
||||||
'AphrontFileResponse' => 'aphront/response/file',
|
'AphrontFileResponse' => 'aphront/response/file',
|
||||||
'AphrontFormCheckboxControl' => 'view/form/control/checkbox',
|
'AphrontFormCheckboxControl' => 'view/form/control/checkbox',
|
||||||
'AphrontFormControl' => 'view/form/control/base',
|
'AphrontFormControl' => 'view/form/control/base',
|
||||||
|
'AphrontFormDividerControl' => 'view/form/control/divider',
|
||||||
'AphrontFormFileControl' => 'view/form/control/file',
|
'AphrontFormFileControl' => 'view/form/control/file',
|
||||||
'AphrontFormMarkupControl' => 'view/form/control/markup',
|
'AphrontFormMarkupControl' => 'view/form/control/markup',
|
||||||
'AphrontFormPasswordControl' => 'view/form/control/password',
|
'AphrontFormPasswordControl' => 'view/form/control/password',
|
||||||
|
@ -231,6 +232,7 @@ phutil_register_library_map(array(
|
||||||
'AphrontFileResponse' => 'AphrontResponse',
|
'AphrontFileResponse' => 'AphrontResponse',
|
||||||
'AphrontFormCheckboxControl' => 'AphrontFormControl',
|
'AphrontFormCheckboxControl' => 'AphrontFormControl',
|
||||||
'AphrontFormControl' => 'AphrontView',
|
'AphrontFormControl' => 'AphrontView',
|
||||||
|
'AphrontFormDividerControl' => 'AphrontFormControl',
|
||||||
'AphrontFormFileControl' => 'AphrontFormControl',
|
'AphrontFormFileControl' => 'AphrontFormControl',
|
||||||
'AphrontFormMarkupControl' => 'AphrontFormControl',
|
'AphrontFormMarkupControl' => 'AphrontFormControl',
|
||||||
'AphrontFormPasswordControl' => 'AphrontFormControl',
|
'AphrontFormPasswordControl' => 'AphrontFormControl',
|
||||||
|
|
|
@ -168,6 +168,7 @@ class AphrontDefaultApplicationConfiguration
|
||||||
if ($response instanceof AphrontDialogResponse) {
|
if ($response instanceof AphrontDialogResponse) {
|
||||||
if (!$request->isAjax()) {
|
if (!$request->isAjax()) {
|
||||||
$view = new PhabricatorStandardPageView();
|
$view = new PhabricatorStandardPageView();
|
||||||
|
$view->setRequest($request);
|
||||||
$view->appendChild(
|
$view->appendChild(
|
||||||
'<div style="padding: 2em 0;">'.
|
'<div style="padding: 2em 0;">'.
|
||||||
$response->buildResponseString().
|
$response->buildResponseString().
|
||||||
|
|
|
@ -185,6 +185,7 @@ class DifferentialInlineCommentEditController extends DifferentialController {
|
||||||
return phutil_render_tag(
|
return phutil_render_tag(
|
||||||
'textarea',
|
'textarea',
|
||||||
array(
|
array(
|
||||||
|
'class' => 'differential-inline-comment-edit-textarea',
|
||||||
'name' => 'text',
|
'name' => 'text',
|
||||||
),
|
),
|
||||||
$text);
|
$text);
|
||||||
|
|
|
@ -133,6 +133,21 @@ class DifferentialRevisionEditController extends DifferentialController {
|
||||||
->setErrors($errors);
|
->setErrors($errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($diff && $revision->getID()) {
|
||||||
|
$form
|
||||||
|
->appendChild(
|
||||||
|
id(new AphrontFormTextAreaControl())
|
||||||
|
->setLabel('Comments')
|
||||||
|
->setName('comments')
|
||||||
|
->setCaption("Explain what's new in this diff.")
|
||||||
|
->setValue($request->getStr('comments')))
|
||||||
|
->appendChild(
|
||||||
|
id(new AphrontFormSubmitControl())
|
||||||
|
->setValue('Save'))
|
||||||
|
->appendChild(
|
||||||
|
id(new AphrontFormDividerControl()));
|
||||||
|
}
|
||||||
|
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextAreaControl())
|
id(new AphrontFormTextAreaControl())
|
||||||
|
@ -190,7 +205,11 @@ class DifferentialRevisionEditController extends DifferentialController {
|
||||||
|
|
||||||
$panel = new AphrontPanelView();
|
$panel = new AphrontPanelView();
|
||||||
if ($revision->getID()) {
|
if ($revision->getID()) {
|
||||||
$panel->setHeader('Edit Differential Revision');
|
if ($diff) {
|
||||||
|
$panel->setHeader('Update Differential Revision');
|
||||||
|
} else {
|
||||||
|
$panel->setHeader('Edit Differential Revision');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$panel->setHeader('Create New Differential Revision');
|
$panel->setHeader('Create New Differential Revision');
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
||||||
phutil_require_module('phabricator', 'view/form/base');
|
phutil_require_module('phabricator', 'view/form/base');
|
||||||
|
phutil_require_module('phabricator', 'view/form/control/divider');
|
||||||
phutil_require_module('phabricator', 'view/form/control/submit');
|
phutil_require_module('phabricator', 'view/form/control/submit');
|
||||||
phutil_require_module('phabricator', 'view/form/control/textarea');
|
phutil_require_module('phabricator', 'view/form/control/textarea');
|
||||||
phutil_require_module('phabricator', 'view/form/error');
|
phutil_require_module('phabricator', 'view/form/error');
|
||||||
|
|
|
@ -167,19 +167,24 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$handles,
|
$handles,
|
||||||
$revision->getCCPHIDs()));
|
$revision->getCCPHIDs()));
|
||||||
|
|
||||||
$path = $diff->getSourcePath();
|
$host = $diff->getSourceMachine();
|
||||||
if ($path) {
|
if ($host) {
|
||||||
$branch = $diff->getBranch() ? ' (' . $diff->getBranch() . ')' : '';
|
$properties['Host'] = phutil_escape_html($host);
|
||||||
$host = $diff->getSourceMachine();
|
|
||||||
if ($host) {
|
|
||||||
$host .= ':';
|
|
||||||
}
|
|
||||||
$properties['Path'] = phutil_escape_html("{$host}{$path} {$branch}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$path = $diff->getSourcePath();
|
||||||
|
if ($path) {
|
||||||
|
$branch = $diff->getBranch() ? ' ('.$diff->getBranch().')' : '';
|
||||||
|
$properties['Path'] = phutil_escape_html("{$path} {$branch}");
|
||||||
|
}
|
||||||
|
|
||||||
$properties['Lint'] = 'TODO';
|
$lstar = DifferentialRevisionUpdateHistoryView::renderDiffLintStar($diff);
|
||||||
$properties['Unit'] = 'TODO';
|
$lmsg = DifferentialRevisionUpdateHistoryView::getDiffLintMessage($diff);
|
||||||
|
$properties['Lint'] = $lstar.' '.$lmsg;
|
||||||
|
|
||||||
|
$ustar = DifferentialRevisionUpdateHistoryView::renderDiffUnitStar($diff);
|
||||||
|
$umsg = DifferentialRevisionUpdateHistoryView::getDiffUnitMessage($diff);
|
||||||
|
$properties['Unit'] = $ustar.' '.$umsg;
|
||||||
|
|
||||||
return $properties;
|
return $properties;
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,10 +331,9 @@ class DifferentialRevisionEditor {
|
||||||
$feedback = null;
|
$feedback = null;
|
||||||
if ($diff) {
|
if ($diff) {
|
||||||
$changesets = $diff->loadChangesets();
|
$changesets = $diff->loadChangesets();
|
||||||
// TODO: move to DifferentialFeedbackEditor
|
// TODO: This should probably be in DifferentialFeedbackEditor?
|
||||||
if (!$is_new) {
|
if (!$is_new) {
|
||||||
// TODO
|
$comment = $this->createComment();
|
||||||
// $feedback = $this->createFeedback();
|
|
||||||
}
|
}
|
||||||
if ($feedback) {
|
if ($feedback) {
|
||||||
$mail[] = id(new DifferentialNewDiffMail(
|
$mail[] = id(new DifferentialNewDiffMail(
|
||||||
|
@ -350,8 +349,7 @@ class DifferentialRevisionEditor {
|
||||||
|
|
||||||
// Save the changes we made above.
|
// Save the changes we made above.
|
||||||
|
|
||||||
// TODO
|
$diff->setDescription(substr($this->getComments(), 0, 80));
|
||||||
// $diff->setDescription(substr($this->getComments(), 0, 80));
|
|
||||||
$diff->save();
|
$diff->save();
|
||||||
|
|
||||||
// An updated diff should require review, as long as it's not committed
|
// An updated diff should require review, as long as it's not committed
|
||||||
|
@ -574,20 +572,18 @@ class DifferentialRevisionEditor {
|
||||||
$conn_w->saveTransaction();
|
$conn_w->saveTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
protected function createFeedback() {
|
private function createComment() {
|
||||||
$revision = $this->getRevision();
|
$revision_id = $this->revision->getID();
|
||||||
$feedback = id(new DifferentialFeedback())
|
$comment = id(new DifferentialComment())
|
||||||
->setUserID($this->getActorPHID())
|
->setAuthorPHID($this->getActorPHID())
|
||||||
->setRevision($revision)
|
->setRevisionID($revision_id)
|
||||||
->setContent($this->getComments())
|
->setContent($this->getComments())
|
||||||
->setAction('update');
|
->setAction('update');
|
||||||
|
$comment->save();
|
||||||
|
|
||||||
$feedback->save();
|
return $comment;
|
||||||
|
|
||||||
return $feedback;
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
||||||
phutil_require_module('phabricator', 'applications/differential/mail/ccwelcome');
|
phutil_require_module('phabricator', 'applications/differential/mail/ccwelcome');
|
||||||
phutil_require_module('phabricator', 'applications/differential/mail/newdiff');
|
phutil_require_module('phabricator', 'applications/differential/mail/newdiff');
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/storage/comment');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
phutil_require_module('phabricator', 'storage/qsprintf');
|
phutil_require_module('phabricator', 'storage/qsprintf');
|
||||||
phutil_require_module('phabricator', 'storage/queryfx');
|
phutil_require_module('phabricator', 'storage/queryfx');
|
||||||
|
|
|
@ -1029,7 +1029,7 @@ EOSYNTHETIC;
|
||||||
|
|
||||||
if (isset($this->old[$ii])) {
|
if (isset($this->old[$ii])) {
|
||||||
$o_num = $this->old[$ii]['line'];
|
$o_num = $this->old[$ii]['line'];
|
||||||
$o_text = $this->oldRender[$ii];
|
$o_text = isset($this->oldRender[$ii]) ? $this->oldRender[$ii] : null;
|
||||||
$o_attr = null;
|
$o_attr = null;
|
||||||
if ($this->old[$ii]['type']) {
|
if ($this->old[$ii]['type']) {
|
||||||
if (empty($this->new[$ii])) {
|
if (empty($this->new[$ii])) {
|
||||||
|
@ -1046,7 +1046,7 @@ EOSYNTHETIC;
|
||||||
|
|
||||||
if (isset($this->new[$ii])) {
|
if (isset($this->new[$ii])) {
|
||||||
$n_num = $this->new[$ii]['line'];
|
$n_num = $this->new[$ii]['line'];
|
||||||
$n_text = $this->newRender[$ii];
|
$n_text = isset($this->newRender[$ii]) ? $this->newRender[$ii] : null;
|
||||||
$n_attr = null;
|
$n_attr = null;
|
||||||
if ($this->new[$ii]['type']) {
|
if ($this->new[$ii]['type']) {
|
||||||
if (empty($this->old[$ii])) {
|
if (empty($this->old[$ii])) {
|
||||||
|
|
|
@ -39,6 +39,8 @@ class DifferentialDiff extends DifferentialDAO {
|
||||||
protected $arcanistProject;
|
protected $arcanistProject;
|
||||||
protected $creationMethod;
|
protected $creationMethod;
|
||||||
|
|
||||||
|
protected $description;
|
||||||
|
|
||||||
private $unsavedChangesets = array();
|
private $unsavedChangesets = array();
|
||||||
private $changesets;
|
private $changesets;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ class DifferentialChangesetListView extends AphrontView {
|
||||||
private $changesets = array();
|
private $changesets = array();
|
||||||
private $editable;
|
private $editable;
|
||||||
private $revision;
|
private $revision;
|
||||||
private $vsMap;
|
private $vsMap = array();
|
||||||
|
|
||||||
public function setChangesets($changesets) {
|
public function setChangesets($changesets) {
|
||||||
$this->changesets = $changesets;
|
$this->changesets = $changesets;
|
||||||
|
|
|
@ -48,8 +48,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||||
'id' => null,
|
'id' => null,
|
||||||
'desc' => 'Base',
|
'desc' => 'Base',
|
||||||
'age' => null,
|
'age' => null,
|
||||||
'lint' => null,
|
'obj' => null,
|
||||||
'unit' => null,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -58,10 +57,9 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||||
$data[] = array(
|
$data[] = array(
|
||||||
'name' => 'Diff '.(++$seq),
|
'name' => 'Diff '.(++$seq),
|
||||||
'id' => $diff->getID(),
|
'id' => $diff->getID(),
|
||||||
'desc' => 'TODO',//$diff->getDescription(),
|
'desc' => $diff->getDescription(),
|
||||||
'age' => $diff->getDateCreated(),
|
'age' => $diff->getDateCreated(),
|
||||||
'lint' => $diff->getLintStatus(),
|
'obj' => $diff,
|
||||||
'unit' => $diff->getUnitStatus(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,9 +74,6 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||||
$name = phutil_escape_html($row['name']);
|
$name = phutil_escape_html($row['name']);
|
||||||
$id = phutil_escape_html($row['id']);
|
$id = phutil_escape_html($row['id']);
|
||||||
|
|
||||||
$lint = '*';
|
|
||||||
$unit = '*';
|
|
||||||
|
|
||||||
$old_class = null;
|
$old_class = null;
|
||||||
$new_class = null;
|
$new_class = null;
|
||||||
|
|
||||||
|
@ -122,8 +117,12 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||||
$old = null;
|
$old = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$desc = 'TODO';
|
$desc = phutil_escape_html($row['desc']);
|
||||||
$age = '-';
|
if ($row['age']) {
|
||||||
|
$age = phabricator_format_timestamp($row['age']);
|
||||||
|
} else {
|
||||||
|
$age = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (++$idx % 2) {
|
if (++$idx % 2) {
|
||||||
$class = ' class="alt"';
|
$class = ' class="alt"';
|
||||||
|
@ -131,6 +130,14 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||||
$class = null;
|
$class = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($row['obj']) {
|
||||||
|
$lint = self::renderDiffLintStar($row['obj']);
|
||||||
|
$unit = self::renderDiffUnitStar($row['obj']);
|
||||||
|
} else {
|
||||||
|
$lint = null;
|
||||||
|
$unit = null;
|
||||||
|
}
|
||||||
|
|
||||||
$rows[] =
|
$rows[] =
|
||||||
'<tr'.$class.'>'.
|
'<tr'.$class.'>'.
|
||||||
'<td class="revhistory-name">'.$name.'</td>'.
|
'<td class="revhistory-name">'.$name.'</td>'.
|
||||||
|
@ -161,7 +168,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||||
'<th>Diff</th>'.
|
'<th>Diff</th>'.
|
||||||
'<th>ID</th>'.
|
'<th>ID</th>'.
|
||||||
'<th>Description</th>'.
|
'<th>Description</th>'.
|
||||||
'<th>Age</th>'.
|
'<th>Created</th>'.
|
||||||
'<th>Lint</th>'.
|
'<th>Lint</th>'.
|
||||||
'<th>Unit</th>'.
|
'<th>Unit</th>'.
|
||||||
'</tr>'.
|
'</tr>'.
|
||||||
|
@ -176,4 +183,79 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
||||||
'</form>'.
|
'</form>'.
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const STAR_NONE = 'none';
|
||||||
|
const STAR_OKAY = 'okay';
|
||||||
|
const STAR_WARN = 'warn';
|
||||||
|
const STAR_FAIL = 'fail';
|
||||||
|
const STAR_SKIP = 'skip';
|
||||||
|
|
||||||
|
public static function renderDiffLintStar(DifferentialDiff $diff) {
|
||||||
|
static $map = array(
|
||||||
|
DifferentialLintStatus::LINT_NONE => self::STAR_NONE,
|
||||||
|
DifferentialLintStatus::LINT_OKAY => self::STAR_OKAY,
|
||||||
|
DifferentialLintStatus::LINT_WARN => self::STAR_WARN,
|
||||||
|
DifferentialLintStatus::LINT_FAIL => self::STAR_FAIL,
|
||||||
|
DifferentialLintStatus::LINT_SKIP => self::STAR_SKIP,
|
||||||
|
);
|
||||||
|
|
||||||
|
$star = idx($map, $diff->getLintStatus(), self::STAR_FAIL);
|
||||||
|
|
||||||
|
return self::renderDiffStar($star);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function renderDiffUnitStar(DifferentialDiff $diff) {
|
||||||
|
static $map = array(
|
||||||
|
DifferentialUnitStatus::UNIT_NONE => self::STAR_NONE,
|
||||||
|
DifferentialUnitStatus::UNIT_OKAY => self::STAR_OKAY,
|
||||||
|
DifferentialUnitStatus::UNIT_WARN => self::STAR_WARN,
|
||||||
|
DifferentialUnitStatus::UNIT_FAIL => self::STAR_FAIL,
|
||||||
|
DifferentialUnitStatus::UNIT_SKIP => self::STAR_SKIP,
|
||||||
|
);
|
||||||
|
|
||||||
|
$star = idx($map, $diff->getUnitStatus(), self::STAR_FAIL);
|
||||||
|
|
||||||
|
return self::renderDiffStar($star);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getDiffLintMessage(DifferentialDiff $diff) {
|
||||||
|
switch ($diff->getLintStatus()) {
|
||||||
|
case DifferentialLintStatus::LINT_NONE:
|
||||||
|
return 'No Linters Available';
|
||||||
|
case DifferentialLintStatus::LINT_OKAY:
|
||||||
|
return 'Lint OK';
|
||||||
|
case DifferentialLintStatus::LINT_WARN:
|
||||||
|
return 'Lint Warnings';
|
||||||
|
case DifferentialLintStatus::LINT_FAIL:
|
||||||
|
return 'Lint Errors';
|
||||||
|
case DifferentialLintStatus::LINT_SKIP:
|
||||||
|
return 'Lint Skipped';
|
||||||
|
}
|
||||||
|
return '???';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getDiffUnitMessage(DifferentialDiff $diff) {
|
||||||
|
switch ($diff->getUnitStatus()) {
|
||||||
|
case DifferentialUnitStatus::UNIT_NONE:
|
||||||
|
return 'No Unit Test Coverage';
|
||||||
|
case DifferentialUnitStatus::UNIT_OKAY:
|
||||||
|
return 'Unit Tests OK';
|
||||||
|
case DifferentialUnitStatus::UNIT_WARN:
|
||||||
|
return 'Unit Test Warnings';
|
||||||
|
case DifferentialUnitStatus::UNIT_FAIL:
|
||||||
|
return 'Unit Test Errors';
|
||||||
|
case DifferentialUnitStatus::UNIT_SKIP:
|
||||||
|
return 'Unit Tests Skipped';
|
||||||
|
}
|
||||||
|
return '???';
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function renderDiffStar($star) {
|
||||||
|
$class = 'diff-star-'.$star;
|
||||||
|
return
|
||||||
|
'<span class="'.$class.'">'.
|
||||||
|
"\xE2\x98\x85".
|
||||||
|
'</span>';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,16 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/constants/lintstatus');
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/constants/unitstatus');
|
||||||
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
||||||
phutil_require_module('phabricator', 'infrastructure/javelin/api');
|
phutil_require_module('phabricator', 'infrastructure/javelin/api');
|
||||||
phutil_require_module('phabricator', 'infrastructure/javelin/markup');
|
phutil_require_module('phabricator', 'infrastructure/javelin/markup');
|
||||||
phutil_require_module('phabricator', 'view/base');
|
phutil_require_module('phabricator', 'view/base');
|
||||||
|
phutil_require_module('phabricator', 'view/utils');
|
||||||
|
|
||||||
phutil_require_module('phutil', 'markup');
|
phutil_require_module('phutil', 'markup');
|
||||||
|
phutil_require_module('phutil', 'utils');
|
||||||
|
|
||||||
|
|
||||||
phutil_require_source('DifferentialRevisionUpdateHistoryView.php');
|
phutil_require_source('DifferentialRevisionUpdateHistoryView.php');
|
||||||
|
|
|
@ -39,6 +39,7 @@ class PhabricatorDirectoryCategoryDeleteController
|
||||||
}
|
}
|
||||||
|
|
||||||
$dialog = new AphrontDialogView();
|
$dialog = new AphrontDialogView();
|
||||||
|
$dialog->setUser($request->getUser());
|
||||||
$dialog->setTitle('Really delete this category?');
|
$dialog->setTitle('Really delete this category?');
|
||||||
$dialog->appendChild("Are you sure you want to delete this category?");
|
$dialog->appendChild("Are you sure you want to delete this category?");
|
||||||
$dialog->addSubmitButton('Delete');
|
$dialog->addSubmitButton('Delete');
|
||||||
|
|
|
@ -39,6 +39,7 @@ class PhabricatorDirectoryItemDeleteController
|
||||||
}
|
}
|
||||||
|
|
||||||
$dialog = new AphrontDialogView();
|
$dialog = new AphrontDialogView();
|
||||||
|
$dialog->setUser($request->getUser());
|
||||||
$dialog->setTitle('Really delete this item?');
|
$dialog->setTitle('Really delete this item?');
|
||||||
$dialog->appendChild("Are you sure you want to delete this item?");
|
$dialog->appendChild("Are you sure you want to delete this item?");
|
||||||
$dialog->addSubmitButton('Delete');
|
$dialog->addSubmitButton('Delete');
|
||||||
|
|
|
@ -47,7 +47,8 @@ class PhabricatorXHProfProfileTopLevelView extends AphrontView {
|
||||||
|
|
||||||
$aggregated = array();
|
$aggregated = array();
|
||||||
foreach ($flat as $call => $counters) {
|
foreach ($flat as $call => $counters) {
|
||||||
$agg_call = reset(explode('@', $call, 2));
|
$parts = explode('@', $call, 2);
|
||||||
|
$agg_call = reset($parts);
|
||||||
if (empty($aggregated[$agg_call])) {
|
if (empty($aggregated[$agg_call])) {
|
||||||
$aggregated[$agg_call] = $counters;
|
$aggregated[$agg_call] = $counters;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -64,10 +64,13 @@ class AphrontDialogView extends AphrontView {
|
||||||
|
|
||||||
$buttons = array();
|
$buttons = array();
|
||||||
if ($this->submitButton) {
|
if ($this->submitButton) {
|
||||||
$buttons[] =
|
$buttons[] = phutil_render_tag(
|
||||||
'<button name="__submit__">'.
|
'button',
|
||||||
phutil_escape_html($this->submitButton).
|
array(
|
||||||
'</button>';
|
'name' => '__submit__',
|
||||||
|
'sigil' => '__default__',
|
||||||
|
),
|
||||||
|
phutil_escape_html($this->submitButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->cancelURI) {
|
if ($this->cancelURI) {
|
||||||
|
|
29
src/view/form/control/divider/AphrontFormDividerControl.php
Executable file
29
src/view/form/control/divider/AphrontFormDividerControl.php
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2011 Facebook, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class AphrontFormDividerControl extends AphrontFormControl {
|
||||||
|
|
||||||
|
protected function getCustomControlClass() {
|
||||||
|
return 'aphront-form-control-divider';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function renderInput() {
|
||||||
|
return '<hr />';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
12
src/view/form/control/divider/__init__.php
Normal file
12
src/view/form/control/divider/__init__.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is automatically generated. Lint this module to rebuild it.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'view/form/control/base');
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_source('AphrontFormDividerControl.php');
|
|
@ -27,10 +27,10 @@ function phabricator_format_relative_time($duration) {
|
||||||
function phabricator_format_timestamp($epoch) {
|
function phabricator_format_timestamp($epoch) {
|
||||||
$difference = (time() - $epoch);
|
$difference = (time() - $epoch);
|
||||||
|
|
||||||
if ($difference < 60 * 60) {
|
if ($difference < 60 * 60 * 24) {
|
||||||
return phabricator_format_relative_time($difference).' ago';
|
return phabricator_format_relative_time($difference).' ago';
|
||||||
} else if (date('Y') == date('Y', $epoch)) {
|
} else if (date('Y') == date('Y', $epoch)) {
|
||||||
return date('M jS, g:i A', $epoch);
|
return date('M j, g:i A', $epoch);
|
||||||
} else {
|
} else {
|
||||||
return date('F jS, Y', $epoch);
|
return date('F jS, Y', $epoch);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,3 +164,9 @@
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.differential-inline-comment-edit-textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 12em;
|
||||||
|
}
|
||||||
|
|
|
@ -23,3 +23,25 @@
|
||||||
.differential-toc-file {
|
.differential-toc-file {
|
||||||
color: #444444;
|
color: #444444;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.diff-star-none {
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diff-star-okay {
|
||||||
|
color: #ff9700;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: 'warn' and 'fail' are both red, but we can't make 'warn' yellow since
|
||||||
|
'okay' is a "gold star". */
|
||||||
|
.diff-star-warn {
|
||||||
|
color: #aa0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diff-star-fail {
|
||||||
|
color: #aa0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diff-star-skip {
|
||||||
|
color: #ff00aa;
|
||||||
|
}
|
||||||
|
|
|
@ -161,7 +161,9 @@ JX.install('Workflow', {
|
||||||
var s = JX.$V.getScroll();
|
var s = JX.$V.getScroll();
|
||||||
JX.$V((v.x - d.x) / 2, s.y + 100).setPos(this._root);
|
JX.$V((v.x - d.x) / 2, s.y + 100).setPos(this._root);
|
||||||
try {
|
try {
|
||||||
JX.DOM.focus(JX.DOM.find(this._root, 'button', '__default__'));
|
try {
|
||||||
|
JX.DOM.focus(JX.DOM.find(this._root, 'button', '__default__'));
|
||||||
|
} catch (_ignored) {}
|
||||||
var inputs = JX.DOM.scry(this._root, 'input')
|
var inputs = JX.DOM.scry(this._root, 'input')
|
||||||
.concat(JX.DOM.scry(this._root, 'textarea'));
|
.concat(JX.DOM.scry(this._root, 'textarea'));
|
||||||
var miny = Number.POSITIVE_INFINITY;
|
var miny = Number.POSITIVE_INFINITY;
|
||||||
|
|
Loading…
Reference in a new issue