Skip to content

Commit b592630

Browse files
author
epriestley
committed
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
1 parent 6a74ad7 commit b592630

File tree

41 files changed

+106
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+106
-101
lines changed

src/applications/config/controller/PhabricatorConfigAllController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function processRequest() {
7474

7575
$object_box = id(new PHUIObjectBoxView())
7676
->setHeaderText(pht('Current Settings'))
77-
->addContent($version_property_list);
77+
->setPropertyList($version_property_list);
7878

7979
$phabricator_root = dirname(phutil_get_library_root('phabricator'));
8080
$version_path = $phabricator_root.'/conf/local/VERSION';

src/applications/countdown/controller/PhabricatorCountdownViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function processRequest() {
4949

5050
$object_box = id(new PHUIObjectBoxView())
5151
->setHeader($header)
52-
->addContent($actions)
53-
->addContent($properties);
52+
->setActionList($actions)
53+
->setPropertyList($properties);
5454

5555
$content = array(
5656
$crumbs,

src/applications/differential/controller/DifferentialRevisionViewController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ private function renderOtherRevisions(array $revisions) {
872872

873873
return id(new PHUIObjectBoxView())
874874
->setHeaderText(pht('Open Revisions Affecting These Files'))
875-
->addContent($view);
875+
->appendChild($view);
876876
}
877877

878878
/**

src/applications/differential/view/DifferentialAddCommentView.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ public function render() {
195195

196196
$comment_box = id(new PHUIObjectBoxView())
197197
->setHeader($header)
198-
->addContent($anchor)
199-
->addContent($warn)
200-
->addContent($form);
198+
->appendChild($anchor)
199+
->appendChild($warn)
200+
->appendChild($form);
201201

202202
return array($comment_box, $preview);
203203
}

src/applications/differential/view/DifferentialChangesetListView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public function render() {
210210

211211
$object_box = id(new PHUIObjectBoxView())
212212
->setHeader($header)
213-
->addContent($content);
213+
->appendChild($content);
214214

215215
return $object_box;
216216
}

src/applications/differential/view/DifferentialDiffTableOfContentsView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function render() {
239239

240240
return id(new PHUIObjectBoxView())
241241
->setHeaderText(pht('Table of Contents'))
242-
->addContent($content);
242+
->appendChild($content);
243243
}
244244

245245
private function renderRename($display_file, $other_file, $arrow) {

src/applications/differential/view/DifferentialLocalCommitsView.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ public function render() {
136136
phutil_implode_html("\n", $rows));
137137

138138
return id(new PHUIObjectBoxView())
139-
->setHeaderText(pht('Local Commits'))
140-
->addContent($content);
141-
139+
->setHeaderText(pht('Local Commits'))
140+
->appendChild($content);
142141
}
143142

144143
private static function formatCommit($commit) {

src/applications/differential/view/DifferentialRevisionDetailView.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ public function render() {
112112
$properties->setHasKeyboardShortcuts(true);
113113

114114
$object_box = id(new PHUIObjectBoxView())
115-
->setHeader($header)
116-
->addContent($actions)
117-
->addContent($properties);
115+
->setHeader($header)
116+
->setActionList($actions)
117+
->setPropertyList($properties);
118118

119119
return $object_box;
120120
}

src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ public function render() {
219219
pht('Show Diff'));
220220

221221
return id(new PHUIObjectBoxView())
222-
->setHeaderText(pht('Revision Update History'))
223-
->addContent($content);
222+
->setHeaderText(pht('Revision Update History'))
223+
->appendChild($content);
224224
}
225225

226226
const STAR_NONE = 'none';

src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public function processRequest() {
2424

2525
$object_box = id(new PHUIObjectBoxView())
2626
->setHeader($this->buildHeaderView($drequest))
27-
->addContent($this->buildActionView($drequest))
28-
->addContent($this->buildPropertyView($drequest));
27+
->setActionList($this->buildActionView($drequest))
28+
->setPropertyList($this->buildPropertyView($drequest));
2929

3030
$content[] = $object_box;
3131
$content[] = $this->renderSearchForm($collapsed = true);
@@ -77,7 +77,7 @@ public function processRequest() {
7777

7878
$object_box = id(new PHUIObjectBoxView())
7979
->setHeaderText(pht('README'))
80-
->addContent($box);
80+
->appendChild($box);
8181

8282
$content[] = $object_box;
8383
}

src/applications/diffusion/controller/DiffusionBrowseFileController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public function processRequest() {
100100

101101
$object_box = id(new PHUIObjectBoxView())
102102
->setHeader($this->buildHeaderView($drequest))
103-
->addContent($this->buildActionView($drequest))
104-
->addContent($this->buildPropertyView($drequest));
103+
->setActionList($this->buildActionView($drequest))
104+
->setPropertyList($this->buildPropertyView($drequest));
105105

106106
// Render the page.
107107
$content = array();

src/applications/diffusion/controller/DiffusionBrowseSearchController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ public function processRequest() {
77

88
$object_box = id(new PHUIObjectBoxView())
99
->setHeader($this->buildHeaderView($drequest))
10-
->addContent($this->buildActionView($drequest))
11-
->addContent($this->buildPropertyView($drequest));
10+
->setActionList($this->buildActionView($drequest))
11+
->setPropertyList($this->buildPropertyView($drequest));
1212

1313
$content = array();
1414

src/applications/diffusion/controller/DiffusionChangeController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ public function processRequest() {
8484

8585
$object_box = id(new PHUIObjectBoxView())
8686
->setHeader($header)
87-
->addContent($actions)
88-
->addContent($properties);
87+
->setActionList($actions)
88+
->setPropertyList($properties);
8989

9090
return $this->buildApplicationPage(
9191
array(

src/applications/diffusion/controller/DiffusionCommitController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ public function processRequest() {
140140

141141
$object_box = id(new PHUIObjectBoxView())
142142
->setHeader($headsup_view)
143-
->addContent($headsup_actions)
144-
->addContent($property_list);
143+
->setActionList($headsup_actions)
144+
->setPropertyList($property_list);
145145

146146
$content[] = $object_box;
147147
}
@@ -743,7 +743,7 @@ private function renderAddCommentPanel(
743743

744744
$comment_box = id(new PHUIObjectBoxView())
745745
->setHeader($header)
746-
->addContent($form);
746+
->appendChild($form);
747747

748748
return phutil_tag(
749749
'div',

src/applications/diffusion/controller/DiffusionHistoryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public function processRequest() {
7474

7575
$object_box = id(new PHUIObjectBoxView())
7676
->setHeader($header)
77-
->addContent($actions)
78-
->addContent($properties);
77+
->setActionList($actions)
78+
->setPropertyList($properties);
7979

8080
$crumbs = $this->buildCrumbs(
8181
array(

src/applications/diffusion/controller/DiffusionLintController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ public function processRequest() {
168168

169169
$object_box = id(new PHUIObjectBoxView())
170170
->setHeader($header)
171-
->addContent($actions)
172-
->addContent($properties);
171+
->setActionList($actions)
172+
->setPropertyList($properties);
173173
} else {
174174
$object_box = null;
175175
}

src/applications/diffusion/controller/DiffusionRepositoryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ private function buildPropertiesTable(PhabricatorRepository $repository) {
176176

177177
return id(new PHUIObjectBoxView())
178178
->setHeader($header)
179-
->addContent($actions)
180-
->addContent($view);
179+
->setActionList($actions)
180+
->setPropertyList($view);
181181

182182
}
183183

src/applications/drydock/controller/DrydockLeaseViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public function processRequest() {
4747

4848
$object_box = id(new PHUIObjectBoxView())
4949
->setHeader($header)
50-
->addContent($actions)
51-
->addContent($properties);
50+
->setActionList($actions)
51+
->setPropertyList($properties);
5252

5353
return $this->buildApplicationPage(
5454
array(

src/applications/drydock/controller/DrydockResourceViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public function processRequest() {
5858

5959
$object_box = id(new PHUIObjectBoxView())
6060
->setHeader($header)
61-
->addContent($actions)
62-
->addContent($properties);
61+
->setActionList($actions)
62+
->setPropertyList($properties);
6363

6464
return $this->buildApplicationPage(
6565
array(

src/applications/files/controller/PhabricatorFileInfoController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public function processRequest() {
5151

5252
$object_box = id(new PHUIObjectBoxView())
5353
->setHeader($header)
54-
->addContent($actions)
55-
->addContent($properties);
54+
->setActionList($actions)
55+
->setPropertyList($properties);
5656

5757
return $this->buildApplicationPage(
5858
array(
@@ -113,7 +113,7 @@ private function buildTransactionView(
113113
$comment_box = id(new PHUIObjectBoxView())
114114
->setFlush(true)
115115
->setHeader($add_comment_header)
116-
->addContent($add_comment_form);
116+
->appendChild($add_comment_form);
117117

118118
return array(
119119
$timeline,

src/applications/herald/controller/HeraldRuleViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function processRequest() {
3434

3535
$object_box = id(new PHUIObjectBoxView())
3636
->setHeader($header)
37-
->addContent($actions)
38-
->addContent($properties);
37+
->setActionList($actions)
38+
->setPropertyList($properties);
3939

4040
return $this->buildApplicationPage(
4141
array(

src/applications/legalpad/controller/LegalpadDocumentViewController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public function processRequest() {
8888

8989
$object_box = id(new PHUIObjectBoxView())
9090
->setHeader($header)
91-
->addContent($actions)
92-
->addContent($properties);
91+
->setActionList($actions)
92+
->setPropertyList($properties);
9393

9494
$content = array(
9595
$crumbs,
@@ -216,7 +216,7 @@ private function buildAddCommentView(
216216
return id(new PHUIObjectBoxView())
217217
->setFlush(true)
218218
->setHeader($header)
219-
->addContent($form);
219+
->appendChild($form);
220220

221221
}
222222

src/applications/macro/controller/PhabricatorMacroEditController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ public function processRequest() {
258258
->setValue(pht('Upload File')));
259259

260260
$upload = id(new PHUIObjectBoxView())
261-
->setHeaderText(pht('Upload New File'))
262-
->setForm($upload_form);
261+
->setHeaderText(pht('Upload New File'))
262+
->setForm($upload_form);
263263
}
264264

265265
$form_box = id(new PHUIObjectBoxView())

src/applications/macro/controller/PhabricatorMacroViewController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ public function processRequest() {
9393

9494
$object_box = id(new PHUIObjectBoxView())
9595
->setHeader($header)
96-
->addContent($actions)
97-
->addContent($properties);
96+
->setActionList($actions)
97+
->setPropertyList($properties);
9898

9999
$comment_box = id(new PHUIObjectBoxView())
100100
->setFlush(true)
101101
->setHeader($add_comment_header)
102-
->addContent($add_comment_form);
102+
->appendChild($add_comment_form);
103103

104104
return $this->buildApplicationPage(
105105
array(

src/applications/maniphest/controller/ManiphestTaskDetailController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ public function processRequest() {
365365

366366
$object_box = id(new PHUIObjectBoxView())
367367
->setHeader($header)
368-
->addContent($actions)
369-
->addContent($properties);
368+
->setActionList($actions)
369+
->setPropertyList($properties);
370370

371371
$comment_box = id(new PHUIObjectBoxView())
372372
->setFlush(true)
373373
->setHeader($comment_header)
374-
->addContent($comment_form);
374+
->appendChild($comment_form);
375375

376376
return $this->buildApplicationPage(
377377
array(

src/applications/meta/controller/PhabricatorApplicationDetailViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public function processRequest() {
5656

5757
$object_box = id(new PHUIObjectBoxView())
5858
->setHeader($header)
59-
->addContent($actions)
60-
->addContent($properties);
59+
->setActionList($actions)
60+
->setPropertyList($properties);
6161

6262
return $this->buildApplicationPage(
6363
array(

src/applications/paste/controller/PhabricatorPasteViewController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function processRequest() {
7171

7272
$object_box = id(new PHUIObjectBoxView())
7373
->setHeader($header)
74-
->addContent($actions)
75-
->addContent($properties);
74+
->setActionList($actions)
75+
->setPropertyList($properties);
7676

7777
$source_code = $this->buildSourceCodeView(
7878
$paste,
@@ -139,7 +139,7 @@ public function processRequest() {
139139
$comment_box = id(new PHUIObjectBoxView())
140140
->setFlush(true)
141141
->setHeader($add_comment_header)
142-
->addContent($add_comment_form);
142+
->appendChild($add_comment_form);
143143

144144
return $this->buildApplicationPage(
145145
array(

src/applications/people/controller/PhabricatorPeopleProfileController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function processRequest() {
7878

7979
$object_box = id(new PHUIObjectBoxView())
8080
->setHeader($header)
81-
->addContent($actions)
82-
->addContent($properties);
81+
->setActionList($actions)
82+
->setPropertyList($properties);
8383

8484
return $this->buildApplicationPage(
8585
array(

src/applications/phame/controller/blog/PhameBlogViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public function processRequest() {
6565

6666
$object_box = id(new PHUIObjectBoxView())
6767
->setHeader($header)
68-
->addContent($actions)
69-
->addContent($properties);
68+
->setActionList($actions)
69+
->setPropertyList($properties);
7070

7171
$nav->appendChild(
7272
array(

src/applications/phame/controller/post/PhamePostViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function processRequest() {
5050

5151
$object_box = id(new PHUIObjectBoxView())
5252
->setHeader($header)
53-
->addContent($actions)
54-
->addContent($properties);
53+
->setActionList($actions)
54+
->setPropertyList($properties);
5555

5656
if ($post->isDraft()) {
5757
$object_box->appendChild(

src/applications/phlux/controller/PhluxViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public function processRequest() {
7676

7777
$object_box = id(new PHUIObjectBoxView())
7878
->setHeader($header)
79-
->addContent($actions)
80-
->addContent($properties);
79+
->setActionList($actions)
80+
->setPropertyList($properties);
8181

8282
return $this->buildApplicationPage(
8383
array(

0 commit comments

Comments
 (0)