@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support field previews in EditEngine

Summary: Ref T10004. This primarily supports moving Phame to EditEngine.

Test Plan: {F1045166}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14887

+85 -34
+20 -20
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => 'a419cf4b', 11 - 'core.pkg.js' => '400453e4', 11 + 'core.pkg.js' => '57dff7df', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', 14 14 'differential.pkg.js' => '64e69521', ··· 487 487 'rsrc/js/core/behavior-object-selector.js' => '49b73b36', 488 488 'rsrc/js/core/behavior-oncopy.js' => '2926fff2', 489 489 'rsrc/js/core/behavior-phabricator-nav.js' => '56a1ca03', 490 - 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'ecddcbe2', 490 + 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'b60b6d9b', 491 491 'rsrc/js/core/behavior-refresh-csrf.js' => 'ab2f381b', 492 - 'rsrc/js/core/behavior-remarkup-preview.js' => 'f7379f45', 492 + 'rsrc/js/core/behavior-remarkup-preview.js' => '4b700e9e', 493 493 'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e', 494 494 'rsrc/js/core/behavior-reveal-content.js' => '60821bc7', 495 495 'rsrc/js/core/behavior-scrollbar.js' => '834a1173', ··· 640 640 'javelin-behavior-phabricator-notification-example' => '8ce821c5', 641 641 'javelin-behavior-phabricator-object-selector' => '49b73b36', 642 642 'javelin-behavior-phabricator-oncopy' => '2926fff2', 643 - 'javelin-behavior-phabricator-remarkup-assist' => 'ecddcbe2', 643 + 'javelin-behavior-phabricator-remarkup-assist' => 'b60b6d9b', 644 644 'javelin-behavior-phabricator-reveal-content' => '60821bc7', 645 645 'javelin-behavior-phabricator-search-typeahead' => '048330fa', 646 646 'javelin-behavior-phabricator-show-older-transactions' => 'dbbf48b6', ··· 662 662 'javelin-behavior-releeph-preview-branch' => 'b2b4fbaf', 663 663 'javelin-behavior-releeph-request-state-change' => 'a0b57eb8', 664 664 'javelin-behavior-releeph-request-typeahead' => 'de2e896f', 665 - 'javelin-behavior-remarkup-preview' => 'f7379f45', 665 + 'javelin-behavior-remarkup-preview' => '4b700e9e', 666 666 'javelin-behavior-reorder-applications' => '76b9fc3e', 667 667 'javelin-behavior-reorder-columns' => 'e1d25dfb', 668 668 'javelin-behavior-repository-crossreference' => 'e5339c43', ··· 1125 1125 'javelin-request', 1126 1126 'javelin-util', 1127 1127 ), 1128 + '4b700e9e' => array( 1129 + 'javelin-behavior', 1130 + 'javelin-dom', 1131 + 'javelin-util', 1132 + 'phabricator-shaped-request', 1133 + ), 1128 1134 '4e3e79a6' => array( 1129 1135 'javelin-behavior', 1130 1136 'javelin-stratcom', ··· 1721 1727 'javelin-dom', 1722 1728 'javelin-util', 1723 1729 ), 1730 + 'b60b6d9b' => array( 1731 + 'javelin-behavior', 1732 + 'javelin-stratcom', 1733 + 'javelin-dom', 1734 + 'phabricator-phtize', 1735 + 'phabricator-textareautils', 1736 + 'javelin-workflow', 1737 + 'javelin-vector', 1738 + ), 1724 1739 'b65559c0' => array( 1725 1740 'javelin-behavior', 1726 1741 'javelin-stratcom', ··· 1960 1975 'phabricator-phtize', 1961 1976 'javelin-dom', 1962 1977 ), 1963 - 'ecddcbe2' => array( 1964 - 'javelin-behavior', 1965 - 'javelin-stratcom', 1966 - 'javelin-dom', 1967 - 'phabricator-phtize', 1968 - 'phabricator-textareautils', 1969 - 'javelin-workflow', 1970 - 'javelin-vector', 1971 - ), 1972 1978 'edd1ba66' => array( 1973 1979 'javelin-behavior', 1974 1980 'javelin-stratcom', ··· 2004 2010 'javelin-reactornode', 2005 2011 'javelin-util', 2006 2012 'javelin-reactor', 2007 - ), 2008 - 'f7379f45' => array( 2009 - 'javelin-behavior', 2010 - 'javelin-dom', 2011 - 'javelin-util', 2012 - 'phabricator-shaped-request', 2013 2013 ), 2014 2014 'f7fc67ec' => array( 2015 2015 'javelin-install',
-7
src/applications/maniphest/application/PhabricatorManiphestApplication.php
··· 52 52 'task/' => array( 53 53 $this->getEditRoutePattern('edit/') 54 54 => 'ManiphestTaskEditController', 55 - 'descriptionpreview/' 56 - => 'PhabricatorMarkupPreviewController', 57 - ), 58 - 'transaction/' => array( 59 - 'save/' => 'ManiphestTransactionSaveController', 60 - 'preview/(?P<id>[1-9]\d*)/' 61 - => 'ManiphestTransactionPreviewController', 62 55 ), 63 56 'export/(?P<key>[^/]+)/' => 'ManiphestExportController', 64 57 'subpriority/' => 'ManiphestSubpriorityController',
+4 -1
src/applications/maniphest/editor/ManiphestEditEngine.php
··· 156 156 ->setConduitDescription(pht('Update the task description.')) 157 157 ->setConduitTypeDescription(pht('New task description.')) 158 158 ->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION) 159 - ->setValue($object->getDescription()), 159 + ->setValue($object->getDescription()) 160 + ->setPreviewPanel( 161 + id(new PHUIRemarkupPreviewPanel()) 162 + ->setHeader(pht('Description Preview'))), 160 163 ); 161 164 } 162 165
+2 -2
src/applications/transactions/controller/PhabricatorApplicationTransactionRemarkupPreviewController.php
··· 10 10 public function handleRequest(AphrontRequest $request) { 11 11 $viewer = $this->getViewer(); 12 12 13 - $corpus = $request->getStr('corpus'); 13 + $text = $request->getStr('text'); 14 14 15 - $remarkup = new PHUIRemarkupView($viewer, $corpus); 15 + $remarkup = new PHUIRemarkupView($viewer, $text); 16 16 17 17 $content = array( 18 18 'content' => hsprintf('%s', $remarkup),
+24 -1
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 962 962 $header_text = $this->getObjectEditTitleText($object); 963 963 } 964 964 965 + $show_preview = !$request->isAjax(); 966 + 967 + if ($show_preview) { 968 + $previews = array(); 969 + foreach ($fields as $field) { 970 + $preview = $field->getPreviewPanel(); 971 + if (!$preview) { 972 + continue; 973 + } 974 + 975 + $control_id = $field->getControlID(); 976 + 977 + $preview 978 + ->setControlID($control_id) 979 + ->setPreviewURI('/transactions/remarkuppreview/'); 980 + 981 + $previews[] = $preview; 982 + } 983 + } else { 984 + $previews = array(); 985 + } 986 + 965 987 $form = $this->buildEditForm($object, $fields); 966 988 967 989 if ($request->isAjax()) { ··· 998 1020 return $controller->newPage() 999 1021 ->setTitle($header_text) 1000 1022 ->setCrumbs($crumbs) 1001 - ->appendChild($box); 1023 + ->appendChild($box) 1024 + ->appendChild($previews); 1002 1025 } 1003 1026 1004 1027 protected function newEditResponse(
+22
src/applications/transactions/editfield/PhabricatorEditField.php
··· 14 14 private $metadata = array(); 15 15 private $editTypeKey; 16 16 private $isRequired; 17 + private $previewPanel; 18 + private $controlID; 17 19 18 20 private $description; 19 21 private $conduitDescription; ··· 251 253 return $this->commentActionValue; 252 254 } 253 255 256 + public function setPreviewPanel(PHUIRemarkupPreviewPanel $preview_panel) { 257 + $this->previewPanel = $preview_panel; 258 + return $this; 259 + } 260 + 261 + public function getPreviewPanel() { 262 + return $this->previewPanel; 263 + } 264 + 254 265 protected function newControl() { 255 266 throw new PhutilMethodNotImplementedException(); 256 267 } ··· 285 296 return $control; 286 297 } 287 298 299 + public function getControlID() { 300 + if (!$this->controlID) { 301 + $this->controlID = celerity_generate_unique_node_id(); 302 + } 303 + return $this->controlID; 304 + } 305 + 288 306 protected function renderControl() { 289 307 $control = $this->buildControl(); 290 308 if ($control === null) { ··· 307 325 } 308 326 309 327 $control->setDisabled($disabled); 328 + 329 + if ($this->controlID) { 330 + $control->setID($this->controlID); 331 + } 310 332 311 333 return $control; 312 334 }
+1 -1
webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
··· 254 254 var value = area.value; 255 255 256 256 var data = { 257 - corpus: value 257 + text: value 258 258 }; 259 259 260 260 var onupdate = function(r) {
+12 -2
webroot/rsrc/js/core/behavior-remarkup-preview.js
··· 8 8 9 9 JX.behavior('remarkup-preview', function(config) { 10 10 11 + // Don't bother with any of this on mobile. 12 + if (JX.Device.getDevice() !== 'desktop') { 13 + return; 14 + } 15 + 11 16 var preview = JX.$(config.previewID); 12 17 var control = JX.$(config.controlID); 13 18 14 19 var callback = function(r) { 15 - JX.DOM.setContent(preview, JX.$H(r)); 20 + // This currently accepts responses from two controllers: 21 + // Old: PhabricatorMarkupPreviewController 22 + // New: PhabricatorApplicationTransactionRemarkupPreviewController 23 + // TODO: Swap everything to just the new controller. 24 + 25 + JX.DOM.setContent(preview, JX.$H(r.content || r)); 16 26 }; 17 27 18 28 var getdata = function() { 19 29 return { 20 - text : control.value 30 + text: control.value 21 31 }; 22 32 }; 23 33