Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15411476
D15415.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
11 KB
Referenced Files
None
Subscribers
None
D15415.id.diff
View Options
diff --git a/src/applications/almanac/controller/AlmanacBindingViewController.php b/src/applications/almanac/controller/AlmanacBindingViewController.php
--- a/src/applications/almanac/controller/AlmanacBindingViewController.php
+++ b/src/applications/almanac/controller/AlmanacBindingViewController.php
@@ -28,7 +28,7 @@
$properties = $this->buildPropertyList($binding);
$details = $this->buildPropertySection($binding);
- $actions = $this->buildActionList($binding);
+ $curtain = $this->buildCurtain($binding);
$header = id(new PHUIHeaderView())
->setUser($viewer)
@@ -62,14 +62,13 @@
$view = id(new PHUITwoColumnView())
->setHeader($header)
+ ->setCurtain($curtain)
->setMainColumn(array(
$issue,
$this->buildAlmanacPropertiesTable($binding),
$timeline,
))
- ->setPropertyList($properties)
- ->addPropertySection(pht('DETAILS'), $details)
- ->setActionList($actions);
+ ->addPropertySection(pht('DETAILS'), $details);
return $this->newPage()
->setTitle($title)
@@ -116,23 +115,25 @@
return $properties;
}
- private function buildActionList(AlmanacBinding $binding) {
+ private function buildCurtain(AlmanacBinding $binding) {
$viewer = $this->getViewer();
- $id = $binding->getID();
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$binding,
PhabricatorPolicyCapability::CAN_EDIT);
- $actions = id(new PhabricatorActionListView())
- ->setUser($viewer);
+ $id = $binding->getID();
+ $edit_uri = $this->getApplicationURI("binding/edit/{$id}/");
+ $disable_uri = $this->getApplicationURI("binding/disable/{$id}/");
- $actions->addAction(
+ $curtain = $this->newCurtainView($binding);
+
+ $curtain->addAction(
id(new PhabricatorActionView())
->setIcon('fa-pencil')
->setName(pht('Edit Binding'))
- ->setHref($this->getApplicationURI("binding/edit/{$id}/"))
+ ->setHref($edit_uri)
->setWorkflow(!$can_edit)
->setDisabled(!$can_edit));
@@ -144,17 +145,15 @@
$disable_text = pht('Disable Binding');
}
- $disable_href = $this->getApplicationURI("binding/disable/{$id}/");
-
- $actions->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setIcon($disable_icon)
->setName($disable_text)
- ->setHref($disable_href)
+ ->setHref($disable_uri)
->setWorkflow(true)
->setDisabled(!$can_edit));
- return $actions;
+ return $curtain;
}
}
diff --git a/src/applications/almanac/controller/AlmanacDeviceViewController.php b/src/applications/almanac/controller/AlmanacDeviceViewController.php
--- a/src/applications/almanac/controller/AlmanacDeviceViewController.php
+++ b/src/applications/almanac/controller/AlmanacDeviceViewController.php
@@ -23,8 +23,7 @@
$title = pht('Device %s', $device->getName());
- $properties = $this->buildPropertyList($device);
- $actions = $this->buildActionList($device);
+ $curtain = $this->buildCurtain($device);
$header = id(new PHUIHeaderView())
->setUser($viewer)
@@ -55,6 +54,7 @@
$view = id(new PHUITwoColumnView())
->setHeader($header)
+ ->setCurtain($curtain)
->setMainColumn(array(
$issue,
$interfaces,
@@ -62,9 +62,7 @@
$this->buildSSHKeysTable($device),
$this->buildServicesTable($device),
$timeline,
- ))
- ->setPropertyList($properties)
- ->setActionList($actions);
+ ));
return $this->newPage()
->setTitle($title)
@@ -75,37 +73,28 @@
));
}
- private function buildPropertyList(AlmanacDevice $device) {
+ private function buildCurtain(AlmanacDevice $device) {
$viewer = $this->getViewer();
- $properties = id(new PHUIPropertyListView())
- ->setUser($viewer)
- ->setObject($device);
-
- return $properties;
- }
-
- private function buildActionList(AlmanacDevice $device) {
- $viewer = $this->getViewer();
- $id = $device->getID();
-
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$device,
PhabricatorPolicyCapability::CAN_EDIT);
- $actions = id(new PhabricatorActionListView())
- ->setUser($viewer);
+ $id = $device->getID();
+ $edit_uri = $this->getApplicationURI("device/edit/{$id}/");
+
+ $curtain = $this->newCurtainView($device);
- $actions->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setIcon('fa-pencil')
->setName(pht('Edit Device'))
- ->setHref($this->getApplicationURI("device/edit/{$id}/"))
+ ->setHref($edit_uri)
->setWorkflow(!$can_edit)
->setDisabled(!$can_edit));
- return $actions;
+ return $curtain;
}
private function buildInterfaceList(AlmanacDevice $device) {
diff --git a/src/applications/almanac/controller/AlmanacNamespaceViewController.php b/src/applications/almanac/controller/AlmanacNamespaceViewController.php
--- a/src/applications/almanac/controller/AlmanacNamespaceViewController.php
+++ b/src/applications/almanac/controller/AlmanacNamespaceViewController.php
@@ -21,8 +21,7 @@
$title = pht('Namespace %s', $namespace->getName());
- $properties = $this->buildPropertyList($namespace);
- $actions = $this->buildActionList($namespace);
+ $curtain = $this->buildCurtain($namespace);
$header = id(new PHUIHeaderView())
->setUser($viewer)
@@ -41,11 +40,10 @@
$view = id(new PHUITwoColumnView())
->setHeader($header)
+ ->setCurtain($curtain)
->setMainColumn(array(
$timeline,
- ))
- ->setPropertyList($properties)
- ->setActionList($actions);
+ ));
return $this->newPage()
->setTitle($title)
@@ -56,39 +54,28 @@
));
}
- private function buildPropertyList(AlmanacNamespace $namespace) {
+ private function buildCurtain(AlmanacNamespace $namespace) {
$viewer = $this->getViewer();
- $properties = id(new PHUIPropertyListView())
- ->setUser($viewer)
- ->setObject($namespace);
-
- $properties->invokeWillRenderEvent();
-
- return $properties;
- }
-
- private function buildActionList(AlmanacNamespace $namespace) {
- $viewer = $this->getViewer();
- $id = $namespace->getID();
-
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$namespace,
PhabricatorPolicyCapability::CAN_EDIT);
- $actions = id(new PhabricatorActionListView())
- ->setUser($viewer);
+ $id = $namespace->getID();
+ $edit_uri = $this->getApplicationURI("namespace/edit/{$id}/");
+
+ $curtain = $this->newCurtainView($namespace);
- $actions->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setIcon('fa-pencil')
->setName(pht('Edit Namespace'))
- ->setHref($this->getApplicationURI("namespace/edit/{$id}/"))
+ ->setHref($edit_uri)
->setWorkflow(!$can_edit)
->setDisabled(!$can_edit));
- return $actions;
+ return $curtain;
}
}
diff --git a/src/applications/almanac/controller/AlmanacNetworkViewController.php b/src/applications/almanac/controller/AlmanacNetworkViewController.php
--- a/src/applications/almanac/controller/AlmanacNetworkViewController.php
+++ b/src/applications/almanac/controller/AlmanacNetworkViewController.php
@@ -21,8 +21,7 @@
$title = pht('Network %s', $network->getName());
- $properties = $this->buildPropertyList($network);
- $actions = $this->buildActionList($network);
+ $curtain = $this->buildCurtain($network);
$header = id(new PHUIHeaderView())
->setUser($viewer)
@@ -41,11 +40,10 @@
$view = id(new PHUITwoColumnView())
->setHeader($header)
+ ->setCurtain($curtain)
->setMainColumn(array(
$timeline,
- ))
- ->setPropertyList($properties)
- ->setActionList($actions);
+ ));
return $this->newPage()
->setTitle($title)
@@ -56,39 +54,29 @@
));
}
- private function buildPropertyList(AlmanacNetwork $network) {
- $viewer = $this->getViewer();
-
- $properties = id(new PHUIPropertyListView())
- ->setUser($viewer)
- ->setObject($network);
- $properties->invokeWillRenderEvent();
-
- return $properties;
- }
-
- private function buildActionList(AlmanacNetwork $network) {
+ private function buildCurtain(AlmanacNetwork $network) {
$viewer = $this->getViewer();
- $id = $network->getID();
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$network,
PhabricatorPolicyCapability::CAN_EDIT);
- $actions = id(new PhabricatorActionListView())
- ->setUser($viewer);
+ $id = $network->getID();
+ $edit_uri = $this->getApplicationURI("network/edit/{$id}/");
+
+ $curtain = $this->newCurtainView($network);
- $actions->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setIcon('fa-pencil')
->setName(pht('Edit Network'))
- ->setHref($this->getApplicationURI("network/edit/{$id}/"))
+ ->setHref($edit_uri)
->setWorkflow(!$can_edit)
->setDisabled(!$can_edit));
- return $actions;
+ return $curtain;
}
}
diff --git a/src/applications/almanac/controller/AlmanacServiceViewController.php b/src/applications/almanac/controller/AlmanacServiceViewController.php
--- a/src/applications/almanac/controller/AlmanacServiceViewController.php
+++ b/src/applications/almanac/controller/AlmanacServiceViewController.php
@@ -23,8 +23,7 @@
$title = pht('Service %s', $service->getName());
- $properties = $this->buildPropertyList($service);
- $actions = $this->buildActionList($service);
+ $curtain = $this->buildCurtain($service);
$details = $this->buildPropertySection($service);
$header = id(new PHUIHeaderView())
@@ -55,36 +54,19 @@
$view = id(new PHUITwoColumnView())
->setHeader($header)
+ ->setCurtain($curtain)
->setMainColumn(array(
$issue,
$details,
$bindings,
$this->buildAlmanacPropertiesTable($service),
$timeline,
- ))
- ->setPropertyList($properties)
- ->setActionList($actions);
+ ));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
- ->appendChild(
- array(
- $view,
- ));
- }
-
- private function buildPropertyList(
- AlmanacService $service) {
- $viewer = $this->getViewer();
-
- $view = id(new PHUIPropertyListView())
- ->setUser($viewer)
- ->setObject($service);
-
- $view->invokeWillRenderEvent();
-
- return $view;
+ ->appendChild($view);
}
private function buildPropertySection(
@@ -104,27 +86,28 @@
->appendChild($properties);
}
- private function buildActionList(AlmanacService $service) {
+ private function buildCurtain(AlmanacService $service) {
$viewer = $this->getViewer();
- $id = $service->getID();
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$service,
PhabricatorPolicyCapability::CAN_EDIT);
- $actions = id(new PhabricatorActionListView())
- ->setUser($viewer);
+ $id = $service->getID();
+ $edit_uri = $this->getApplicationURI("service/edit/{$id}/");
+
+ $curtain = $this->newCurtainView($service);
- $actions->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setIcon('fa-pencil')
->setName(pht('Edit Service'))
- ->setHref($this->getApplicationURI("service/edit/{$id}/"))
+ ->setHref($edit_uri)
->setWorkflow(!$can_edit)
->setDisabled(!$can_edit));
- return $actions;
+ return $curtain;
}
private function buildBindingList(AlmanacService $service) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 9:18 AM (1 d, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7390653
Default Alt Text
D15415.id.diff (11 KB)
Attached To
Mode
D15415: Use curtain views in Almanac
Attached
Detach File
Event Timeline
Log In to Comment