Skip to content

Commit 65980ac

Browse files
author
epriestley
committedJul 1, 2016
Convert all remaining old tabs to new PHUITabGroupViews
Summary: Ref T10628. This moves everything else over. I'll clean up the cruft in the next diff. Test Plan: - Viewed Conduit API page, toggled tabs. - Viewed Harbormaster build, toggled tabs. - Viewed a Drydock lease, swapped tabs. - Viewed a Drydock resource, swapped tabs. - Viewed mail, swapped tabs. - Grepped for `addPropertyList(...)`, looked for any remaining calls with a second argument. - Also checked rSAAS for any calls, but we don't have anything there that uses tabs. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10628 Differential Revision: https://secure.phabricator.com/D16207
1 parent 5a4ecc7 commit 65980ac

File tree

6 files changed

+136
-49
lines changed

6 files changed

+136
-49
lines changed
 

‎src/applications/conduit/controller/PhabricatorConduitController.php

+18-3
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,28 @@ protected function renderExampleBox(ConduitAPIMethod $method, $params) {
6060
->setErrors($messages)
6161
->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
6262

63+
$tab_group = id(new PHUITabGroupView())
64+
->addTab(
65+
id(new PHUITabView())
66+
->setName(pht('arc call-conduit'))
67+
->setKey('arc')
68+
->appendChild($arc_example))
69+
->addTab(
70+
id(new PHUITabView())
71+
->setName(pht('cURL'))
72+
->setKey('curl')
73+
->appendChild($curl_example))
74+
->addTab(
75+
id(new PHUITabView())
76+
->setName(pht('PHP'))
77+
->setKey('php')
78+
->appendChild($php_example));
79+
6380
return id(new PHUIObjectBoxView())
6481
->setHeaderText(pht('Examples'))
6582
->setInfoView($info_view)
6683
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
67-
->addPropertyList($arc_example, pht('arc call-conduit'))
68-
->addPropertyList($curl_example, pht('cURL'))
69-
->addPropertyList($php_example, pht('PHP'));
84+
->addTabGroup($tab_group);
7085
}
7186

7287
private function renderExample(

‎src/applications/drydock/controller/DrydockLeaseViewController.php

+18-3
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,27 @@ public function handleRequest(AphrontRequest $request) {
4545
$locks = $this->buildLocksTab($lease->getPHID());
4646
$commands = $this->buildCommandsTab($lease->getPHID());
4747

48+
$tab_group = id(new PHUITabGroupView())
49+
->addTab(
50+
id(new PHUITabView())
51+
->setName(pht('Properties'))
52+
->setKey('properties')
53+
->appendChild($properties))
54+
->addTab(
55+
id(new PHUITabView())
56+
->setName(pht('Slot Locks'))
57+
->setKey('locks')
58+
->appendChild($locks))
59+
->addTab(
60+
id(new PHUITabView())
61+
->setName(pht('Commands'))
62+
->setKey('commands')
63+
->appendChild($commands));
64+
4865
$object_box = id(new PHUIObjectBoxView())
4966
->setHeaderText(pht('Properties'))
5067
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
51-
->addPropertyList($properties, pht('Properties'))
52-
->addPropertyList($locks, pht('Slot Locks'))
53-
->addPropertyList($commands, pht('Commands'));
68+
->addTabGroup($tab_group);
5469

5570
$view = id(new PHUITwoColumnView())
5671
->setHeader($header)

‎src/applications/drydock/controller/DrydockResourceViewController.php

+20-4
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,30 @@ public function handleRequest(AphrontRequest $request) {
4949

5050
$locks = $this->buildLocksTab($resource->getPHID());
5151
$commands = $this->buildCommandsTab($resource->getPHID());
52-
$lease_box = $this->buildLeaseBox($resource);
52+
53+
$tab_group = id(new PHUITabGroupView())
54+
->addTab(
55+
id(new PHUITabView())
56+
->setName(pht('Properties'))
57+
->setKey('properties')
58+
->appendChild($properties))
59+
->addTab(
60+
id(new PHUITabView())
61+
->setName(pht('Slot Locks'))
62+
->setKey('locks')
63+
->appendChild($locks))
64+
->addTab(
65+
id(new PHUITabView())
66+
->setName(pht('Commands'))
67+
->setKey('commands')
68+
->appendChild($commands));
5369

5470
$object_box = id(new PHUIObjectBoxView())
5571
->setHeaderText(pht('Properties'))
5672
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
57-
->addPropertyList($properties, pht('Properties'))
58-
->addPropertyList($locks, pht('Slot Locks'))
59-
->addPropertyList($commands, pht('Commands'));
73+
->addTabGroup($tab_group);
74+
75+
$lease_box = $this->buildLeaseBox($resource);
6076

6177
$view = id(new PHUITwoColumnView())
6278
->setHeader($header)

‎src/applications/harbormaster/controller/HarbormasterBuildViewController.php

+36-12
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ public function handleRequest(AphrontRequest $request) {
9595
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
9696
->setHeader($header);
9797

98+
$tab_group = new PHUITabGroupView();
99+
$target_box->addTabGroup($tab_group);
100+
98101
$property_list = new PHUIPropertyListView();
99102

100103
$target_artifacts = idx($artifacts, $build_target->getPHID(), array());
@@ -178,7 +181,11 @@ public function handleRequest(AphrontRequest $request) {
178181

179182
$property_list->addProperty(pht('Status'), $status_view);
180183

181-
$target_box->addPropertyList($property_list, pht('Overview'));
184+
$tab_group->addTab(
185+
id(new PHUITabView())
186+
->setName(pht('Overview'))
187+
->setKey('overview')
188+
->appendChild($property_list));
182189

183190
$step = $build_target->getBuildStep();
184191

@@ -204,22 +211,34 @@ public function handleRequest(AphrontRequest $request) {
204211
foreach ($details as $key => $value) {
205212
$property_list->addProperty($key, $value);
206213
}
207-
$target_box->addPropertyList($property_list, pht('Configuration'));
214+
$tab_group->addTab(
215+
id(new PHUITabView())
216+
->setName(pht('Configuration'))
217+
->setKey('configuration')
218+
->appendChild($property_list));
208219

209220
$variables = $build_target->getVariables();
210-
$property_list = new PHUIPropertyListView();
211-
$property_list->addRawContent($this->buildProperties($variables));
212-
$target_box->addPropertyList($property_list, pht('Variables'));
221+
$variables_tab = $this->buildProperties($variables);
222+
$tab_group->addTab(
223+
id(new PHUITabView())
224+
->setName(pht('Variables'))
225+
->setKey('variables')
226+
->appendChild($variables_tab));
213227

214228
$artifacts_tab = $this->buildArtifacts($build_target, $target_artifacts);
215-
$property_list = new PHUIPropertyListView();
216-
$property_list->addRawContent($artifacts_tab);
217-
$target_box->addPropertyList($property_list, pht('Artifacts'));
229+
$tab_group->addTab(
230+
id(new PHUITabView())
231+
->setName(pht('Artifacts'))
232+
->setKey('artifacts')
233+
->appendChild($artifacts_tab));
218234

219235
$build_messages = idx($messages, $build_target->getPHID(), array());
220-
$property_list = new PHUIPropertyListView();
221-
$property_list->addRawContent($this->buildMessages($build_messages));
222-
$target_box->addPropertyList($property_list, pht('Messages'));
236+
$messages_tab = $this->buildMessages($build_messages);
237+
$tab_group->addTab(
238+
id(new PHUITabView())
239+
->setName(pht('Messages'))
240+
->setKey('messages')
241+
->appendChild($messages_tab));
223242

224243
$property_list = new PHUIPropertyListView();
225244
$property_list->addProperty(
@@ -228,7 +247,12 @@ public function handleRequest(AphrontRequest $request) {
228247
$property_list->addProperty(
229248
pht('Build Target PHID'),
230249
$build_target->getPHID());
231-
$target_box->addPropertyList($property_list, pht('Metadata'));
250+
251+
$tab_group->addTab(
252+
id(new PHUITabView())
253+
->setName(pht('Metadata'))
254+
->setKey('metadata')
255+
->appendChild($property_list));
232256

233257
$targets[] = $target_box;
234258

‎src/applications/metamta/controller/PhabricatorMetaMTAMailViewController.php

+23-4
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,32 @@ public function handleRequest(AphrontRequest $request) {
3636
->addTextCrumb(pht('Mail %d', $mail->getID()))
3737
->setBorder(true);
3838

39+
$tab_group = id(new PHUITabGroupView())
40+
->addTab(
41+
id(new PHUITabView())
42+
->setName(pht('Message'))
43+
->setKey('message')
44+
->appendChild($this->buildMessageProperties($mail)))
45+
->addTab(
46+
id(new PHUITabView())
47+
->setName(pht('Headers'))
48+
->setKey('headers')
49+
->appendChild($this->buildHeaderProperties($mail)))
50+
->addTab(
51+
id(new PHUITabView())
52+
->setName(pht('Delivery'))
53+
->setKey('delivery')
54+
->appendChild($this->buildDeliveryProperties($mail)))
55+
->addTab(
56+
id(new PHUITabView())
57+
->setName(pht('Metadata'))
58+
->setKey('metadata')
59+
->appendChild($this->buildMetadataProperties($mail)));
60+
3961
$object_box = id(new PHUIObjectBoxView())
4062
->setHeaderText(pht('Mail'))
4163
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
42-
->addPropertyList($this->buildMessageProperties($mail), pht('Message'))
43-
->addPropertyList($this->buildHeaderProperties($mail), pht('Headers'))
44-
->addPropertyList($this->buildDeliveryProperties($mail), pht('Delivery'))
45-
->addPropertyList($this->buildMetadataProperties($mail), pht('Metadata'));
64+
->addTabGroup($tab_group);
4665

4766
$view = id(new PHUITwoColumnView())
4867
->setHeader($header)

‎src/applications/uiexample/examples/PHUIPropertyListExample.php

+21-23
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,6 @@ public function renderExample() {
1616
$request = $this->getRequest();
1717
$user = $request->getUser();
1818

19-
$details1 = id(new PHUIListItemView())
20-
->setName(pht('Details'))
21-
->setSelected(true);
22-
23-
$details2 = id(new PHUIListItemView())
24-
->setName(pht('Rainbow Info'))
25-
->setStatusColor(PHUIListItemView::STATUS_WARN);
26-
27-
$details3 = id(new PHUIListItemView())
28-
->setName(pht('Pasta Haiku'))
29-
->setStatusColor(PHUIListItemView::STATUS_FAIL);
30-
31-
$statustabs = id(new PHUIListView())
32-
->setType(PHUIListView::NAVBAR_LIST)
33-
->addMenuItem($details1)
34-
->addMenuItem($details2)
35-
->addMenuItem($details3);
36-
3719
$view = new PHUIPropertyListView();
3820

3921
$view->addProperty(
@@ -54,7 +36,6 @@ public function renderExample() {
5436
'viverra. Nunc tempus tempor quam id iaculis. Maecenas lectus '.
5537
'velit, aliquam et consequat quis, tincidunt id dolor.');
5638

57-
5839
$view2 = new PHUIPropertyListView();
5940
$view2->addSectionHeader(pht('Colors of the Rainbow'));
6041

@@ -66,7 +47,6 @@ public function renderExample() {
6647
$view2->addProperty('I', pht('Indigo'));
6748
$view2->addProperty('V', pht('Violet'));
6849

69-
7050
$view3 = new PHUIPropertyListView();
7151
$view3->addSectionHeader(pht('Haiku About Pasta'));
7252

@@ -77,11 +57,29 @@ public function renderExample() {
7757
pht('haiku. it is very bad.'),
7858
pht('what did you expect?')));
7959

60+
$details1 = id(new PHUITabView())
61+
->setName(pht('Details'))
62+
->setKey('details')
63+
->appendChild($view);
64+
65+
$details2 = id(new PHUITabView())
66+
->setName(pht('Rainbow Info'))
67+
->setKey('rainbow')
68+
->appendChild($view2);
69+
70+
$details3 = id(new PHUITabView())
71+
->setName(pht('Pasta Haiku'))
72+
->setKey('haiku')
73+
->appendChild($view3);
74+
75+
$tab_group = id(new PHUITabGroupView())
76+
->addTab($details1)
77+
->addTab($details2)
78+
->addTab($details3);
79+
8080
$object_box1 = id(new PHUIObjectBoxView())
8181
->setHeaderText(pht('%s Stackered', 'PHUIPropertyListView'))
82-
->addPropertyList($view, $details1)
83-
->addPropertyList($view2, $details2)
84-
->addPropertyList($view3, $details3);
82+
->addTabGroup($tab_group);
8583

8684
$edge_cases_view = new PHUIPropertyListView();
8785

0 commit comments

Comments
 (0)
Failed to load comments.