Skip to content

Commit b5df5af

Browse files
author
epriestley
committed
Link to Herald transcripts from Herald transactions
Summary: See IRC. Some users are having difficulty figuring out why Herald is taking some actions. Make it easier to get to the transcript. Test Plan: {F144622} Reviewers: btrahan, chad Reviewed By: chad Subscribers: dctrwatson, epriestley Differential Revision: https://secure.phabricator.com/D8804
1 parent e49251e commit b5df5af

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed

resources/celerity/map.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
'rsrc/css/phui/phui-status.css' => '2f562399',
148148
'rsrc/css/phui/phui-tag-view.css' => '295d81c4',
149149
'rsrc/css/phui/phui-text.css' => '23e9b4b7',
150-
'rsrc/css/phui/phui-timeline-view.css' => '23fe340a',
150+
'rsrc/css/phui/phui-timeline-view.css' => '17905388',
151151
'rsrc/css/phui/phui-workboard-view.css' => '84f2c272',
152152
'rsrc/css/phui/phui-workpanel-view.css' => '97b69459',
153153
'rsrc/css/sprite-actions.css' => '969ad0e5',
@@ -762,7 +762,7 @@
762762
'phui-status-list-view-css' => '2f562399',
763763
'phui-tag-view-css' => '295d81c4',
764764
'phui-text-css' => '23e9b4b7',
765-
'phui-timeline-view-css' => '23fe340a',
765+
'phui-timeline-view-css' => '17905388',
766766
'phui-workboard-view-css' => '84f2c272',
767767
'phui-workpanel-view-css' => '97b69459',
768768
'policy-css' => '957ea14c',

src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,11 @@ final public function applyTransactions(
661661
$herald_xactions = $this->applyHeraldRules($object, $xactions);
662662

663663
if ($herald_xactions) {
664+
$xscript_id = $this->getHeraldTranscript()->getID();
665+
foreach ($herald_xactions as $herald_xaction) {
666+
$herald_xaction->setMetadataValue('herald:transcriptID', $xscript_id);
667+
}
668+
664669
// NOTE: We're acting as the omnipotent user because rules deal with
665670
// their own policy issues. We use a synthetic author PHID (the
666671
// Herald application) as the author of record, so that transactions

src/applications/transactions/storage/PhabricatorApplicationTransaction.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,21 @@ public function shouldDisplayGroupWith(array $group) {
757757
return true;
758758
}
759759

760+
public function renderExtraInformationLink() {
761+
$herald_xscript_id = $this->getMetadataValue('herald:transcriptID');
762+
763+
if ($herald_xscript_id) {
764+
return phutil_tag(
765+
'a',
766+
array(
767+
'href' => '/herald/transcript/'.$herald_xscript_id.'/',
768+
),
769+
pht('View Herald Transcript'));
770+
}
771+
772+
return null;
773+
}
774+
760775

761776
/* -( PhabricatorPolicyInterface Implementation )-------------------------- */
762777

src/applications/transactions/view/PhabricatorApplicationTransactionView.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,22 @@ private function buildChangeDetailsLink(
190190
pht('(Show Details)'));
191191
}
192192

193+
private function buildExtraInformationLink(
194+
PhabricatorApplicationTransaction $xaction) {
195+
196+
$link = $xaction->renderExtraInformationLink();
197+
if (!$link) {
198+
return null;
199+
}
200+
201+
return phutil_tag(
202+
'span',
203+
array(
204+
'class' => 'phui-timeline-extra-information',
205+
),
206+
array(" \xC2\xB7 ", $link));
207+
}
208+
193209
protected function shouldGroupTransactions(
194210
PhabricatorApplicationTransaction $u,
195211
PhabricatorApplicationTransaction $v) {
@@ -313,6 +329,14 @@ private function renderEvent(
313329
);
314330
}
315331
}
332+
333+
if (!$this->isPreview) {
334+
$more = $this->buildExtraInformationLink($xaction);
335+
if ($more) {
336+
$title = array($title, ' ', $more);
337+
}
338+
}
339+
316340
$event->setTitle($title);
317341
}
318342

webroot/rsrc/css/phui/phui-timeline-view.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,3 +307,9 @@
307307
.device-phone .phui-timeline-older-transactions-are-hidden {
308308
margin: 0 8px;
309309
}
310+
311+
312+
.phui-timeline-title .phui-timeline-extra-information a {
313+
font-weight: normal;
314+
color: {$bluetext};
315+
}

0 commit comments

Comments
 (0)