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

Provide more structure to PHUIObjectBoxView

Summary:
Three changes here.

- Add `setActionList()`, and use that to set the action list.
- Add `setPropertyList()`, and use that to set the property list.

These will let us add some apropriate CSS so we can fix the border issue, and get rid of a bunch of goofy `.x + .y` selectors.

- Replace `addContent()` with `appendChild()`.

This is just a consistency thing; `AphrontView` already provides `appendChild()`, and `addContent()` did the same thing.

Test Plan:
- Viewed "All Config".
- Viewed a countdown.
- Viewed a revision (add comment, change list, table of contents, comment, local commits, open revisions affecting these files, update history).
- Viewed Diffusion (browse, change, history, repository, lint).
- Viewed Drydock (resource, lease).
- Viewed Files.
- Viewed Herald.
- Viewed Legalpad.
- Viewed macro (edit, edit audio, view).
- Viewed Maniphest.
- Viewed Applications.
- Viewed Paste.
- Viewed People.
- Viewed Phulux.
- Viewed Pholio.
- Viewed Phame (blog, post).
- Viewed Phortune (account, product).
- Viewed Ponder (questions, answers, comments).
- Viewed Releeph.
- Viewed Projects.
- Viewed Slowvote.

NOTE: Images in Files aren't on a black background anymore -- I assume that's on purpose?

NOTE: Some jankiness in Phortune, I'll clean that up when I get back to it. Not related to this diff.

Reviewers: chad

Reviewed By: chad

CC: aran

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

+106 -101
+1 -1
src/applications/config/controller/PhabricatorConfigAllController.php
··· 74 74 75 75 $object_box = id(new PHUIObjectBoxView()) 76 76 ->setHeaderText(pht('Current Settings')) 77 - ->addContent($version_property_list); 77 + ->setPropertyList($version_property_list); 78 78 79 79 $phabricator_root = dirname(phutil_get_library_root('phabricator')); 80 80 $version_path = $phabricator_root.'/conf/local/VERSION';
+2 -2
src/applications/countdown/controller/PhabricatorCountdownViewController.php
··· 49 49 50 50 $object_box = id(new PHUIObjectBoxView()) 51 51 ->setHeader($header) 52 - ->addContent($actions) 53 - ->addContent($properties); 52 + ->setActionList($actions) 53 + ->setPropertyList($properties); 54 54 55 55 $content = array( 56 56 $crumbs,
+1 -1
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 872 872 873 873 return id(new PHUIObjectBoxView()) 874 874 ->setHeaderText(pht('Open Revisions Affecting These Files')) 875 - ->addContent($view); 875 + ->appendChild($view); 876 876 } 877 877 878 878 /**
+3 -3
src/applications/differential/view/DifferentialAddCommentView.php
··· 195 195 196 196 $comment_box = id(new PHUIObjectBoxView()) 197 197 ->setHeader($header) 198 - ->addContent($anchor) 199 - ->addContent($warn) 200 - ->addContent($form); 198 + ->appendChild($anchor) 199 + ->appendChild($warn) 200 + ->appendChild($form); 201 201 202 202 return array($comment_box, $preview); 203 203 }
+1 -1
src/applications/differential/view/DifferentialChangesetListView.php
··· 210 210 211 211 $object_box = id(new PHUIObjectBoxView()) 212 212 ->setHeader($header) 213 - ->addContent($content); 213 + ->appendChild($content); 214 214 215 215 return $object_box; 216 216 }
+1 -1
src/applications/differential/view/DifferentialDiffTableOfContentsView.php
··· 239 239 240 240 return id(new PHUIObjectBoxView()) 241 241 ->setHeaderText(pht('Table of Contents')) 242 - ->addContent($content); 242 + ->appendChild($content); 243 243 } 244 244 245 245 private function renderRename($display_file, $other_file, $arrow) {
+2 -3
src/applications/differential/view/DifferentialLocalCommitsView.php
··· 136 136 phutil_implode_html("\n", $rows)); 137 137 138 138 return id(new PHUIObjectBoxView()) 139 - ->setHeaderText(pht('Local Commits')) 140 - ->addContent($content); 141 - 139 + ->setHeaderText(pht('Local Commits')) 140 + ->appendChild($content); 142 141 } 143 142 144 143 private static function formatCommit($commit) {
+3 -3
src/applications/differential/view/DifferentialRevisionDetailView.php
··· 112 112 $properties->setHasKeyboardShortcuts(true); 113 113 114 114 $object_box = id(new PHUIObjectBoxView()) 115 - ->setHeader($header) 116 - ->addContent($actions) 117 - ->addContent($properties); 115 + ->setHeader($header) 116 + ->setActionList($actions) 117 + ->setPropertyList($properties); 118 118 119 119 return $object_box; 120 120 }
+2 -2
src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
··· 219 219 pht('Show Diff')); 220 220 221 221 return id(new PHUIObjectBoxView()) 222 - ->setHeaderText(pht('Revision Update History')) 223 - ->addContent($content); 222 + ->setHeaderText(pht('Revision Update History')) 223 + ->appendChild($content); 224 224 } 225 225 226 226 const STAR_NONE = 'none';
+3 -3
src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php
··· 24 24 25 25 $object_box = id(new PHUIObjectBoxView()) 26 26 ->setHeader($this->buildHeaderView($drequest)) 27 - ->addContent($this->buildActionView($drequest)) 28 - ->addContent($this->buildPropertyView($drequest)); 27 + ->setActionList($this->buildActionView($drequest)) 28 + ->setPropertyList($this->buildPropertyView($drequest)); 29 29 30 30 $content[] = $object_box; 31 31 $content[] = $this->renderSearchForm($collapsed = true); ··· 77 77 78 78 $object_box = id(new PHUIObjectBoxView()) 79 79 ->setHeaderText(pht('README')) 80 - ->addContent($box); 80 + ->appendChild($box); 81 81 82 82 $content[] = $object_box; 83 83 }
+2 -2
src/applications/diffusion/controller/DiffusionBrowseFileController.php
··· 100 100 101 101 $object_box = id(new PHUIObjectBoxView()) 102 102 ->setHeader($this->buildHeaderView($drequest)) 103 - ->addContent($this->buildActionView($drequest)) 104 - ->addContent($this->buildPropertyView($drequest)); 103 + ->setActionList($this->buildActionView($drequest)) 104 + ->setPropertyList($this->buildPropertyView($drequest)); 105 105 106 106 // Render the page. 107 107 $content = array();
+2 -2
src/applications/diffusion/controller/DiffusionBrowseSearchController.php
··· 7 7 8 8 $object_box = id(new PHUIObjectBoxView()) 9 9 ->setHeader($this->buildHeaderView($drequest)) 10 - ->addContent($this->buildActionView($drequest)) 11 - ->addContent($this->buildPropertyView($drequest)); 10 + ->setActionList($this->buildActionView($drequest)) 11 + ->setPropertyList($this->buildPropertyView($drequest)); 12 12 13 13 $content = array(); 14 14
+2 -2
src/applications/diffusion/controller/DiffusionChangeController.php
··· 84 84 85 85 $object_box = id(new PHUIObjectBoxView()) 86 86 ->setHeader($header) 87 - ->addContent($actions) 88 - ->addContent($properties); 87 + ->setActionList($actions) 88 + ->setPropertyList($properties); 89 89 90 90 return $this->buildApplicationPage( 91 91 array(
+3 -3
src/applications/diffusion/controller/DiffusionCommitController.php
··· 140 140 141 141 $object_box = id(new PHUIObjectBoxView()) 142 142 ->setHeader($headsup_view) 143 - ->addContent($headsup_actions) 144 - ->addContent($property_list); 143 + ->setActionList($headsup_actions) 144 + ->setPropertyList($property_list); 145 145 146 146 $content[] = $object_box; 147 147 } ··· 743 743 744 744 $comment_box = id(new PHUIObjectBoxView()) 745 745 ->setHeader($header) 746 - ->addContent($form); 746 + ->appendChild($form); 747 747 748 748 return phutil_tag( 749 749 'div',
+2 -2
src/applications/diffusion/controller/DiffusionHistoryController.php
··· 74 74 75 75 $object_box = id(new PHUIObjectBoxView()) 76 76 ->setHeader($header) 77 - ->addContent($actions) 78 - ->addContent($properties); 77 + ->setActionList($actions) 78 + ->setPropertyList($properties); 79 79 80 80 $crumbs = $this->buildCrumbs( 81 81 array(
+2 -2
src/applications/diffusion/controller/DiffusionLintController.php
··· 168 168 169 169 $object_box = id(new PHUIObjectBoxView()) 170 170 ->setHeader($header) 171 - ->addContent($actions) 172 - ->addContent($properties); 171 + ->setActionList($actions) 172 + ->setPropertyList($properties); 173 173 } else { 174 174 $object_box = null; 175 175 }
+2 -2
src/applications/diffusion/controller/DiffusionRepositoryController.php
··· 176 176 177 177 return id(new PHUIObjectBoxView()) 178 178 ->setHeader($header) 179 - ->addContent($actions) 180 - ->addContent($view); 179 + ->setActionList($actions) 180 + ->setPropertyList($view); 181 181 182 182 } 183 183
+2 -2
src/applications/drydock/controller/DrydockLeaseViewController.php
··· 47 47 48 48 $object_box = id(new PHUIObjectBoxView()) 49 49 ->setHeader($header) 50 - ->addContent($actions) 51 - ->addContent($properties); 50 + ->setActionList($actions) 51 + ->setPropertyList($properties); 52 52 53 53 return $this->buildApplicationPage( 54 54 array(
+2 -2
src/applications/drydock/controller/DrydockResourceViewController.php
··· 58 58 59 59 $object_box = id(new PHUIObjectBoxView()) 60 60 ->setHeader($header) 61 - ->addContent($actions) 62 - ->addContent($properties); 61 + ->setActionList($actions) 62 + ->setPropertyList($properties); 63 63 64 64 return $this->buildApplicationPage( 65 65 array(
+3 -3
src/applications/files/controller/PhabricatorFileInfoController.php
··· 51 51 52 52 $object_box = id(new PHUIObjectBoxView()) 53 53 ->setHeader($header) 54 - ->addContent($actions) 55 - ->addContent($properties); 54 + ->setActionList($actions) 55 + ->setPropertyList($properties); 56 56 57 57 return $this->buildApplicationPage( 58 58 array( ··· 113 113 $comment_box = id(new PHUIObjectBoxView()) 114 114 ->setFlush(true) 115 115 ->setHeader($add_comment_header) 116 - ->addContent($add_comment_form); 116 + ->appendChild($add_comment_form); 117 117 118 118 return array( 119 119 $timeline,
+2 -2
src/applications/herald/controller/HeraldRuleViewController.php
··· 34 34 35 35 $object_box = id(new PHUIObjectBoxView()) 36 36 ->setHeader($header) 37 - ->addContent($actions) 38 - ->addContent($properties); 37 + ->setActionList($actions) 38 + ->setPropertyList($properties); 39 39 40 40 return $this->buildApplicationPage( 41 41 array(
+3 -3
src/applications/legalpad/controller/LegalpadDocumentViewController.php
··· 88 88 89 89 $object_box = id(new PHUIObjectBoxView()) 90 90 ->setHeader($header) 91 - ->addContent($actions) 92 - ->addContent($properties); 91 + ->setActionList($actions) 92 + ->setPropertyList($properties); 93 93 94 94 $content = array( 95 95 $crumbs, ··· 216 216 return id(new PHUIObjectBoxView()) 217 217 ->setFlush(true) 218 218 ->setHeader($header) 219 - ->addContent($form); 219 + ->appendChild($form); 220 220 221 221 } 222 222
+2 -2
src/applications/macro/controller/PhabricatorMacroEditController.php
··· 258 258 ->setValue(pht('Upload File'))); 259 259 260 260 $upload = id(new PHUIObjectBoxView()) 261 - ->setHeaderText(pht('Upload New File')) 262 - ->setForm($upload_form); 261 + ->setHeaderText(pht('Upload New File')) 262 + ->setForm($upload_form); 263 263 } 264 264 265 265 $form_box = id(new PHUIObjectBoxView())
+3 -3
src/applications/macro/controller/PhabricatorMacroViewController.php
··· 93 93 94 94 $object_box = id(new PHUIObjectBoxView()) 95 95 ->setHeader($header) 96 - ->addContent($actions) 97 - ->addContent($properties); 96 + ->setActionList($actions) 97 + ->setPropertyList($properties); 98 98 99 99 $comment_box = id(new PHUIObjectBoxView()) 100 100 ->setFlush(true) 101 101 ->setHeader($add_comment_header) 102 - ->addContent($add_comment_form); 102 + ->appendChild($add_comment_form); 103 103 104 104 return $this->buildApplicationPage( 105 105 array(
+3 -3
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 365 365 366 366 $object_box = id(new PHUIObjectBoxView()) 367 367 ->setHeader($header) 368 - ->addContent($actions) 369 - ->addContent($properties); 368 + ->setActionList($actions) 369 + ->setPropertyList($properties); 370 370 371 371 $comment_box = id(new PHUIObjectBoxView()) 372 372 ->setFlush(true) 373 373 ->setHeader($comment_header) 374 - ->addContent($comment_form); 374 + ->appendChild($comment_form); 375 375 376 376 return $this->buildApplicationPage( 377 377 array(
+2 -2
src/applications/meta/controller/PhabricatorApplicationDetailViewController.php
··· 56 56 57 57 $object_box = id(new PHUIObjectBoxView()) 58 58 ->setHeader($header) 59 - ->addContent($actions) 60 - ->addContent($properties); 59 + ->setActionList($actions) 60 + ->setPropertyList($properties); 61 61 62 62 return $this->buildApplicationPage( 63 63 array(
+3 -3
src/applications/paste/controller/PhabricatorPasteViewController.php
··· 71 71 72 72 $object_box = id(new PHUIObjectBoxView()) 73 73 ->setHeader($header) 74 - ->addContent($actions) 75 - ->addContent($properties); 74 + ->setActionList($actions) 75 + ->setPropertyList($properties); 76 76 77 77 $source_code = $this->buildSourceCodeView( 78 78 $paste, ··· 139 139 $comment_box = id(new PHUIObjectBoxView()) 140 140 ->setFlush(true) 141 141 ->setHeader($add_comment_header) 142 - ->addContent($add_comment_form); 142 + ->appendChild($add_comment_form); 143 143 144 144 return $this->buildApplicationPage( 145 145 array(
+2 -2
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 78 78 79 79 $object_box = id(new PHUIObjectBoxView()) 80 80 ->setHeader($header) 81 - ->addContent($actions) 82 - ->addContent($properties); 81 + ->setActionList($actions) 82 + ->setPropertyList($properties); 83 83 84 84 return $this->buildApplicationPage( 85 85 array(
+2 -2
src/applications/phame/controller/blog/PhameBlogViewController.php
··· 65 65 66 66 $object_box = id(new PHUIObjectBoxView()) 67 67 ->setHeader($header) 68 - ->addContent($actions) 69 - ->addContent($properties); 68 + ->setActionList($actions) 69 + ->setPropertyList($properties); 70 70 71 71 $nav->appendChild( 72 72 array(
+2 -2
src/applications/phame/controller/post/PhamePostViewController.php
··· 50 50 51 51 $object_box = id(new PHUIObjectBoxView()) 52 52 ->setHeader($header) 53 - ->addContent($actions) 54 - ->addContent($properties); 53 + ->setActionList($actions) 54 + ->setPropertyList($properties); 55 55 56 56 if ($post->isDraft()) { 57 57 $object_box->appendChild(
+2 -2
src/applications/phlux/controller/PhluxViewController.php
··· 76 76 77 77 $object_box = id(new PHUIObjectBoxView()) 78 78 ->setHeader($header) 79 - ->addContent($actions) 80 - ->addContent($properties); 79 + ->setActionList($actions) 80 + ->setPropertyList($properties); 81 81 82 82 return $this->buildApplicationPage( 83 83 array(
+3 -3
src/applications/pholio/controller/PholioMockViewController.php
··· 105 105 106 106 $object_box = id(new PHUIObjectBoxView()) 107 107 ->setHeader($header) 108 - ->addContent($actions) 109 - ->addContent($properties); 108 + ->setActionList($actions) 109 + ->setPropertyList($properties); 110 110 111 111 $content = array( 112 112 $crumbs, ··· 257 257 return id(new PHUIObjectBoxView()) 258 258 ->setFlush(true) 259 259 ->setHeader($header) 260 - ->addContent($form); 260 + ->appendChild($form); 261 261 } 262 262 263 263 }
+2 -2
src/applications/phortune/controller/PhortuneAccountViewController.php
··· 62 62 63 63 $object_box = id(new PHUIObjectBoxView()) 64 64 ->setHeader($header) 65 - ->addContent($actions) 66 - ->addContent($properties); 65 + ->setActionList($actions) 66 + ->setPropertyList($properties); 67 67 68 68 return $this->buildApplicationPage( 69 69 array(
+2 -2
src/applications/phortune/controller/PhortuneProductViewController.php
··· 83 83 84 84 $object_box = id(new PHUIObjectBoxView()) 85 85 ->setHeader($header) 86 - ->addContent($actions) 87 - ->addContent($properties); 86 + ->setActionList($actions) 87 + ->setPropertyList($properties); 88 88 89 89 return $this->buildApplicationPage( 90 90 array(
+6 -6
src/applications/ponder/controller/PonderQuestionViewController.php
··· 52 52 53 53 $object_box = id(new PHUIObjectBoxView()) 54 54 ->setHeader($header) 55 - ->addContent($actions) 56 - ->addContent($properties); 55 + ->setActionList($actions) 56 + ->setPropertyList($properties); 57 57 58 58 $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); 59 59 $crumbs->setActionList($actions); ··· 214 214 $object_box = id(new PHUIObjectBoxView()) 215 215 ->setFlush(true) 216 216 ->setHeaderText(pht('Question Comment')) 217 - ->addContent($add_comment); 217 + ->appendChild($add_comment); 218 218 219 219 return $this->wrapComments( 220 220 count($xactions), ··· 269 269 270 270 $object_box = id(new PHUIObjectBoxView()) 271 271 ->setHeader($header) 272 - ->addContent($actions) 273 - ->addContent($properties); 272 + ->setActionList($actions) 273 + ->setPropertyList($properties); 274 274 275 275 $out[] = $object_box; 276 276 $details = array(); ··· 291 291 $comment_box = id(new PHUIObjectBoxView()) 292 292 ->setFlush(true) 293 293 ->setHeaderText(pht('Answer Comment')) 294 - ->addContent($form); 294 + ->appendChild($form); 295 295 296 296 $details[] = $comment_box; 297 297
+1 -1
src/applications/ponder/view/PonderAddAnswerView.php
··· 45 45 46 46 return id(new PHUIObjectBoxView()) 47 47 ->setHeader($header) 48 - ->addContent($form); 48 + ->appendChild($form); 49 49 } 50 50 }
+3 -3
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 74 74 75 75 $object_box = id(new PHUIObjectBoxView()) 76 76 ->setHeader($header) 77 - ->addContent($actions) 78 - ->addContent($properties); 77 + ->setActionList($actions) 78 + ->setPropertyList($properties); 79 79 80 80 return $this->buildApplicationPage( 81 81 array( ··· 182 182 183 183 $content = id(new PHUIObjectBoxView()) 184 184 ->setHeaderText(pht('Open Tasks')) 185 - ->addContent($list); 185 + ->appendChild($list); 186 186 187 187 return $content; 188 188 }
+2 -3
src/applications/releeph/controller/branch/ReleephBranchViewController.php
··· 170 170 171 171 return id(new PHUIObjectBoxView()) 172 172 ->setHeader($header) 173 - ->addContent($actions) 174 - ->addContent($properties); 175 - 173 + ->setActionList($actions) 174 + ->setPropertyList($properties); 176 175 } 177 176 178 177 }
+2 -3
src/applications/releeph/controller/project/ReleephProjectViewController.php
··· 238 238 239 239 return id(new PHUIObjectBoxView()) 240 240 ->setHeader($header) 241 - ->addContent($actions) 242 - ->addContent($properties); 243 - 241 + ->setActionList($actions) 242 + ->setPropertyList($properties); 244 243 } 245 244 246 245 }
+3 -3
src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
··· 59 59 60 60 $object_box = id(new PHUIObjectBoxView()) 61 61 ->setHeader($header) 62 - ->addContent($actions) 63 - ->addContent($properties); 62 + ->setActionList($actions) 63 + ->setPropertyList($properties); 64 64 65 65 return $this->buildApplicationPage( 66 66 array( ··· 181 181 return id(new PHUIObjectBoxView()) 182 182 ->setFlush(true) 183 183 ->setHeader($add_comment_header) 184 - ->addContent($add_comment_form); 184 + ->appendChild($add_comment_form); 185 185 186 186 } 187 187
+15 -7
src/view/phui/PHUIObjectBoxView.php
··· 6 6 private $formError = null; 7 7 private $form; 8 8 private $validationException; 9 - private $content = array(); 10 9 private $header; 11 10 private $flush; 11 + private $propertyList; 12 + private $actionList; 13 + 14 + public function setActionList(PhabricatorActionListView $action_list) { 15 + $this->actionList = $action_list; 16 + return $this; 17 + } 18 + 19 + public function setPropertyList(PhabricatorPropertyListView $property_list) { 20 + $this->propertyList = $property_list; 21 + return $this; 22 + } 12 23 13 24 public function setHeaderText($text) { 14 25 $this->headerText = $text; ··· 27 38 28 39 public function setHeader(PHUIHeaderView $header) { 29 40 $this->header = $header; 30 - return $this; 31 - } 32 - 33 - public function addContent($content) { 34 - $this->content[] = $content; 35 41 return $this; 36 42 } 37 43 ··· 79 85 $this->formError, 80 86 $exception_errors, 81 87 $this->form, 82 - $this->content, 88 + $this->actionList, 89 + $this->propertyList, 90 + $this->renderChildren(), 83 91 )) 84 92 ->setBorder(true) 85 93 ->addMargin(PHUI::MARGIN_LARGE_TOP)