@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Tidy up some Drydock UI

Summary: Ref T9253. We had some un-modern use of UI elements, clean that up. Add a tab for showing slot locks so you don't have to fish around in the database.

Test Plan: Looked at blueprints, resources and leases. Looked at slot locks.

Reviewers: chad, hach-que

Reviewed By: chad, hach-que

Maniphest Tasks: T9253

Differential Revision: https://secure.phabricator.com/D14119

+60 -9
+5 -1
src/applications/drydock/controller/DrydockBlueprintViewController.php
··· 61 61 $viewer, 62 62 $properties); 63 63 64 + $resource_box = id(new PHUIObjectBoxView()) 65 + ->setHeaderText(pht('Resources')) 66 + ->setObjectList($resource_list); 67 + 64 68 $timeline = $this->buildTransactionTimeline( 65 69 $blueprint, 66 70 new DrydockBlueprintTransactionQuery()); ··· 70 74 array( 71 75 $crumbs, 72 76 $object_box, 73 - $resource_list, 77 + $resource_box, 74 78 $timeline, 75 79 ), 76 80 array(
+28
src/applications/drydock/controller/DrydockController.php
··· 8 8 return $this->buildSideNavView()->getMenu(); 9 9 } 10 10 11 + protected function buildLocksTab($owner_phid) { 12 + $locks = DrydockSlotLock::loadLocks($owner_phid); 13 + 14 + $rows = array(); 15 + foreach ($locks as $lock) { 16 + $rows[] = array( 17 + $lock->getID(), 18 + $lock->getLockKey(), 19 + ); 20 + } 21 + 22 + $table = id(new AphrontTableView($rows)) 23 + ->setNoDataString(pht('No slot locks held.')) 24 + ->setHeaders( 25 + array( 26 + pht('ID'), 27 + pht('Lock Key'), 28 + )) 29 + ->setColumnClasses( 30 + array( 31 + null, 32 + 'wide', 33 + )); 34 + 35 + return id(new PHUIPropertyListView()) 36 + ->addRawContent($table); 37 + } 38 + 11 39 }
+10 -3
src/applications/drydock/controller/DrydockLeaseViewController.php
··· 42 42 $crumbs = $this->buildApplicationCrumbs(); 43 43 $crumbs->addTextCrumb($title, $lease_uri); 44 44 45 + $locks = $this->buildLocksTab($lease->getPHID()); 46 + 45 47 $object_box = id(new PHUIObjectBoxView()) 46 48 ->setHeader($header) 47 - ->addPropertyList($properties); 49 + ->addPropertyList($properties, pht('Properties')) 50 + ->addPropertyList($locks, pht('Slot Locks')); 51 + 52 + $log_box = id(new PHUIObjectBoxView()) 53 + ->setHeaderText(pht('Lease Logs')) 54 + ->setTable($log_table); 48 55 49 56 return $this->buildApplicationPage( 50 57 array( 51 58 $crumbs, 52 59 $object_box, 53 - $log_table, 60 + $log_box, 54 61 ), 55 62 array( 56 - 'title' => $title, 63 + 'title' => $title, 57 64 )); 58 65 59 66 }
+16 -5
src/applications/drydock/controller/DrydockResourceViewController.php
··· 54 54 $crumbs = $this->buildApplicationCrumbs(); 55 55 $crumbs->addTextCrumb(pht('Resource %d', $resource->getID())); 56 56 57 + $locks = $this->buildLocksTab($resource->getPHID()); 58 + 57 59 $object_box = id(new PHUIObjectBoxView()) 58 60 ->setHeader($header) 59 - ->addPropertyList($properties); 61 + ->addPropertyList($properties, pht('Properties')) 62 + ->addPropertyList($locks, pht('Slot Locks')); 63 + 64 + $lease_box = id(new PHUIObjectBoxView()) 65 + ->setHeaderText(pht('Leases')) 66 + ->setObjectList($lease_list); 67 + 68 + $log_box = id(new PHUIObjectBoxView()) 69 + ->setHeaderText(pht('Resource Logs')) 70 + ->setTable($log_table); 60 71 61 72 return $this->buildApplicationPage( 62 73 array( 63 74 $crumbs, 64 75 $object_box, 65 - $lease_list, 66 - $log_table, 76 + $lease_box, 77 + $log_box, 67 78 ), 68 79 array( 69 80 'title' => $title, ··· 95 106 private function buildPropertyListView( 96 107 DrydockResource $resource, 97 108 PhabricatorActionListView $actions) { 109 + $viewer = $this->getViewer(); 98 110 99 111 $view = new PHUIPropertyListView(); 100 112 $view->setActionList($actions); ··· 110 122 pht('Resource Type'), 111 123 $resource->getType()); 112 124 113 - // TODO: Load handle. 114 125 $view->addProperty( 115 126 pht('Blueprint'), 116 - $resource->getBlueprintPHID()); 127 + $viewer->renderHandle($resource->getBlueprintPHID())); 117 128 118 129 $attributes = $resource->getAttributes(); 119 130 if ($attributes) {
+1
src/applications/drydock/phid/DrydockBlueprintPHIDType.php
··· 29 29 $blueprint = $objects[$phid]; 30 30 $id = $blueprint->getID(); 31 31 32 + $handle->setName($blueprint->getBlueprintName()); 32 33 $handle->setURI("/drydock/blueprint/{$id}/"); 33 34 } 34 35 }