mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 18:51:12 +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:
parent
5a4ecc7a9c
commit
65980ac683
6 changed files with 136 additions and 49 deletions
|
@ -60,13 +60,28 @@ abstract class PhabricatorConduitController extends PhabricatorController {
|
||||||
->setErrors($messages)
|
->setErrors($messages)
|
||||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
|
->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())
|
return id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Examples'))
|
->setHeaderText(pht('Examples'))
|
||||||
->setInfoView($info_view)
|
->setInfoView($info_view)
|
||||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->addPropertyList($arc_example, pht('arc call-conduit'))
|
->addTabGroup($tab_group);
|
||||||
->addPropertyList($curl_example, pht('cURL'))
|
|
||||||
->addPropertyList($php_example, pht('PHP'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderExample(
|
private function renderExample(
|
||||||
|
|
|
@ -45,12 +45,27 @@ final class DrydockLeaseViewController extends DrydockLeaseController {
|
||||||
$locks = $this->buildLocksTab($lease->getPHID());
|
$locks = $this->buildLocksTab($lease->getPHID());
|
||||||
$commands = $this->buildCommandsTab($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())
|
$object_box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Properties'))
|
->setHeaderText(pht('Properties'))
|
||||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->addPropertyList($properties, pht('Properties'))
|
->addTabGroup($tab_group);
|
||||||
->addPropertyList($locks, pht('Slot Locks'))
|
|
||||||
->addPropertyList($commands, pht('Commands'));
|
|
||||||
|
|
||||||
$view = id(new PHUITwoColumnView())
|
$view = id(new PHUITwoColumnView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
|
|
|
@ -49,14 +49,30 @@ final class DrydockResourceViewController extends DrydockResourceController {
|
||||||
|
|
||||||
$locks = $this->buildLocksTab($resource->getPHID());
|
$locks = $this->buildLocksTab($resource->getPHID());
|
||||||
$commands = $this->buildCommandsTab($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())
|
$object_box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Properties'))
|
->setHeaderText(pht('Properties'))
|
||||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->addPropertyList($properties, pht('Properties'))
|
->addTabGroup($tab_group);
|
||||||
->addPropertyList($locks, pht('Slot Locks'))
|
|
||||||
->addPropertyList($commands, pht('Commands'));
|
$lease_box = $this->buildLeaseBox($resource);
|
||||||
|
|
||||||
$view = id(new PHUITwoColumnView())
|
$view = id(new PHUITwoColumnView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
|
|
|
@ -95,6 +95,9 @@ final class HarbormasterBuildViewController
|
||||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->setHeader($header);
|
->setHeader($header);
|
||||||
|
|
||||||
|
$tab_group = new PHUITabGroupView();
|
||||||
|
$target_box->addTabGroup($tab_group);
|
||||||
|
|
||||||
$property_list = new PHUIPropertyListView();
|
$property_list = new PHUIPropertyListView();
|
||||||
|
|
||||||
$target_artifacts = idx($artifacts, $build_target->getPHID(), array());
|
$target_artifacts = idx($artifacts, $build_target->getPHID(), array());
|
||||||
|
@ -178,7 +181,11 @@ final class HarbormasterBuildViewController
|
||||||
|
|
||||||
$property_list->addProperty(pht('Status'), $status_view);
|
$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();
|
$step = $build_target->getBuildStep();
|
||||||
|
|
||||||
|
@ -204,22 +211,34 @@ final class HarbormasterBuildViewController
|
||||||
foreach ($details as $key => $value) {
|
foreach ($details as $key => $value) {
|
||||||
$property_list->addProperty($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();
|
$variables = $build_target->getVariables();
|
||||||
$property_list = new PHUIPropertyListView();
|
$variables_tab = $this->buildProperties($variables);
|
||||||
$property_list->addRawContent($this->buildProperties($variables));
|
$tab_group->addTab(
|
||||||
$target_box->addPropertyList($property_list, pht('Variables'));
|
id(new PHUITabView())
|
||||||
|
->setName(pht('Variables'))
|
||||||
|
->setKey('variables')
|
||||||
|
->appendChild($variables_tab));
|
||||||
|
|
||||||
$artifacts_tab = $this->buildArtifacts($build_target, $target_artifacts);
|
$artifacts_tab = $this->buildArtifacts($build_target, $target_artifacts);
|
||||||
$property_list = new PHUIPropertyListView();
|
$tab_group->addTab(
|
||||||
$property_list->addRawContent($artifacts_tab);
|
id(new PHUITabView())
|
||||||
$target_box->addPropertyList($property_list, pht('Artifacts'));
|
->setName(pht('Artifacts'))
|
||||||
|
->setKey('artifacts')
|
||||||
|
->appendChild($artifacts_tab));
|
||||||
|
|
||||||
$build_messages = idx($messages, $build_target->getPHID(), array());
|
$build_messages = idx($messages, $build_target->getPHID(), array());
|
||||||
$property_list = new PHUIPropertyListView();
|
$messages_tab = $this->buildMessages($build_messages);
|
||||||
$property_list->addRawContent($this->buildMessages($build_messages));
|
$tab_group->addTab(
|
||||||
$target_box->addPropertyList($property_list, pht('Messages'));
|
id(new PHUITabView())
|
||||||
|
->setName(pht('Messages'))
|
||||||
|
->setKey('messages')
|
||||||
|
->appendChild($messages_tab));
|
||||||
|
|
||||||
$property_list = new PHUIPropertyListView();
|
$property_list = new PHUIPropertyListView();
|
||||||
$property_list->addProperty(
|
$property_list->addProperty(
|
||||||
|
@ -228,7 +247,12 @@ final class HarbormasterBuildViewController
|
||||||
$property_list->addProperty(
|
$property_list->addProperty(
|
||||||
pht('Build Target PHID'),
|
pht('Build Target PHID'),
|
||||||
$build_target->getPHID());
|
$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;
|
$targets[] = $target_box;
|
||||||
|
|
||||||
|
|
|
@ -36,13 +36,32 @@ final class PhabricatorMetaMTAMailViewController
|
||||||
->addTextCrumb(pht('Mail %d', $mail->getID()))
|
->addTextCrumb(pht('Mail %d', $mail->getID()))
|
||||||
->setBorder(true);
|
->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())
|
$object_box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Mail'))
|
->setHeaderText(pht('Mail'))
|
||||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
->addPropertyList($this->buildMessageProperties($mail), pht('Message'))
|
->addTabGroup($tab_group);
|
||||||
->addPropertyList($this->buildHeaderProperties($mail), pht('Headers'))
|
|
||||||
->addPropertyList($this->buildDeliveryProperties($mail), pht('Delivery'))
|
|
||||||
->addPropertyList($this->buildMetadataProperties($mail), pht('Metadata'));
|
|
||||||
|
|
||||||
$view = id(new PHUITwoColumnView())
|
$view = id(new PHUITwoColumnView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
|
|
|
@ -16,24 +16,6 @@ final class PHUIPropertyListExample extends PhabricatorUIExample {
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$user = $request->getUser();
|
$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 = new PHUIPropertyListView();
|
||||||
|
|
||||||
$view->addProperty(
|
$view->addProperty(
|
||||||
|
@ -54,7 +36,6 @@ final class PHUIPropertyListExample extends PhabricatorUIExample {
|
||||||
'viverra. Nunc tempus tempor quam id iaculis. Maecenas lectus '.
|
'viverra. Nunc tempus tempor quam id iaculis. Maecenas lectus '.
|
||||||
'velit, aliquam et consequat quis, tincidunt id dolor.');
|
'velit, aliquam et consequat quis, tincidunt id dolor.');
|
||||||
|
|
||||||
|
|
||||||
$view2 = new PHUIPropertyListView();
|
$view2 = new PHUIPropertyListView();
|
||||||
$view2->addSectionHeader(pht('Colors of the Rainbow'));
|
$view2->addSectionHeader(pht('Colors of the Rainbow'));
|
||||||
|
|
||||||
|
@ -66,7 +47,6 @@ final class PHUIPropertyListExample extends PhabricatorUIExample {
|
||||||
$view2->addProperty('I', pht('Indigo'));
|
$view2->addProperty('I', pht('Indigo'));
|
||||||
$view2->addProperty('V', pht('Violet'));
|
$view2->addProperty('V', pht('Violet'));
|
||||||
|
|
||||||
|
|
||||||
$view3 = new PHUIPropertyListView();
|
$view3 = new PHUIPropertyListView();
|
||||||
$view3->addSectionHeader(pht('Haiku About Pasta'));
|
$view3->addSectionHeader(pht('Haiku About Pasta'));
|
||||||
|
|
||||||
|
@ -77,11 +57,29 @@ final class PHUIPropertyListExample extends PhabricatorUIExample {
|
||||||
pht('haiku. it is very bad.'),
|
pht('haiku. it is very bad.'),
|
||||||
pht('what did you expect?')));
|
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())
|
$object_box1 = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('%s Stackered', 'PHUIPropertyListView'))
|
->setHeaderText(pht('%s Stackered', 'PHUIPropertyListView'))
|
||||||
->addPropertyList($view, $details1)
|
->addTabGroup($tab_group);
|
||||||
->addPropertyList($view2, $details2)
|
|
||||||
->addPropertyList($view3, $details3);
|
|
||||||
|
|
||||||
$edge_cases_view = new PHUIPropertyListView();
|
$edge_cases_view = new PHUIPropertyListView();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue