diff --git a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php index da731e6ffb..b8e3f683bf 100644 --- a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php @@ -313,6 +313,12 @@ class DifferentialRevisionViewController extends DifferentialController { 'href' => "/mail/?phid={$revision_phid}", ); + $links[] = array( + 'class' => 'transcripts-herald', + 'name' => 'Herald Transcripts', + 'href' => "/herald/transcript/?phid={$revision_phid}", + ); + return $links; } diff --git a/src/applications/herald/controller/transcriptlist/HeraldTranscriptListController.php b/src/applications/herald/controller/transcriptlist/HeraldTranscriptListController.php index bf409bb307..1e07887b4f 100644 --- a/src/applications/herald/controller/transcriptlist/HeraldTranscriptListController.php +++ b/src/applications/herald/controller/transcriptlist/HeraldTranscriptListController.php @@ -24,12 +24,26 @@ class HeraldTranscriptListController extends HeraldController { // Pull these objects manually since the serialized fields are gigantic. $transcript = new HeraldTranscript(); + + $conn_r = $transcript->establishConnection('r'); + $phid = $request->getStr('phid'); + $where_clause = ''; + if ($phid) { + $where_clause = qsprintf( + $conn_r, + 'WHERE objectPHID = %s', + $phid + ); + } + $data = queryfx_all( - $transcript->establishConnection('r'), + $conn_r, 'SELECT id, objectPHID, time, duration, dryRun FROM %T + %Q ORDER BY id DESC LIMIT 100', - $transcript->getTableName()); + $transcript->getTableName(), + $where_clause); /* diff --git a/src/applications/herald/controller/transcriptlist/__init__.php b/src/applications/herald/controller/transcriptlist/__init__.php index 5a799e96f2..3a574f58ed 100644 --- a/src/applications/herald/controller/transcriptlist/__init__.php +++ b/src/applications/herald/controller/transcriptlist/__init__.php @@ -9,6 +9,7 @@ phutil_require_module('phabricator', 'applications/herald/controller/base'); phutil_require_module('phabricator', 'applications/herald/storage/transcript/base'); phutil_require_module('phabricator', 'applications/phid/handle/data'); +phutil_require_module('phabricator', 'storage/qsprintf'); phutil_require_module('phabricator', 'storage/queryfx'); phutil_require_module('phabricator', 'view/control/table'); phutil_require_module('phabricator', 'view/layout/panel'); diff --git a/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php b/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php index fd0b6bd60c..2d93fd140d 100644 --- a/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php +++ b/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php @@ -19,8 +19,16 @@ class PhabricatorMetaMTAListController extends PhabricatorMetaMTAController { public function processRequest() { - $mails = id(new PhabricatorMetaMTAMail())->loadAllWhere( - '1 = 1 ORDER BY id DESC LIMIT 100'); + $related_phid = $this->getRequest()->getStr('phid'); + + if ($related_phid) { + $mails = id(new PhabricatorMetaMTAMail())->loadAllWhere( + 'relatedPHID = %s ORDER BY id DESC LIMIT 100', + $related_phid); + } else { + $mails = id(new PhabricatorMetaMTAMail())->loadAllWhere( + '1 = 1 ORDER BY id DESC LIMIT 100'); + } $rows = array(); foreach ($mails as $mail) { diff --git a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php index d6e489e372..a5cf8a0355 100644 --- a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php @@ -134,6 +134,36 @@ class PhabricatorObjectHandleData { $handles[$phid] = $handle; } break; + case PhabricatorPHIDConstants::PHID_TYPE_CMIT: + $class = 'PhabricatorRepositoryCommit'; + PhutilSymbolLoader::loadClass($class); + $object = newv($class, array()); + + $commits = $object->loadAllWhere('phid in (%Ls)', $phids); + $commits = mpull($commits, null, 'getPHID'); + + $repository_ids = mpull($commits, 'getRepositoryID'); + $repositories = id(new PhabricatorRepository())->loadAllWhere( + 'id in (%Ld)', array_unique($repository_ids)); + $callsigns = mpull($repositories, 'getCallsign'); + + foreach ($phids as $phid) { + $handle = new PhabricatorObjectHandle(); + $handle->setPHID($phid); + $handle->setType($type); + if (empty($commits[$phid])) { + $handle->setName('Unknown Commit'); + } else { + $commit = $commits[$phid]; + $callsign = $callsigns[$repository_ids[$phid]]; + $commit_identifier = $commit->getCommitIdentifier(); + $handle->setName('Commit '.'r'.$callsign.$commit_identifier); + $handle->setURI('/r'.$callsign.$commit_identifier); + $handle->setFullName('r'.$callsign.$commit_identifier); + } + $handles[$phid] = $handle; + } + break; case PhabricatorPHIDConstants::PHID_TYPE_TASK: $class = 'ManiphestTask'; PhutilSymbolLoader::loadClass($class); diff --git a/src/applications/phid/handle/data/__init__.php b/src/applications/phid/handle/data/__init__.php index 119c32a871..5c37c9777c 100644 --- a/src/applications/phid/handle/data/__init__.php +++ b/src/applications/phid/handle/data/__init__.php @@ -9,6 +9,7 @@ phutil_require_module('phabricator', 'applications/files/uri'); phutil_require_module('phabricator', 'applications/phid/constants'); phutil_require_module('phabricator', 'applications/phid/handle'); +phutil_require_module('phabricator', 'applications/repository/storage/repository'); phutil_require_module('phabricator', 'infrastructure/env'); phutil_require_module('phutil', 'symbols'); diff --git a/webroot/rsrc/css/aphront/headsup-action-list-view.css b/webroot/rsrc/css/aphront/headsup-action-list-view.css index 9c6de3580b..938a3258b7 100644 --- a/webroot/rsrc/css/aphront/headsup-action-list-view.css +++ b/webroot/rsrc/css/aphront/headsup-action-list-view.css @@ -50,4 +50,9 @@ .aphront-headsup-action-list .transcripts-metamta { background-image: url(/rsrc/image/icon/tango/log.png); -} \ No newline at end of file +} + +.aphront-headsup-action-list .transcripts-herald { + background-image: url(/rsrc/image/icon/tango/log.png); +} + diff --git a/webroot/rsrc/css/application/differential/revision-detail.css b/webroot/rsrc/css/application/differential/revision-detail.css index daacd1018e..953742f17e 100644 --- a/webroot/rsrc/css/application/differential/revision-detail.css +++ b/webroot/rsrc/css/application/differential/revision-detail.css @@ -28,46 +28,3 @@ margin-right: 265px; } - -.differential-revision-actions { - float: right; - width: 250px; - background: #cfcfbf; - border: 1px solid #666622; - border-width: 0px 0px 1px 1px; - margin: -15px -20px 1em 0; - font-size: 11px; -} - -.differential-revision-actions a, -.differential-revision-actions span { - background-position: 8px center; - background-repeat: no-repeat; - display: block; - padding: 4px 4px 4px 32px; -} - -.differential-revision-actions span.unavailable { - color: #666666; - font-style: italic; -} - -.differential-revision-actions .subscribe-rem { - background-image: url(/rsrc/image/icon/unsubscribe.png); -} - -.differential-revision-actions .subscribe-add { - background-image: url(/rsrc/image/icon/subscribe.png); -} - -.differential-revision-actions .revision-edit { - background-image: url(/rsrc/image/icon/tango/edit.png); -} - -.differential-revision-actions .attach-maniphest { - background-image: url(/rsrc/image/icon/tango/attachment.png); -} - -.differential-revision-actions .transcripts-metamta { - background-image: url(/rsrc/image/icon/tango/log.png); -}