Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14768021
D10873.id26112.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D10873.id26112.diff
View Options
diff --git a/src/applications/drydock/controller/DrydockLeaseViewController.php b/src/applications/drydock/controller/DrydockLeaseViewController.php
--- a/src/applications/drydock/controller/DrydockLeaseViewController.php
+++ b/src/applications/drydock/controller/DrydockLeaseViewController.php
@@ -129,9 +129,31 @@
pht('Resource Type'),
$lease->getResourceType());
- $view->addProperty(
- pht('Resource'),
- $lease->getResourceID());
+ $resource = id(new DrydockResourceQuery())
+ ->setViewer($this->getViewer())
+ ->withIDs(array($lease->getResourceID()))
+ ->executeOne();
+
+ if ($resource !== null) {
+ $resource_handle = id(new PhabricatorHandleQuery())
+ ->setViewer($this->getViewer())
+ ->withPHIDs(array($resource->getPHID()))
+ ->executeOne();
+
+ if ($resource_handle !== null) {
+ $view->addProperty(
+ pht('Resource'),
+ $resource_handle->renderLink());
+ } else {
+ $view->addProperty(
+ pht('Resource'),
+ pht('Unknown Resource'));
+ }
+ } else {
+ $view->addProperty(
+ pht('Resource'),
+ pht('Unknown Resource'));
+ }
$attributes = $lease->getAttributes();
if ($attributes) {
diff --git a/src/applications/drydock/controller/DrydockResourceViewController.php b/src/applications/drydock/controller/DrydockResourceViewController.php
--- a/src/applications/drydock/controller/DrydockResourceViewController.php
+++ b/src/applications/drydock/controller/DrydockResourceViewController.php
@@ -117,10 +117,20 @@
pht('Resource Type'),
$resource->getType());
- // TODO: Load handle.
- $view->addProperty(
- pht('Blueprint'),
- $resource->getBlueprintPHID());
+ $blueprint = id(new PhabricatorHandleQuery())
+ ->setViewer($this->getViewer())
+ ->withPHIDs(array($resource->getBlueprintPHID()))
+ ->executeOne();
+
+ if ($blueprint === null) {
+ $view->addProperty(
+ pht('Blueprint'),
+ pht('Unknown Blueprint'));
+ } else {
+ $view->addProperty(
+ pht('Blueprint'),
+ $blueprint->renderLink());
+ }
$attributes = $resource->getAttributes();
if ($attributes) {
diff --git a/src/applications/drydock/phid/DrydockBlueprintPHIDType.php b/src/applications/drydock/phid/DrydockBlueprintPHIDType.php
--- a/src/applications/drydock/phid/DrydockBlueprintPHIDType.php
+++ b/src/applications/drydock/phid/DrydockBlueprintPHIDType.php
@@ -29,6 +29,10 @@
$blueprint = $objects[$phid];
$id = $blueprint->getID();
+ $handle->setName(pht(
+ 'Blueprint %d: %s',
+ $id,
+ $blueprint->getBlueprintName()));
$handle->setURI("/drydock/blueprint/{$id}/");
}
}
diff --git a/src/applications/drydock/phid/DrydockResourcePHIDType.php b/src/applications/drydock/phid/DrydockResourcePHIDType.php
--- a/src/applications/drydock/phid/DrydockResourcePHIDType.php
+++ b/src/applications/drydock/phid/DrydockResourcePHIDType.php
@@ -29,6 +29,10 @@
$resource = $objects[$phid];
$id = $resource->getID();
+ $handle->setName(pht(
+ 'Resource %d: %s',
+ $id,
+ $resource->getName()));
$handle->setURI("/drydock/resource/{$id}/");
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 6:35 PM (19 h, 7 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7042531
Default Alt Text
D10873.id26112.diff (3 KB)
Attached To
Mode
D10873: [drydock/core] Show blueprints / resources as links in Drydock view controllers
Attached
Detach File
Event Timeline
Log In to Comment