Page MenuHomePhabricator

D7648.diff
No OneTemporary

D7648.diff

Index: src/__phutil_library_map__.php
===================================================================
--- src/__phutil_library_map__.php
+++ src/__phutil_library_map__.php
@@ -621,6 +621,7 @@
'DoorkeeperRemarkupRule' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRule.php',
'DoorkeeperRemarkupRuleAsana' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleAsana.php',
'DoorkeeperRemarkupRuleJIRA' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleJIRA.php',
+ 'DoorkeeperTagView' => 'applications/doorkeeper/view/DoorkeeperTagView.php',
'DoorkeeperTagsController' => 'applications/doorkeeper/controller/DoorkeeperTagsController.php',
'DrydockAllocatorWorker' => 'applications/drydock/worker/DrydockAllocatorWorker.php',
'DrydockApacheWebrootInterface' => 'applications/drydock/interface/webroot/DrydockApacheWebrootInterface.php',
@@ -2944,6 +2945,7 @@
'DoorkeeperRemarkupRule' => 'PhutilRemarkupRule',
'DoorkeeperRemarkupRuleAsana' => 'DoorkeeperRemarkupRule',
'DoorkeeperRemarkupRuleJIRA' => 'DoorkeeperRemarkupRule',
+ 'DoorkeeperTagView' => 'AphrontView',
'DoorkeeperTagsController' => 'PhabricatorController',
'DrydockAllocatorWorker' => 'PhabricatorWorker',
'DrydockApacheWebrootInterface' => 'DrydockWebrootInterface',
Index: src/applications/differential/field/specification/DifferentialJIRAIssuesFieldSpecification.php
===================================================================
--- src/applications/differential/field/specification/DifferentialJIRAIssuesFieldSpecification.php
+++ src/applications/differential/field/specification/DifferentialJIRAIssuesFieldSpecification.php
@@ -58,16 +58,11 @@
$links = array();
foreach ($xobjs as $xobj) {
- $links[] = phutil_tag(
- 'a',
- array(
- 'href' => $xobj->getObjectURI(),
- 'target' => '_blank',
- ),
- $xobj->getObjectID());
+ $links[] = id(new DoorkeeperTagView())
+ ->setExternalObject($xobj);
}
- return phutil_implode_html(', ', $links);
+ return phutil_implode_html(phutil_tag('br'), $links);
}
public function shouldAppearOnConduitView() {
Index: src/applications/doorkeeper/view/DoorkeeperTagView.php
===================================================================
--- /dev/null
+++ src/applications/doorkeeper/view/DoorkeeperTagView.php
@@ -0,0 +1,42 @@
+<?php
+
+final class DoorkeeperTagView extends AphrontView {
+
+ private $xobj;
+
+ public function setExternalObject(DoorkeeperExternalObject $xobj) {
+ $this->xobj = $xobj;
+ return $this;
+ }
+
+ public function render() {
+ $xobj = $this->xobj;
+ if (!$xobj) {
+ throw new Exception('Call setExternalObject() before render()!');
+ }
+
+ $tag_id = celerity_generate_unique_node_id();
+
+ $href = $xobj->getObjectURI();
+
+ $spec = array(
+ 'id' => $tag_id,
+ 'ref' => array(
+ $xobj->getApplicationType(),
+ $xobj->getApplicationDomain(),
+ $xobj->getObjectType(),
+ $xobj->getObjectID(),
+ ),
+ );
+
+ Javelin::initBehavior('doorkeeper-tag', array('tags' => array($spec)));
+
+ return id(new PhabricatorTagView())
+ ->setID($tag_id)
+ ->setHref($href)
+ ->setName($href)
+ ->setType(PhabricatorTagView::TYPE_OBJECT)
+ ->setExternal(true);
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 11:41 PM (18 h, 45 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6916547
Default Alt Text
D7648.diff (3 KB)

Event Timeline