1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Convert Almanac Binding View to two columns

Summary: Moves over to the new layout. Fixes T10521

Test Plan: Make a binding, view page, add some properties.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T10521

Differential Revision: https://secure.phabricator.com/D15404
This commit is contained in:
Chad Little 2016-03-05 08:23:40 -08:00
parent 5a43e2040e
commit f6127f5835

View file

@ -26,26 +26,23 @@ final class AlmanacBindingViewController
$title = pht('Binding %s', $binding->getID()); $title = pht('Binding %s', $binding->getID());
$property_list = $this->buildPropertyList($binding); $properties = $this->buildPropertyList($binding);
$action_list = $this->buildActionList($binding); $details = $this->buildPropertySection($binding);
$property_list->setActionList($action_list); $actions = $this->buildActionList($binding);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setUser($viewer) ->setUser($viewer)
->setHeader($title) ->setHeader($title)
->setPolicyObject($binding); ->setPolicyObject($binding)
->setHeaderIcon('fa-object-group');
if ($binding->getIsDisabled()) { if ($binding->getIsDisabled()) {
$header->setStatus('fa-ban', 'red', pht('Disabled')); $header->setStatus('fa-ban', 'red', pht('Disabled'));
} }
$box = id(new PHUIObjectBoxView()) $issue = null;
->setHeader($header)
->addPropertyList($property_list);
if ($binding->getService()->isClusterService()) { if ($binding->getService()->isClusterService()) {
$this->addClusterMessage( $issue = $this->addClusterMessage(
$box,
pht('The service for this binding is a cluster service.'), pht('The service for this binding is a cluster service.'),
pht( pht(
'The service for this binding is a cluster service. You do not '. 'The service for this binding is a cluster service. You do not '.
@ -56,24 +53,34 @@ final class AlmanacBindingViewController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($service->getName(), $service_uri); $crumbs->addTextCrumb($service->getName(), $service_uri);
$crumbs->addTextCrumb($title); $crumbs->addTextCrumb($title);
$crumbs->setBorder(true);
$timeline = $this->buildTransactionTimeline( $timeline = $this->buildTransactionTimeline(
$binding, $binding,
new AlmanacBindingTransactionQuery()); new AlmanacBindingTransactionQuery());
$timeline->setShouldTerminate(true); $timeline->setShouldTerminate(true);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setMainColumn(array(
$issue,
$this->buildAlmanacPropertiesTable($binding),
$timeline,
))
->setPropertyList($properties)
->addPropertySection(pht('DETAILS'), $details)
->setActionList($actions);
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$box, $view,
$this->buildAlmanacPropertiesTable($binding),
$timeline,
)); ));
} }
private function buildPropertyList(AlmanacBinding $binding) { private function buildPropertySection(AlmanacBinding $binding) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$properties = id(new PHUIPropertyListView()) $properties = id(new PHUIPropertyListView())
@ -98,6 +105,17 @@ final class AlmanacBindingViewController
return $properties; return $properties;
} }
private function buildPropertyList(AlmanacBinding $binding) {
$viewer = $this->getViewer();
$properties = id(new PHUIPropertyListView())
->setUser($viewer)
->setObject($binding);
$properties->invokeWillRenderEvent();
return $properties;
}
private function buildActionList(AlmanacBinding $binding) { private function buildActionList(AlmanacBinding $binding) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$id = $binding->getID(); $id = $binding->getID();