mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Basic Differential revision feedback view.
This commit is contained in:
parent
39a976ae7f
commit
c55b1ed9bb
23 changed files with 361 additions and 44 deletions
|
@ -82,7 +82,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'phabricator-standard-page-view' =>
|
'phabricator-standard-page-view' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/1f93ada7/rsrc/css/application/base/standard-page-view.css',
|
'uri' => '/res/fb02fb0e/rsrc/css/application/base/standard-page-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -107,6 +107,24 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'disk' => '/rsrc/css/application/differential/core.css',
|
'disk' => '/rsrc/css/application/differential/core.css',
|
||||||
),
|
),
|
||||||
|
'differential-revision-comment-list-css' =>
|
||||||
|
array(
|
||||||
|
'uri' => '/res/a1c117db/rsrc/css/application/differential/revision-comment-list.css',
|
||||||
|
'type' => 'css',
|
||||||
|
'requires' =>
|
||||||
|
array(
|
||||||
|
),
|
||||||
|
'disk' => '/rsrc/css/application/differential/revision-comment-list.css',
|
||||||
|
),
|
||||||
|
'differential-revision-comment-css' =>
|
||||||
|
array(
|
||||||
|
'uri' => '/res/d9924857/rsrc/css/application/differential/revision-comment.css',
|
||||||
|
'type' => 'css',
|
||||||
|
'requires' =>
|
||||||
|
array(
|
||||||
|
),
|
||||||
|
'disk' => '/rsrc/css/application/differential/revision-comment.css',
|
||||||
|
),
|
||||||
'differential-revision-detail-css' =>
|
'differential-revision-detail-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/230a67c6/rsrc/css/application/differential/revision-detail.css',
|
'uri' => '/res/230a67c6/rsrc/css/application/differential/revision-detail.css',
|
||||||
|
@ -247,7 +265,7 @@ celerity_register_resource_map(array(
|
||||||
), array (
|
), array (
|
||||||
'packages' =>
|
'packages' =>
|
||||||
array (
|
array (
|
||||||
'4efe7b58' =>
|
'364a306c' =>
|
||||||
array (
|
array (
|
||||||
'name' => 'core.pkg.css',
|
'name' => 'core.pkg.css',
|
||||||
'symbols' =>
|
'symbols' =>
|
||||||
|
@ -264,7 +282,7 @@ celerity_register_resource_map(array(
|
||||||
9 => 'aphront-typeahead-control-css',
|
9 => 'aphront-typeahead-control-css',
|
||||||
10 => 'phabricator-directory-css',
|
10 => 'phabricator-directory-css',
|
||||||
),
|
),
|
||||||
'uri' => '/res/pkg/4efe7b58/core.pkg.css',
|
'uri' => '/res/pkg/364a306c/core.pkg.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
),
|
),
|
||||||
'69b11588' =>
|
'69b11588' =>
|
||||||
|
@ -284,17 +302,17 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'reverse' =>
|
'reverse' =>
|
||||||
array (
|
array (
|
||||||
'phabricator-core-css' => '4efe7b58',
|
'phabricator-core-css' => '364a306c',
|
||||||
'phabricator-core-buttons-css' => '4efe7b58',
|
'phabricator-core-buttons-css' => '364a306c',
|
||||||
'phabricator-standard-page-view' => '4efe7b58',
|
'phabricator-standard-page-view' => '364a306c',
|
||||||
'aphront-dialog-view-css' => '4efe7b58',
|
'aphront-dialog-view-css' => '364a306c',
|
||||||
'aphront-form-view-css' => '4efe7b58',
|
'aphront-form-view-css' => '364a306c',
|
||||||
'aphront-panel-view-css' => '4efe7b58',
|
'aphront-panel-view-css' => '364a306c',
|
||||||
'aphront-side-nav-view-css' => '4efe7b58',
|
'aphront-side-nav-view-css' => '364a306c',
|
||||||
'aphront-table-view-css' => '4efe7b58',
|
'aphront-table-view-css' => '364a306c',
|
||||||
'aphront-tokenizer-control-css' => '4efe7b58',
|
'aphront-tokenizer-control-css' => '364a306c',
|
||||||
'aphront-typeahead-control-css' => '4efe7b58',
|
'aphront-typeahead-control-css' => '364a306c',
|
||||||
'phabricator-directory-css' => '4efe7b58',
|
'phabricator-directory-css' => '364a306c',
|
||||||
'differential-core-view-css' => '69b11588',
|
'differential-core-view-css' => '69b11588',
|
||||||
'differential-changeset-view-css' => '69b11588',
|
'differential-changeset-view-css' => '69b11588',
|
||||||
'differential-revision-detail-css' => '69b11588',
|
'differential-revision-detail-css' => '69b11588',
|
||||||
|
|
|
@ -72,6 +72,7 @@ phutil_register_library_map(array(
|
||||||
'DifferentialChangesetListView' => 'applications/differential/view/changesetlistview',
|
'DifferentialChangesetListView' => 'applications/differential/view/changesetlistview',
|
||||||
'DifferentialChangesetParser' => 'applications/differential/parser/changeset',
|
'DifferentialChangesetParser' => 'applications/differential/parser/changeset',
|
||||||
'DifferentialChangesetViewController' => 'applications/differential/controller/changesetview',
|
'DifferentialChangesetViewController' => 'applications/differential/controller/changesetview',
|
||||||
|
'DifferentialComment' => 'applications/differential/storage/comment',
|
||||||
'DifferentialController' => 'applications/differential/controller/base',
|
'DifferentialController' => 'applications/differential/controller/base',
|
||||||
'DifferentialDAO' => 'applications/differential/storage/base',
|
'DifferentialDAO' => 'applications/differential/storage/base',
|
||||||
'DifferentialDiff' => 'applications/differential/storage/diff',
|
'DifferentialDiff' => 'applications/differential/storage/diff',
|
||||||
|
@ -86,6 +87,8 @@ phutil_register_library_map(array(
|
||||||
'DifferentialNewDiffMail' => 'applications/differential/mail/newdiff',
|
'DifferentialNewDiffMail' => 'applications/differential/mail/newdiff',
|
||||||
'DifferentialReviewRequestMail' => 'applications/differential/mail/reviewrequest',
|
'DifferentialReviewRequestMail' => 'applications/differential/mail/reviewrequest',
|
||||||
'DifferentialRevision' => 'applications/differential/storage/revision',
|
'DifferentialRevision' => 'applications/differential/storage/revision',
|
||||||
|
'DifferentialRevisionCommentListView' => 'applications/differential/view/revisioncommentlist',
|
||||||
|
'DifferentialRevisionCommentView' => 'applications/differential/view/revisioncomment',
|
||||||
'DifferentialRevisionControlSystem' => 'applications/differential/constants/revisioncontrolsystem',
|
'DifferentialRevisionControlSystem' => 'applications/differential/constants/revisioncontrolsystem',
|
||||||
'DifferentialRevisionDetailView' => 'applications/differential/view/revisiondetail',
|
'DifferentialRevisionDetailView' => 'applications/differential/view/revisiondetail',
|
||||||
'DifferentialRevisionEditController' => 'applications/differential/controller/revisionedit',
|
'DifferentialRevisionEditController' => 'applications/differential/controller/revisionedit',
|
||||||
|
@ -226,6 +229,7 @@ phutil_register_library_map(array(
|
||||||
'DifferentialChangesetDetailView' => 'AphrontView',
|
'DifferentialChangesetDetailView' => 'AphrontView',
|
||||||
'DifferentialChangesetListView' => 'AphrontView',
|
'DifferentialChangesetListView' => 'AphrontView',
|
||||||
'DifferentialChangesetViewController' => 'DifferentialController',
|
'DifferentialChangesetViewController' => 'DifferentialController',
|
||||||
|
'DifferentialComment' => 'DifferentialDAO',
|
||||||
'DifferentialController' => 'PhabricatorController',
|
'DifferentialController' => 'PhabricatorController',
|
||||||
'DifferentialDAO' => 'PhabricatorLiskDAO',
|
'DifferentialDAO' => 'PhabricatorLiskDAO',
|
||||||
'DifferentialDiff' => 'DifferentialDAO',
|
'DifferentialDiff' => 'DifferentialDAO',
|
||||||
|
@ -238,6 +242,8 @@ phutil_register_library_map(array(
|
||||||
'DifferentialNewDiffMail' => 'DifferentialReviewRequestMail',
|
'DifferentialNewDiffMail' => 'DifferentialReviewRequestMail',
|
||||||
'DifferentialReviewRequestMail' => 'DifferentialMail',
|
'DifferentialReviewRequestMail' => 'DifferentialMail',
|
||||||
'DifferentialRevision' => 'DifferentialDAO',
|
'DifferentialRevision' => 'DifferentialDAO',
|
||||||
|
'DifferentialRevisionCommentListView' => 'AphrontView',
|
||||||
|
'DifferentialRevisionCommentView' => 'AphrontView',
|
||||||
'DifferentialRevisionDetailView' => 'AphrontView',
|
'DifferentialRevisionDetailView' => 'AphrontView',
|
||||||
'DifferentialRevisionEditController' => 'DifferentialController',
|
'DifferentialRevisionEditController' => 'DifferentialController',
|
||||||
'DifferentialRevisionListController' => 'DifferentialController',
|
'DifferentialRevisionListController' => 'DifferentialController',
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ConduitAPI_differential_creatediff_Method extends ConduitAPIMethod {
|
||||||
'sourceControlBaseRevision' => 'required string',
|
'sourceControlBaseRevision' => 'required string',
|
||||||
'parentRevisionID' => 'optional revisionid',
|
'parentRevisionID' => 'optional revisionid',
|
||||||
'creationMethod' => 'optional string',
|
'creationMethod' => 'optional string',
|
||||||
'ownerPHID' => 'optional phid',
|
'authorPHID' => 'optional phid',
|
||||||
'arcanistProject' => 'optional string',
|
'arcanistProject' => 'optional string',
|
||||||
'lintStatus' =>
|
'lintStatus' =>
|
||||||
'required enum<none, skip, okay, warn, fail>',
|
'required enum<none, skip, okay, warn, fail>',
|
||||||
|
@ -65,7 +65,7 @@ class ConduitAPI_differential_creatediff_Method extends ConduitAPIMethod {
|
||||||
|
|
||||||
$diff->setBranch($request->getValue('branch'));
|
$diff->setBranch($request->getValue('branch'));
|
||||||
$diff->setCreationMethod($request->getValue('creationMethod'));
|
$diff->setCreationMethod($request->getValue('creationMethod'));
|
||||||
$diff->setOwnerPHID($request->getValue('ownerPHID'));
|
$diff->setAuthorPHID($request->getValue('authorPHID'));
|
||||||
|
|
||||||
$parent_id = $request->getValue('parentRevisionID');
|
$parent_id = $request->getValue('parentRevisionID');
|
||||||
if ($parent_id) {
|
if ($parent_id) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ final class DifferentialAction {
|
||||||
self::ACTION_ADDREVIEWERS => 'added reviewers to',
|
self::ACTION_ADDREVIEWERS => 'added reviewers to',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($verbs[$action])) {
|
if (!empty($verbs[$action])) {
|
||||||
return $verbs[$action];
|
return $verbs[$action];
|
||||||
} else {
|
} else {
|
||||||
return 'brazenly "'.$action.'ed"';
|
return 'brazenly "'.$action.'ed"';
|
||||||
|
|
|
@ -145,7 +145,7 @@ class DifferentialRevisionListController extends DifferentialController {
|
||||||
phutil_escape_html($revision->getTitle())),
|
phutil_escape_html($revision->getTitle())),
|
||||||
phutil_escape_html($status),
|
phutil_escape_html($status),
|
||||||
number_format($revision->getLineCount()),
|
number_format($revision->getLineCount()),
|
||||||
$revision->getOwnerPHID(),
|
$revision->getAuthorPHID(),
|
||||||
'TODO',
|
'TODO',
|
||||||
$revision->getDateModified(),
|
$revision->getDateModified(),
|
||||||
$revision->getDateCreated(),
|
$revision->getDateCreated(),
|
||||||
|
|
|
@ -41,26 +41,23 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
|
|
||||||
$changesets = $target->loadChangesets();
|
$changesets = $target->loadChangesets();
|
||||||
|
|
||||||
|
$comments = $revision->loadComments();
|
||||||
|
$comments = array_merge(
|
||||||
|
$this->getImplicitComments($revision),
|
||||||
|
$comments);
|
||||||
|
|
||||||
$object_phids = array_merge(
|
$object_phids = array_merge(
|
||||||
$revision->getReviewers(),
|
$revision->getReviewers(),
|
||||||
$revision->getCCPHIDs(),
|
$revision->getCCPHIDs(),
|
||||||
array(
|
array(
|
||||||
$revision->getOwnerPHID(),
|
$revision->getAuthorPHID(),
|
||||||
$request->getUser()->getPHID(),
|
$request->getUser()->getPHID(),
|
||||||
));
|
),
|
||||||
|
mpull($comments, 'getAuthorPHID'));
|
||||||
|
|
||||||
$handles = id(new PhabricatorObjectHandleData($object_phids))
|
$handles = id(new PhabricatorObjectHandleData($object_phids))
|
||||||
->loadHandles();
|
->loadHandles();
|
||||||
|
|
||||||
$diff_history = new DifferentialRevisionUpdateHistoryView();
|
|
||||||
$diff_history->setDiffs($diffs);
|
|
||||||
|
|
||||||
$toc_view = new DifferentialDiffTableOfContentsView();
|
|
||||||
$toc_view->setChangesets($changesets);
|
|
||||||
|
|
||||||
$changeset_view = new DifferentialChangesetListView();
|
|
||||||
$changeset_view->setChangesets($changesets);
|
|
||||||
|
|
||||||
$revision_detail = new DifferentialRevisionDetailView();
|
$revision_detail = new DifferentialRevisionDetailView();
|
||||||
$revision_detail->setRevision($revision);
|
$revision_detail->setRevision($revision);
|
||||||
|
|
||||||
|
@ -70,9 +67,23 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$actions = $this->getRevisionActions($revision);
|
$actions = $this->getRevisionActions($revision);
|
||||||
$revision_detail->setActions($actions);
|
$revision_detail->setActions($actions);
|
||||||
|
|
||||||
|
$comment_view = new DifferentialRevisionCommentListView();
|
||||||
|
$comment_view->setComments($comments);
|
||||||
|
$comment_view->setHandles($handles);
|
||||||
|
|
||||||
|
$diff_history = new DifferentialRevisionUpdateHistoryView();
|
||||||
|
$diff_history->setDiffs($diffs);
|
||||||
|
|
||||||
|
$toc_view = new DifferentialDiffTableOfContentsView();
|
||||||
|
$toc_view->setChangesets($changesets);
|
||||||
|
|
||||||
|
$changeset_view = new DifferentialChangesetListView();
|
||||||
|
$changeset_view->setChangesets($changesets);
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
return $this->buildStandardPageResponse(
|
||||||
'<div class="differential-primary-pane">'.
|
'<div class="differential-primary-pane">'.
|
||||||
$revision_detail->render().
|
$revision_detail->render().
|
||||||
|
$comment_view->render().
|
||||||
$diff_history->render().
|
$diff_history->render().
|
||||||
$toc_view->render().
|
$toc_view->render().
|
||||||
$changeset_view->render().
|
$changeset_view->render().
|
||||||
|
@ -82,6 +93,32 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getImplicitComments(DifferentialRevision $revision) {
|
||||||
|
|
||||||
|
$template = new DifferentialComment();
|
||||||
|
$template->setAuthorPHID($revision->getAuthorPHID());
|
||||||
|
$template->setRevisionID($revision->getID());
|
||||||
|
$template->setDateCreated($revision->getDateCreated());
|
||||||
|
|
||||||
|
$comments = array();
|
||||||
|
|
||||||
|
if (strlen($revision->getSummary())) {
|
||||||
|
$summary_comment = clone $template;
|
||||||
|
$summary_comment->setContent($revision->getSummary());
|
||||||
|
$summary_comment->setAction(DifferentialAction::ACTION_SUMMARIZE);
|
||||||
|
$comments[] = $summary_comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($revision->getTestPlan())) {
|
||||||
|
$testplan_comment = clone $template;
|
||||||
|
$testplan_comment->setContent($revision->getTestPlan());
|
||||||
|
$testplan_comment->setAction(DifferentialAction::ACTION_TESTPLAN);
|
||||||
|
$comments[] = $testplan_comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $comments;
|
||||||
|
}
|
||||||
|
|
||||||
private function getRevisionProperties(
|
private function getRevisionProperties(
|
||||||
DifferentialRevision $revision,
|
DifferentialRevision $revision,
|
||||||
DifferentialDiff $diff,
|
DifferentialDiff $diff,
|
||||||
|
@ -93,7 +130,7 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
|
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
|
||||||
$properties['Revision Status'] = '<strong>'.$status.'</strong>';
|
$properties['Revision Status'] = '<strong>'.$status.'</strong>';
|
||||||
|
|
||||||
$author = $handles[$revision->getOwnerPHID()];
|
$author = $handles[$revision->getAuthorPHID()];
|
||||||
$properties['Author'] = $author->renderLink();
|
$properties['Author'] = $author->renderLink();
|
||||||
|
|
||||||
$properties['Reviewers'] = $this->renderHandleLinkList(
|
$properties['Reviewers'] = $this->renderHandleLinkList(
|
||||||
|
@ -125,7 +162,7 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
|
|
||||||
private function getRevisionActions(DifferentialRevision $revision) {
|
private function getRevisionActions(DifferentialRevision $revision) {
|
||||||
$viewer_phid = $this->getRequest()->getUser()->getPHID();
|
$viewer_phid = $this->getRequest()->getUser()->getPHID();
|
||||||
$viewer_is_owner = ($revision->getOwnerPHID() == $viewer_phid);
|
$viewer_is_owner = ($revision->getAuthorPHID() == $viewer_phid);
|
||||||
$viewer_is_reviewer = in_array($viewer_phid, $revision->getReviewers());
|
$viewer_is_reviewer = in_array($viewer_phid, $revision->getReviewers());
|
||||||
$viewer_is_cc = in_array($viewer_phid, $revision->getCCPHIDs());
|
$viewer_is_cc = in_array($viewer_phid, $revision->getCCPHIDs());
|
||||||
$status = $revision->getStatus();
|
$status = $revision->getStatus();
|
||||||
|
|
|
@ -7,11 +7,14 @@
|
||||||
|
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'aphront/response/404');
|
phutil_require_module('phabricator', 'aphront/response/404');
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/constants/action');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
||||||
phutil_require_module('phabricator', 'applications/differential/controller/base');
|
phutil_require_module('phabricator', 'applications/differential/controller/base');
|
||||||
|
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', 'applications/differential/view/changesetlistview');
|
phutil_require_module('phabricator', 'applications/differential/view/changesetlistview');
|
||||||
phutil_require_module('phabricator', 'applications/differential/view/difftableofcontents');
|
phutil_require_module('phabricator', 'applications/differential/view/difftableofcontents');
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/view/revisioncommentlist');
|
||||||
phutil_require_module('phabricator', 'applications/differential/view/revisiondetail');
|
phutil_require_module('phabricator', 'applications/differential/view/revisiondetail');
|
||||||
phutil_require_module('phabricator', 'applications/differential/view/revisionupdatehistory');
|
phutil_require_module('phabricator', 'applications/differential/view/revisionupdatehistory');
|
||||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
||||||
|
|
|
@ -60,13 +60,13 @@ class DifferentialRevisionListData {
|
||||||
break;
|
break;
|
||||||
case self::QUERY_OPEN_OWNED:
|
case self::QUERY_OPEN_OWNED:
|
||||||
$this->revisions = $this->loadAllWhere(
|
$this->revisions = $this->loadAllWhere(
|
||||||
'revision.status in (%Ld) AND revision.ownerPHID in (%Ls)',
|
'revision.status in (%Ld) AND revision.authorPHID in (%Ls)',
|
||||||
$this->getOpenStatuses(),
|
$this->getOpenStatuses(),
|
||||||
$this->ids);
|
$this->ids);
|
||||||
break;
|
break;
|
||||||
case self::QUERY_COMMITTABLE:
|
case self::QUERY_COMMITTABLE:
|
||||||
$this->revisions = $this->loadAllWhere(
|
$this->revisions = $this->loadAllWhere(
|
||||||
'revision.status in (%Ld) AND revision.ownerPHID in (%Ls)',
|
'revision.status in (%Ld) AND revision.authorPHID in (%Ls)',
|
||||||
array(
|
array(
|
||||||
DifferentialRevisionStatus::ACCEPTED,
|
DifferentialRevisionStatus::ACCEPTED,
|
||||||
),
|
),
|
||||||
|
@ -85,12 +85,12 @@ class DifferentialRevisionListData {
|
||||||
break;
|
break;
|
||||||
case self::QUERY_OWNED:
|
case self::QUERY_OWNED:
|
||||||
$this->revisions = $this->loadAllWhere(
|
$this->revisions = $this->loadAllWhere(
|
||||||
'revision.ownerPHID in (%Ls)',
|
'revision.authorPHID in (%Ls)',
|
||||||
$this->ids);
|
$this->ids);
|
||||||
break;
|
break;
|
||||||
case self::QUERY_OWNED_OR_REVIEWER:
|
case self::QUERY_OWNED_OR_REVIEWER:
|
||||||
$this->revisions = $this->loadAllWhereJoinReview(
|
$this->revisions = $this->loadAllWhereJoinReview(
|
||||||
'revision.ownerPHID in (%Ls) OR relationship.objectPHID in (%Ls)',
|
'revision.authorPHID in (%Ls) OR relationship.objectPHID in (%Ls)',
|
||||||
$this->ids,
|
$this->ids,
|
||||||
$this->ids);
|
$this->ids);
|
||||||
break;
|
break;
|
||||||
|
@ -99,7 +99,7 @@ class DifferentialRevisionListData {
|
||||||
$data = queryfx_all(
|
$data = queryfx_all(
|
||||||
$rev->establishConnection('r'),
|
$rev->establishConnection('r'),
|
||||||
'SELECT revision.* FROM %T revision
|
'SELECT revision.* FROM %T revision
|
||||||
WHERE revision.ownerPHID in (%Ls)
|
WHERE revision.authorPHID in (%Ls)
|
||||||
AND revision.status in (%Ld)
|
AND revision.status in (%Ld)
|
||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
@ -135,7 +135,7 @@ class DifferentialRevisionListData {
|
||||||
$data = queryfx_all(
|
$data = queryfx_all(
|
||||||
$rev->establishConnection('r'),
|
$rev->establishConnection('r'),
|
||||||
'SELECT revision.* FROM %T revision
|
'SELECT revision.* FROM %T revision
|
||||||
WHERE revision.ownerPHID in (%Ls)
|
WHERE revision.authorPHID in (%Ls)
|
||||||
AND revision.status IN (%Ld)
|
AND revision.status IN (%Ld)
|
||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
|
@ -204,8 +204,8 @@ class DifferentialRevisionEditor {
|
||||||
if ($revision->getTitle() === null) {
|
if ($revision->getTitle() === null) {
|
||||||
$revision->setTitle('Untitled Revision');
|
$revision->setTitle('Untitled Revision');
|
||||||
}
|
}
|
||||||
if ($revision->getOwnerPHID() === null) {
|
if ($revision->getAuthorPHID() === null) {
|
||||||
$revision->setOwnerPHID($this->getActorPHID());
|
$revision->setAuthorPHID($this->getActorPHID());
|
||||||
}
|
}
|
||||||
|
|
||||||
$revision->save();
|
$revision->save();
|
||||||
|
@ -315,7 +315,7 @@ class DifferentialRevisionEditor {
|
||||||
array_keys($add['rev']),
|
array_keys($add['rev']),
|
||||||
$this->actorPHID);
|
$this->actorPHID);
|
||||||
|
|
||||||
// Add the owner to the relevant set of users so they get a copy of the
|
// Add the author to the relevant set of users so they get a copy of the
|
||||||
// email.
|
// email.
|
||||||
if (!$this->silentUpdate) {
|
if (!$this->silentUpdate) {
|
||||||
if ($is_new) {
|
if ($is_new) {
|
||||||
|
|
26
src/applications/differential/storage/comment/DifferentialComment.php
Executable file
26
src/applications/differential/storage/comment/DifferentialComment.php
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<?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 DifferentialComment extends DifferentialDAO {
|
||||||
|
|
||||||
|
protected $authorPHID;
|
||||||
|
protected $revisionID;
|
||||||
|
protected $action;
|
||||||
|
protected $content;
|
||||||
|
|
||||||
|
}
|
12
src/applications/differential/storage/comment/__init__.php
Normal file
12
src/applications/differential/storage/comment/__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', 'applications/differential/storage/base');
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_source('DifferentialComment.php');
|
|
@ -19,7 +19,7 @@
|
||||||
class DifferentialDiff extends DifferentialDAO {
|
class DifferentialDiff extends DifferentialDAO {
|
||||||
|
|
||||||
protected $revisionID;
|
protected $revisionID;
|
||||||
protected $ownerPHID;
|
protected $authorPHID;
|
||||||
|
|
||||||
protected $sourceMachine;
|
protected $sourceMachine;
|
||||||
protected $sourcePath;
|
protected $sourcePath;
|
||||||
|
|
|
@ -27,7 +27,7 @@ class DifferentialRevision extends DifferentialDAO {
|
||||||
protected $blameRevision;
|
protected $blameRevision;
|
||||||
|
|
||||||
protected $phid;
|
protected $phid;
|
||||||
protected $ownerPHID;
|
protected $authorPHID;
|
||||||
|
|
||||||
protected $dateCommitted;
|
protected $dateCommitted;
|
||||||
|
|
||||||
|
@ -60,6 +60,15 @@ class DifferentialRevision extends DifferentialDAO {
|
||||||
$this->getID());
|
$this->getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function loadComments() {
|
||||||
|
if (!$this->getID()) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
return id(new DifferentialComment())->loadAllWhere(
|
||||||
|
'revisionID = %d',
|
||||||
|
$this->getID());
|
||||||
|
}
|
||||||
|
|
||||||
public function loadRelationships() {
|
public function loadRelationships() {
|
||||||
if (!$this->getID()) {
|
if (!$this->getID()) {
|
||||||
$this->relationships = array();
|
$this->relationships = array();
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/base');
|
phutil_require_module('phabricator', 'applications/differential/storage/base');
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/storage/comment');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
||||||
phutil_require_module('phabricator', 'applications/phid/storage/phid');
|
phutil_require_module('phabricator', 'applications/phid/storage/phid');
|
||||||
phutil_require_module('phabricator', 'storage/qsprintf');
|
phutil_require_module('phabricator', 'storage/qsprintf');
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
<?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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
final class DifferentialRevisionCommentView extends AphrontView {
|
||||||
|
|
||||||
|
private $comment;
|
||||||
|
private $handles;
|
||||||
|
|
||||||
|
public function setComment($comment) {
|
||||||
|
$this->comment = $comment;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setHandles(array $handles) {
|
||||||
|
$this->handles = $handles;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render() {
|
||||||
|
|
||||||
|
require_celerity_resource('differential-revision-comment-css');
|
||||||
|
|
||||||
|
$comment = $this->comment;
|
||||||
|
|
||||||
|
$action = $comment->getAction();
|
||||||
|
|
||||||
|
$action_class = 'differential-comment-action-'.phutil_escape_html($action);
|
||||||
|
|
||||||
|
$date = date('F jS, Y g:i:s A', $comment->getDateCreated());
|
||||||
|
|
||||||
|
$author = $comment->getAuthorPHID();
|
||||||
|
$author = $this->handles[$author]->renderLink();
|
||||||
|
|
||||||
|
$verb = DifferentialAction::getActionVerb($comment->getAction());
|
||||||
|
$verb = phutil_escape_html($verb);
|
||||||
|
|
||||||
|
$content = $comment->getContent();
|
||||||
|
if (strlen(rtrim($content))) {
|
||||||
|
$title = "{$author} {$verb} this revision:";
|
||||||
|
$content = phutil_escape_html($content);
|
||||||
|
} else {
|
||||||
|
$title = null;
|
||||||
|
$content =
|
||||||
|
'<div class="differential-comment-nocontent">'.
|
||||||
|
"<p>{$author} {$verb} this revision.</p>".
|
||||||
|
'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
'<div class="differential-comment '.$action_class.'">'.
|
||||||
|
'<div class="differential-comment-head">'.
|
||||||
|
'<div class="differential-comment-date">'.$date.'</div>'.
|
||||||
|
'<div class="differential-comment-title">'.$title.'</div>'.
|
||||||
|
'</div>'.
|
||||||
|
'<div class="differential-comment-body">'.
|
||||||
|
'<div class="differential-comment-core">'.
|
||||||
|
'<div class="differential-comment-content">'.
|
||||||
|
$content.
|
||||||
|
'</div>'.
|
||||||
|
'</div>'.
|
||||||
|
'</div>'.
|
||||||
|
'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is automatically generated. Lint this module to rebuild it.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/constants/action');
|
||||||
|
phutil_require_module('phabricator', 'infratructure/celerity/api');
|
||||||
|
phutil_require_module('phabricator', 'view/base');
|
||||||
|
|
||||||
|
phutil_require_module('phutil', 'markup');
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_source('DifferentialRevisionCommentView.php');
|
|
@ -0,0 +1,52 @@
|
||||||
|
<?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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
final class DifferentialRevisionCommentListView extends AphrontView {
|
||||||
|
|
||||||
|
private $comments;
|
||||||
|
private $handles;
|
||||||
|
|
||||||
|
public function setComments($comments) {
|
||||||
|
$this->comments = $comments;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setHandles(array $handles) {
|
||||||
|
$this->handles = $handles;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render() {
|
||||||
|
|
||||||
|
require_celerity_resource('differential-revision-comment-list-css');
|
||||||
|
|
||||||
|
$comments = array();
|
||||||
|
foreach ($this->comments as $comment) {
|
||||||
|
$view = new DifferentialRevisionCommentView();
|
||||||
|
$view->setComment($comment);
|
||||||
|
$view->setHandles($this->handles);
|
||||||
|
|
||||||
|
$comments[] = $view->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
'<div>'.
|
||||||
|
implode("\n", $comments).
|
||||||
|
'</div>';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is automatically generated. Lint this module to rebuild it.
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'applications/differential/view/revisioncomment');
|
||||||
|
phutil_require_module('phabricator', 'infratructure/celerity/api');
|
||||||
|
phutil_require_module('phabricator', 'view/base');
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_source('DifferentialRevisionCommentListView.php');
|
|
@ -28,7 +28,7 @@ final class AphrontRequestFailureView extends AphrontView {
|
||||||
|
|
||||||
final public function render() {
|
final public function render() {
|
||||||
require_celerity_resource('aphront-request-failure-view-css');
|
require_celerity_resource('aphront-request-failure-view-css');
|
||||||
|
|
||||||
return
|
return
|
||||||
'<div class="aphront-request-failure-view">'.
|
'<div class="aphront-request-failure-view">'.
|
||||||
'<div class="aphront-request-failure-head">'.
|
'<div class="aphront-request-failure-head">'.
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('phabricator', 'infratructure/celerity/api');
|
||||||
phutil_require_module('phabricator', 'view/base');
|
phutil_require_module('phabricator', 'view/base');
|
||||||
|
|
||||||
phutil_require_module('phutil', 'markup');
|
phutil_require_module('phutil', 'markup');
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
.phabricator-standard-page {
|
.phabricator-standard-page {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-bottom: 1px solid #888888;
|
border-bottom: 1px solid #888888;
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
-webkit-box-shadow: 0 0 6px #000;
|
-webkit-box-shadow: 0 0 6px #000;
|
||||||
-mox-box-shadow: 0 0 6px #000;
|
-mox-box-shadow: 0 0 6px #000;
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
/**
|
||||||
|
* @provides differential-revision-comment-list-css
|
||||||
|
*/
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* @provides differential-revision-comment-css
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
.differential-comment-date {
|
||||||
|
color: #666666;
|
||||||
|
float: right;
|
||||||
|
font-size: 11px;
|
||||||
|
margin: 0em;
|
||||||
|
padding-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.differential-comment-title {
|
||||||
|
font-weight: bold;
|
||||||
|
height: 16px;
|
||||||
|
margin: 4px 0em 0em 0em;
|
||||||
|
padding: 4px 0em;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.differential-comment-body {
|
||||||
|
min-height: 56px;
|
||||||
|
padding-left: 62px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: 6px 0px;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.differential-comment-content {
|
||||||
|
background: #fbfbfb;
|
||||||
|
border-color: #c3c3c3;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px 10px 1px 10px;
|
||||||
|
clear: both;
|
||||||
|
line-height: 1.4em;
|
||||||
|
margin: 0em;
|
||||||
|
padding: .3em 5px .4em 1.25em;
|
||||||
|
}
|
Loading…
Reference in a new issue