@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.

Have TransactionComments return a PHUIObjectBoxView

Summary: Simplifies the code a bit and fixes all the wonky previews. Fixes T4053

Test Plan: Test all pages, logged in and logged out.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T4053

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

+110 -154
+47 -47
src/__celerity_resource_map__.php
··· 1982 1982 ), 1983 1983 'javelin-behavior-passphrase-credential-control' => 1984 1984 array( 1985 - 'uri' => '/res/b599c028/rsrc/js/application/passphrase/phame-credential-control.js', 1985 + 'uri' => '/res/e606ad52/rsrc/js/application/passphrase/phame-credential-control.js', 1986 1986 'type' => 'js', 1987 1987 'requires' => 1988 1988 array( ··· 3882 3882 ), 3883 3883 'phui-form-view-css' => 3884 3884 array( 3885 - 'uri' => '/res/3621b05d/rsrc/css/phui/phui-form-view.css', 3885 + 'uri' => '/res/c77cb7c8/rsrc/css/phui/phui-form-view.css', 3886 3886 'type' => 'css', 3887 3887 'requires' => 3888 3888 array( ··· 4342 4342 ), array( 4343 4343 'packages' => 4344 4344 array( 4345 - '68d2c78c' => 4345 + '7bc8b0c9' => 4346 4346 array( 4347 4347 'name' => 'core.pkg.css', 4348 4348 'symbols' => ··· 4391 4391 41 => 'phabricator-tag-view-css', 4392 4392 42 => 'phui-list-view-css', 4393 4393 ), 4394 - 'uri' => '/res/pkg/68d2c78c/core.pkg.css', 4394 + 'uri' => '/res/pkg/7bc8b0c9/core.pkg.css', 4395 4395 'type' => 'css', 4396 4396 ), 4397 4397 '2c1dba03' => ··· 4583 4583 ), 4584 4584 'reverse' => 4585 4585 array( 4586 - 'aphront-dialog-view-css' => '68d2c78c', 4587 - 'aphront-error-view-css' => '68d2c78c', 4588 - 'aphront-list-filter-view-css' => '68d2c78c', 4589 - 'aphront-pager-view-css' => '68d2c78c', 4590 - 'aphront-panel-view-css' => '68d2c78c', 4591 - 'aphront-table-view-css' => '68d2c78c', 4592 - 'aphront-tokenizer-control-css' => '68d2c78c', 4593 - 'aphront-tooltip-css' => '68d2c78c', 4594 - 'aphront-typeahead-control-css' => '68d2c78c', 4586 + 'aphront-dialog-view-css' => '7bc8b0c9', 4587 + 'aphront-error-view-css' => '7bc8b0c9', 4588 + 'aphront-list-filter-view-css' => '7bc8b0c9', 4589 + 'aphront-pager-view-css' => '7bc8b0c9', 4590 + 'aphront-panel-view-css' => '7bc8b0c9', 4591 + 'aphront-table-view-css' => '7bc8b0c9', 4592 + 'aphront-tokenizer-control-css' => '7bc8b0c9', 4593 + 'aphront-tooltip-css' => '7bc8b0c9', 4594 + 'aphront-typeahead-control-css' => '7bc8b0c9', 4595 4595 'differential-changeset-view-css' => '1084b12b', 4596 4596 'differential-core-view-css' => '1084b12b', 4597 4597 'differential-inline-comment-editor' => '5e9e5c4e', ··· 4605 4605 'differential-table-of-contents-css' => '1084b12b', 4606 4606 'diffusion-commit-view-css' => '7aa115b4', 4607 4607 'diffusion-icons-css' => '7aa115b4', 4608 - 'global-drag-and-drop-css' => '68d2c78c', 4608 + 'global-drag-and-drop-css' => '7bc8b0c9', 4609 4609 'inline-comment-summary-css' => '1084b12b', 4610 4610 'javelin-aphlict' => '2c1dba03', 4611 4611 'javelin-behavior' => '3e3be199', ··· 4680 4680 'javelin-util' => '3e3be199', 4681 4681 'javelin-vector' => '3e3be199', 4682 4682 'javelin-workflow' => '3e3be199', 4683 - 'lightbox-attachment-css' => '68d2c78c', 4683 + 'lightbox-attachment-css' => '7bc8b0c9', 4684 4684 'maniphest-task-summary-css' => '49898640', 4685 - 'phabricator-action-list-view-css' => '68d2c78c', 4686 - 'phabricator-application-launch-view-css' => '68d2c78c', 4685 + 'phabricator-action-list-view-css' => '7bc8b0c9', 4686 + 'phabricator-application-launch-view-css' => '7bc8b0c9', 4687 4687 'phabricator-busy' => '2c1dba03', 4688 4688 'phabricator-content-source-view-css' => '1084b12b', 4689 - 'phabricator-core-css' => '68d2c78c', 4690 - 'phabricator-crumbs-view-css' => '68d2c78c', 4689 + 'phabricator-core-css' => '7bc8b0c9', 4690 + 'phabricator-crumbs-view-css' => '7bc8b0c9', 4691 4691 'phabricator-drag-and-drop-file-upload' => '5e9e5c4e', 4692 4692 'phabricator-dropdown-menu' => '2c1dba03', 4693 4693 'phabricator-file-upload' => '2c1dba03', 4694 - 'phabricator-filetree-view-css' => '68d2c78c', 4695 - 'phabricator-flag-css' => '68d2c78c', 4694 + 'phabricator-filetree-view-css' => '7bc8b0c9', 4695 + 'phabricator-flag-css' => '7bc8b0c9', 4696 4696 'phabricator-hovercard' => '2c1dba03', 4697 - 'phabricator-jump-nav' => '68d2c78c', 4697 + 'phabricator-jump-nav' => '7bc8b0c9', 4698 4698 'phabricator-keyboard-shortcut' => '2c1dba03', 4699 4699 'phabricator-keyboard-shortcut-manager' => '2c1dba03', 4700 - 'phabricator-main-menu-view' => '68d2c78c', 4700 + 'phabricator-main-menu-view' => '7bc8b0c9', 4701 4701 'phabricator-menu-item' => '2c1dba03', 4702 - 'phabricator-nav-view-css' => '68d2c78c', 4702 + 'phabricator-nav-view-css' => '7bc8b0c9', 4703 4703 'phabricator-notification' => '2c1dba03', 4704 - 'phabricator-notification-css' => '68d2c78c', 4705 - 'phabricator-notification-menu-css' => '68d2c78c', 4704 + 'phabricator-notification-css' => '7bc8b0c9', 4705 + 'phabricator-notification-menu-css' => '7bc8b0c9', 4706 4706 'phabricator-object-selector-css' => '1084b12b', 4707 4707 'phabricator-phtize' => '2c1dba03', 4708 4708 'phabricator-prefab' => '2c1dba03', 4709 4709 'phabricator-project-tag-css' => '49898640', 4710 - 'phabricator-remarkup-css' => '68d2c78c', 4710 + 'phabricator-remarkup-css' => '7bc8b0c9', 4711 4711 'phabricator-shaped-request' => '5e9e5c4e', 4712 - 'phabricator-side-menu-view-css' => '68d2c78c', 4713 - 'phabricator-standard-page-view' => '68d2c78c', 4714 - 'phabricator-tag-view-css' => '68d2c78c', 4712 + 'phabricator-side-menu-view-css' => '7bc8b0c9', 4713 + 'phabricator-standard-page-view' => '7bc8b0c9', 4714 + 'phabricator-tag-view-css' => '7bc8b0c9', 4715 4715 'phabricator-textareautils' => '2c1dba03', 4716 4716 'phabricator-tooltip' => '2c1dba03', 4717 - 'phabricator-transaction-view-css' => '68d2c78c', 4718 - 'phabricator-zindex-css' => '68d2c78c', 4719 - 'phui-button-css' => '68d2c78c', 4720 - 'phui-form-css' => '68d2c78c', 4721 - 'phui-form-view-css' => '68d2c78c', 4722 - 'phui-header-view-css' => '68d2c78c', 4723 - 'phui-icon-view-css' => '68d2c78c', 4724 - 'phui-list-view-css' => '68d2c78c', 4725 - 'phui-object-item-list-view-css' => '68d2c78c', 4726 - 'phui-property-list-view-css' => '68d2c78c', 4727 - 'phui-spacing-css' => '68d2c78c', 4728 - 'sprite-apps-large-css' => '68d2c78c', 4729 - 'sprite-gradient-css' => '68d2c78c', 4730 - 'sprite-icons-css' => '68d2c78c', 4731 - 'sprite-menu-css' => '68d2c78c', 4732 - 'sprite-status-css' => '68d2c78c', 4733 - 'syntax-highlighting-css' => '68d2c78c', 4717 + 'phabricator-transaction-view-css' => '7bc8b0c9', 4718 + 'phabricator-zindex-css' => '7bc8b0c9', 4719 + 'phui-button-css' => '7bc8b0c9', 4720 + 'phui-form-css' => '7bc8b0c9', 4721 + 'phui-form-view-css' => '7bc8b0c9', 4722 + 'phui-header-view-css' => '7bc8b0c9', 4723 + 'phui-icon-view-css' => '7bc8b0c9', 4724 + 'phui-list-view-css' => '7bc8b0c9', 4725 + 'phui-object-item-list-view-css' => '7bc8b0c9', 4726 + 'phui-property-list-view-css' => '7bc8b0c9', 4727 + 'phui-spacing-css' => '7bc8b0c9', 4728 + 'sprite-apps-large-css' => '7bc8b0c9', 4729 + 'sprite-gradient-css' => '7bc8b0c9', 4730 + 'sprite-icons-css' => '7bc8b0c9', 4731 + 'sprite-menu-css' => '7bc8b0c9', 4732 + 'sprite-status-css' => '7bc8b0c9', 4733 + 'syntax-highlighting-css' => '7bc8b0c9', 4734 4734 ), 4735 4735 ));
+5 -11
src/applications/files/controller/PhabricatorFileInfoController.php
··· 94 94 95 95 $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 96 96 97 - $add_comment_header = id(new PHUIHeaderView()) 98 - ->setHeader( 99 - $is_serious 100 - ? pht('Add Comment') 101 - : pht('Question File Integrity')); 97 + $add_comment_header = $is_serious 98 + ? pht('Add Comment') 99 + : pht('Question File Integrity'); 102 100 103 101 $submit_button_name = $is_serious 104 102 ? pht('Add Comment') ··· 110 108 ->setUser($user) 111 109 ->setObjectPHID($file->getPHID()) 112 110 ->setDraft($draft) 111 + ->setHeaderText($add_comment_header) 113 112 ->setAction($this->getApplicationURI('/comment/'.$file->getID().'/')) 114 113 ->setSubmitButtonName($submit_button_name); 115 114 116 - $comment_box = id(new PHUIObjectBoxView()) 117 - ->setFlush(true) 118 - ->setHeader($add_comment_header) 119 - ->appendChild($add_comment_form); 120 - 121 115 return array( 122 116 $timeline, 123 - $comment_box); 117 + $add_comment_form); 124 118 } 125 119 126 120 private function buildActionView(PhabricatorFile $file) {
+2 -7
src/applications/legalpad/controller/LegalpadDocumentViewController.php
··· 196 196 ? pht('Add Comment') 197 197 : pht('Debate Legislation'); 198 198 199 - $header = id(new PHUIHeaderView()) 200 - ->setHeader($title); 201 - 202 199 $button_name = $is_serious 203 200 ? pht('Add Comment') 204 201 : pht('Commence Filibuster'); ··· 207 204 ->setUser($user) 208 205 ->setObjectPHID($document->getPHID()) 209 206 ->setFormID($comment_form_id) 207 + ->setHeaderText($title) 210 208 ->setDraft($draft) 211 209 ->setSubmitButtonName($button_name) 212 210 ->setAction($this->getApplicationURI('/comment/'.$document->getID().'/')) 213 211 ->setRequestURI($this->getRequest()->getRequestURI()); 214 212 215 - return id(new PHUIObjectBoxView()) 216 - ->setFlush(true) 217 - ->setHeader($header) 218 - ->appendChild($form); 213 + return $form; 219 214 220 215 } 221 216
+5 -11
src/applications/macro/controller/PhabricatorMacroViewController.php
··· 84 84 85 85 $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 86 86 87 - $add_comment_header = id(new PHUIHeaderView()) 88 - ->setHeader( 89 - $is_serious 90 - ? pht('Add Comment') 91 - : pht('Grovel in Awe')); 87 + $comment_header = $is_serious 88 + ? pht('Add Comment') 89 + : pht('Grovel in Awe'); 92 90 93 91 $submit_button_name = $is_serious 94 92 ? pht('Add Comment') ··· 100 98 ->setUser($user) 101 99 ->setObjectPHID($macro->getPHID()) 102 100 ->setDraft($draft) 101 + ->setHeaderText($comment_header) 103 102 ->setAction($this->getApplicationURI('/comment/'.$macro->getID().'/')) 104 103 ->setSubmitButtonName($submit_button_name); 105 104 ··· 111 110 $object_box->addPropertyList($file_view); 112 111 } 113 112 114 - $comment_box = id(new PHUIObjectBoxView()) 115 - ->setFlush(true) 116 - ->setHeader($add_comment_header) 117 - ->appendChild($add_comment_form); 118 - 119 113 return $this->buildApplicationPage( 120 114 array( 121 115 $crumbs, 122 116 $object_box, 123 117 $timeline, 124 - $comment_box, 118 + $add_comment_form, 125 119 ), 126 120 array( 127 121 'title' => $title_short,
+4 -3
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 345 345 )); 346 346 } 347 347 348 - $comment_header = id(new PHUIHeaderView()) 349 - ->setHeader($is_serious ? pht('Add Comment') : pht('Weigh In')); 348 + $comment_header = $is_serious 349 + ? pht('Add Comment') 350 + : pht('Weigh In'); 350 351 351 352 $preview_panel = phutil_tag_div( 352 353 'aphront-panel-preview', ··· 397 398 398 399 $comment_box = id(new PHUIObjectBoxView()) 399 400 ->setFlush(true) 400 - ->setHeader($comment_header) 401 + ->setHeaderText($comment_header) 401 402 ->appendChild($comment_form); 402 403 403 404 return $this->buildApplicationPage(
+5 -11
src/applications/paste/controller/PhabricatorPasteViewController.php
··· 117 117 118 118 $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 119 119 120 - $add_comment_header = id(new PHUIHeaderView()) 121 - ->setHeader( 122 - $is_serious 123 - ? pht('Add Comment') 124 - : pht('Debate Paste Accuracy')); 120 + $add_comment_header = $is_serious 121 + ? pht('Add Comment') 122 + : pht('Debate Paste Accuracy'); 125 123 126 124 $submit_button_name = $is_serious 127 125 ? pht('Add Comment') ··· 133 131 ->setUser($user) 134 132 ->setObjectPHID($paste->getPHID()) 135 133 ->setDraft($draft) 134 + ->setHeaderText($add_comment_header) 136 135 ->setAction($this->getApplicationURI('/comment/'.$paste->getID().'/')) 137 136 ->setSubmitButtonName($submit_button_name); 138 137 139 - $comment_box = id(new PHUIObjectBoxView()) 140 - ->setFlush(true) 141 - ->setHeader($add_comment_header) 142 - ->appendChild($add_comment_form); 143 - 144 138 return $this->buildApplicationPage( 145 139 array( 146 140 $crumbs, 147 141 $object_box, 148 142 $source_code, 149 143 $timeline, 150 - $comment_box, 144 + $add_comment_form, 151 145 ), 152 146 array( 153 147 'title' => $paste->getFullName(),
+2 -7
src/applications/pholio/controller/PholioMockViewController.php
··· 239 239 ? pht('Add Comment') 240 240 : pht('History Beckons'); 241 241 242 - $header = id(new PHUIHeaderView()) 243 - ->setHeader($title); 244 - 245 242 $button_name = $is_serious 246 243 ? pht('Add Comment') 247 244 : pht('Answer The Call'); ··· 251 248 ->setObjectPHID($mock->getPHID()) 252 249 ->setFormID($comment_form_id) 253 250 ->setDraft($draft) 251 + ->setHeaderText($title) 254 252 ->setSubmitButtonName($button_name) 255 253 ->setAction($this->getApplicationURI('/comment/'.$mock->getID().'/')) 256 254 ->setRequestURI($this->getRequest()->getRequestURI()); 257 255 258 - return id(new PHUIObjectBoxView()) 259 - ->setFlush(true) 260 - ->setHeader($header) 261 - ->appendChild($form); 256 + return $form; 262 257 } 263 258 264 259 }
+4 -12
src/applications/ponder/controller/PonderQuestionViewController.php
··· 210 210 ->setUser($viewer) 211 211 ->setObjectPHID($question->getPHID()) 212 212 ->setShowPreview(false) 213 + ->setHeaderText(pht('Question Comment')) 213 214 ->setAction($this->getApplicationURI("/question/comment/{$id}/")) 214 215 ->setSubmitButtonName(pht('Comment')); 215 216 216 - $object_box = id(new PHUIObjectBoxView()) 217 - ->setFlush(true) 218 - ->setHeaderText(pht('Question Comment')) 219 - ->appendChild($add_comment); 220 - 221 217 return $this->wrapComments( 222 218 count($xactions), 223 219 array( 224 220 $timeline, 225 - $object_box, 221 + $add_comment, 226 222 )); 227 223 } 228 224 ··· 286 282 ->setUser($viewer) 287 283 ->setObjectPHID($answer->getPHID()) 288 284 ->setShowPreview(false) 285 + ->setHeaderText(pht('Answer Comment')) 289 286 ->setAction($this->getApplicationURI("/answer/comment/{$id}/")) 290 287 ->setSubmitButtonName(pht('Comment')); 291 288 292 - $comment_box = id(new PHUIObjectBoxView()) 293 - ->setFlush(true) 294 - ->setHeaderText(pht('Answer Comment')) 295 - ->appendChild($form); 296 - 297 - $details[] = $comment_box; 289 + $details[] = $form; 298 290 299 291 $out[] = $this->wrapComments( 300 292 count($xactions),
+6 -7
src/applications/releeph/controller/request/ReleephRequestViewController.php
··· 54 54 ->setTransactions($xactions) 55 55 ->setMarkupEngine($engine); 56 56 57 - $add_comment_header = id(new PHUIHeaderView()) 58 - ->setHeader('Plea or yield'); 57 + $add_comment_header = pht('Plea or yield'); 59 58 60 59 $draft = PhabricatorDraft::newFromUserAndKey( 61 60 $user, 62 61 $releeph_request->getPHID()); 63 62 63 + $title = hsprintf("RQ%d: %s", 64 + $releeph_request->getID(), 65 + $releeph_request->getSummaryForDisplay()); 66 + 64 67 $add_comment_form = id(new PhabricatorApplicationTransactionCommentView()) 65 68 ->setUser($user) 66 69 ->setObjectPHID($releeph_request->getPHID()) 67 70 ->setDraft($draft) 71 + ->setHeaderText($add_comment_header) 68 72 ->setAction($this->getApplicationURI( 69 73 '/request/comment/'.$releeph_request->getID().'/')) 70 74 ->setSubmitButtonName('Comment'); 71 - 72 - $title = hsprintf("RQ%d: %s", 73 - $releeph_request->getID(), 74 - $releeph_request->getSummaryForDisplay()); 75 75 76 76 $crumbs = $this->buildApplicationCrumbs() 77 77 ->addCrumb( ··· 93 93 array( 94 94 $rq_view, 95 95 $timeline, 96 - $add_comment_header, 97 96 $add_comment_form, 98 97 ) 99 98 ),
+5 -11
src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
··· 162 162 163 163 $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 164 164 165 - $add_comment_header = id(new PHUIHeaderView()) 166 - ->setHeader( 167 - $is_serious 168 - ? pht('Add Comment') 169 - : pht('Enter Deliberations')); 165 + $add_comment_header = $is_serious 166 + ? pht('Add Comment') 167 + : pht('Enter Deliberations'); 170 168 171 169 $submit_button_name = $is_serious 172 170 ? pht('Add Comment') ··· 174 172 175 173 $draft = PhabricatorDraft::newFromUserAndKey($viewer, $poll->getPHID()); 176 174 177 - $add_comment_form = id(new PhabricatorApplicationTransactionCommentView()) 175 + return id(new PhabricatorApplicationTransactionCommentView()) 178 176 ->setUser($viewer) 179 177 ->setObjectPHID($poll->getPHID()) 180 178 ->setDraft($draft) 179 + ->setHeaderText($add_comment_header) 181 180 ->setAction($this->getApplicationURI('/comment/'.$poll->getID().'/')) 182 181 ->setSubmitButtonName($submit_button_name); 183 - 184 - return id(new PHUIObjectBoxView()) 185 - ->setFlush(true) 186 - ->setHeader($add_comment_header) 187 - ->appendChild($add_comment_form); 188 182 189 183 } 190 184
+24 -25
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
··· 18 18 private $requestURI; 19 19 private $showPreview = true; 20 20 private $objectPHID; 21 + private $headerText; 21 22 22 23 public function setObjectPHID($object_phid) { 23 24 $this->objectPHID = $object_phid; ··· 72 73 return $this->action; 73 74 } 74 75 76 + public function setHeaderText($text) { 77 + $this->headerText = $text; 78 + return $this; 79 + } 80 + 75 81 public function render() { 76 82 77 83 $user = $this->getUser(); 78 84 if (!$user->isLoggedIn()) { 79 85 $uri = id(new PhutilURI('/login/')) 80 86 ->setQueryParam('next', (string) $this->getRequestURI()); 81 - return phutil_tag( 82 - 'div', 83 - array( 84 - 'class' => 'login-to-comment' 85 - ), 86 - javelin_tag( 87 - 'a', 88 - array( 89 - 'class' => 'button', 90 - 'sigil' => 'workflow', 91 - 'href' => $uri 92 - ), 93 - pht('Login to Comment'))); 87 + return id(new PHUIObjectBoxView()) 88 + ->setHeaderText(pht('Add Comment')) 89 + ->appendChild( 90 + javelin_tag( 91 + 'a', 92 + array( 93 + 'class' => 'login-to-comment button', 94 + 'sigil' => 'workflow', 95 + 'href' => $uri 96 + ), 97 + pht('Login to Comment'))); 94 98 } 95 99 96 100 $data = array(); ··· 124 128 : null, 125 129 )); 126 130 127 - return array($comment, $preview); 131 + $comment_box = id(new PHUIObjectBoxView()) 132 + ->setFlush(true) 133 + ->setHeaderText($this->headerText) 134 + ->appendChild($comment); 135 + 136 + return array($comment_box, $preview); 128 137 } 129 138 130 139 private function renderCommentPanel() { ··· 174 183 $preview = id(new PhabricatorTimelineView()) 175 184 ->setID($this->getPreviewTimelineID()); 176 185 177 - $header = phutil_tag( 178 - 'div', 179 - array( 180 - 'class' => 'phabricator-timeline-preview-header', 181 - ), 182 - pht('Preview')); 183 - 184 186 return phutil_tag( 185 187 'div', 186 188 array( 187 189 'id' => $this->getPreviewPanelID(), 188 190 'style' => 'display: none', 189 191 ), 190 - array( 191 - $header, 192 - $preview, 193 - )); 192 + $preview); 194 193 } 195 194 196 195 private function getPreviewPanelID() {
+1 -2
webroot/rsrc/css/phui/phui-form-view.css
··· 411 411 } 412 412 413 413 .login-to-comment { 414 - padding: 12px; 415 - float: right; 414 + margin: 12px; 416 415 } 417 416 418 417 .phui-form-divider hr {