1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-18 02:31:10 +01:00

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
This commit is contained in:
epriestley 2016-06-30 16:28:46 -07:00
parent 5a4ecc7a9c
commit 65980ac683
6 changed files with 136 additions and 49 deletions

View file

@ -60,13 +60,28 @@ abstract class PhabricatorConduitController extends PhabricatorController {
->setErrors($messages)
->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
$tab_group = id(new PHUITabGroupView())
->addTab(
id(new PHUITabView())
->setName(pht('arc call-conduit'))
->setKey('arc')
->appendChild($arc_example))
->addTab(
id(new PHUITabView())
->setName(pht('cURL'))
->setKey('curl')
->appendChild($curl_example))
->addTab(
id(new PHUITabView())
->setName(pht('PHP'))
->setKey('php')
->appendChild($php_example));
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Examples'))
->setInfoView($info_view)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($arc_example, pht('arc call-conduit'))
->addPropertyList($curl_example, pht('cURL'))
->addPropertyList($php_example, pht('PHP'));
->addTabGroup($tab_group);
}
private function renderExample(

View file

@ -45,12 +45,27 @@ final class DrydockLeaseViewController extends DrydockLeaseController {
$locks = $this->buildLocksTab($lease->getPHID());
$commands = $this->buildCommandsTab($lease->getPHID());
$tab_group = id(new PHUITabGroupView())
->addTab(
id(new PHUITabView())
->setName(pht('Properties'))
->setKey('properties')
->appendChild($properties))
->addTab(
id(new PHUITabView())
->setName(pht('Slot Locks'))
->setKey('locks')
->appendChild($locks))
->addTab(
id(new PHUITabView())
->setName(pht('Commands'))
->setKey('commands')
->appendChild($commands));
$object_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Properties'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($properties, pht('Properties'))
->addPropertyList($locks, pht('Slot Locks'))
->addPropertyList($commands, pht('Commands'));
->addTabGroup($tab_group);
$view = id(new PHUITwoColumnView())
->setHeader($header)

View file

@ -49,14 +49,30 @@ final class DrydockResourceViewController extends DrydockResourceController {
$locks = $this->buildLocksTab($resource->getPHID());
$commands = $this->buildCommandsTab($resource->getPHID());
$lease_box = $this->buildLeaseBox($resource);
$tab_group = id(new PHUITabGroupView())
->addTab(
id(new PHUITabView())
->setName(pht('Properties'))
->setKey('properties')
->appendChild($properties))
->addTab(
id(new PHUITabView())
->setName(pht('Slot Locks'))
->setKey('locks')
->appendChild($locks))
->addTab(
id(new PHUITabView())
->setName(pht('Commands'))
->setKey('commands')
->appendChild($commands));
$object_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Properties'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($properties, pht('Properties'))
->addPropertyList($locks, pht('Slot Locks'))
->addPropertyList($commands, pht('Commands'));
->addTabGroup($tab_group);
$lease_box = $this->buildLeaseBox($resource);
$view = id(new PHUITwoColumnView())
->setHeader($header)

View file

@ -95,6 +95,9 @@ final class HarbormasterBuildViewController
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setHeader($header);
$tab_group = new PHUITabGroupView();
$target_box->addTabGroup($tab_group);
$property_list = new PHUIPropertyListView();
$target_artifacts = idx($artifacts, $build_target->getPHID(), array());
@ -178,7 +181,11 @@ final class HarbormasterBuildViewController
$property_list->addProperty(pht('Status'), $status_view);
$target_box->addPropertyList($property_list, pht('Overview'));
$tab_group->addTab(
id(new PHUITabView())
->setName(pht('Overview'))
->setKey('overview')
->appendChild($property_list));
$step = $build_target->getBuildStep();
@ -204,22 +211,34 @@ final class HarbormasterBuildViewController
foreach ($details as $key => $value) {
$property_list->addProperty($key, $value);
}
$target_box->addPropertyList($property_list, pht('Configuration'));
$tab_group->addTab(
id(new PHUITabView())
->setName(pht('Configuration'))
->setKey('configuration')
->appendChild($property_list));
$variables = $build_target->getVariables();
$property_list = new PHUIPropertyListView();
$property_list->addRawContent($this->buildProperties($variables));
$target_box->addPropertyList($property_list, pht('Variables'));
$variables_tab = $this->buildProperties($variables);
$tab_group->addTab(
id(new PHUITabView())
->setName(pht('Variables'))
->setKey('variables')
->appendChild($variables_tab));
$artifacts_tab = $this->buildArtifacts($build_target, $target_artifacts);
$property_list = new PHUIPropertyListView();
$property_list->addRawContent($artifacts_tab);
$target_box->addPropertyList($property_list, pht('Artifacts'));
$tab_group->addTab(
id(new PHUITabView())
->setName(pht('Artifacts'))
->setKey('artifacts')
->appendChild($artifacts_tab));
$build_messages = idx($messages, $build_target->getPHID(), array());
$property_list = new PHUIPropertyListView();
$property_list->addRawContent($this->buildMessages($build_messages));
$target_box->addPropertyList($property_list, pht('Messages'));
$messages_tab = $this->buildMessages($build_messages);
$tab_group->addTab(
id(new PHUITabView())
->setName(pht('Messages'))
->setKey('messages')
->appendChild($messages_tab));
$property_list = new PHUIPropertyListView();
$property_list->addProperty(
@ -228,7 +247,12 @@ final class HarbormasterBuildViewController
$property_list->addProperty(
pht('Build Target PHID'),
$build_target->getPHID());
$target_box->addPropertyList($property_list, pht('Metadata'));
$tab_group->addTab(
id(new PHUITabView())
->setName(pht('Metadata'))
->setKey('metadata')
->appendChild($property_list));
$targets[] = $target_box;

View file

@ -36,13 +36,32 @@ final class PhabricatorMetaMTAMailViewController
->addTextCrumb(pht('Mail %d', $mail->getID()))
->setBorder(true);
$tab_group = id(new PHUITabGroupView())
->addTab(
id(new PHUITabView())
->setName(pht('Message'))
->setKey('message')
->appendChild($this->buildMessageProperties($mail)))
->addTab(
id(new PHUITabView())
->setName(pht('Headers'))
->setKey('headers')
->appendChild($this->buildHeaderProperties($mail)))
->addTab(
id(new PHUITabView())
->setName(pht('Delivery'))
->setKey('delivery')
->appendChild($this->buildDeliveryProperties($mail)))
->addTab(
id(new PHUITabView())
->setName(pht('Metadata'))
->setKey('metadata')
->appendChild($this->buildMetadataProperties($mail)));
$object_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Mail'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($this->buildMessageProperties($mail), pht('Message'))
->addPropertyList($this->buildHeaderProperties($mail), pht('Headers'))
->addPropertyList($this->buildDeliveryProperties($mail), pht('Delivery'))
->addPropertyList($this->buildMetadataProperties($mail), pht('Metadata'));
->addTabGroup($tab_group);
$view = id(new PHUITwoColumnView())
->setHeader($header)

View file

@ -16,24 +16,6 @@ final class PHUIPropertyListExample extends PhabricatorUIExample {
$request = $this->getRequest();
$user = $request->getUser();
$details1 = id(new PHUIListItemView())
->setName(pht('Details'))
->setSelected(true);
$details2 = id(new PHUIListItemView())
->setName(pht('Rainbow Info'))
->setStatusColor(PHUIListItemView::STATUS_WARN);
$details3 = id(new PHUIListItemView())
->setName(pht('Pasta Haiku'))
->setStatusColor(PHUIListItemView::STATUS_FAIL);
$statustabs = id(new PHUIListView())
->setType(PHUIListView::NAVBAR_LIST)
->addMenuItem($details1)
->addMenuItem($details2)
->addMenuItem($details3);
$view = new PHUIPropertyListView();
$view->addProperty(
@ -54,7 +36,6 @@ final class PHUIPropertyListExample extends PhabricatorUIExample {
'viverra. Nunc tempus tempor quam id iaculis. Maecenas lectus '.
'velit, aliquam et consequat quis, tincidunt id dolor.');
$view2 = new PHUIPropertyListView();
$view2->addSectionHeader(pht('Colors of the Rainbow'));
@ -66,7 +47,6 @@ final class PHUIPropertyListExample extends PhabricatorUIExample {
$view2->addProperty('I', pht('Indigo'));
$view2->addProperty('V', pht('Violet'));
$view3 = new PHUIPropertyListView();
$view3->addSectionHeader(pht('Haiku About Pasta'));
@ -77,11 +57,29 @@ final class PHUIPropertyListExample extends PhabricatorUIExample {
pht('haiku. it is very bad.'),
pht('what did you expect?')));
$details1 = id(new PHUITabView())
->setName(pht('Details'))
->setKey('details')
->appendChild($view);
$details2 = id(new PHUITabView())
->setName(pht('Rainbow Info'))
->setKey('rainbow')
->appendChild($view2);
$details3 = id(new PHUITabView())
->setName(pht('Pasta Haiku'))
->setKey('haiku')
->appendChild($view3);
$tab_group = id(new PHUITabGroupView())
->addTab($details1)
->addTab($details2)
->addTab($details3);
$object_box1 = id(new PHUIObjectBoxView())
->setHeaderText(pht('%s Stackered', 'PHUIPropertyListView'))
->addPropertyList($view, $details1)
->addPropertyList($view2, $details2)
->addPropertyList($view3, $details3);
->addTabGroup($tab_group);
$edge_cases_view = new PHUIPropertyListView();