@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.

Lightly modernize OAuth server application view pages

Summary: Depends on D20624. Fixes T13330. The OAuth client pages are using some out-of-date rendering conventions; update them to modern conventions.

Test Plan:
Viewed a page, saw a modern header layout + curtain:

{F6534135}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13330

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

+48 -45
+48 -45
src/applications/oauthserver/controller/client/PhabricatorOAuthClientViewController.php
··· 15 15 } 16 16 17 17 $header = $this->buildHeaderView($client); 18 - $actions = $this->buildActionView($client); 19 18 $properties = $this->buildPropertyListView($client); 20 - $properties->setActionList($actions); 21 19 22 - $crumbs = $this->buildApplicationCrumbs(); 23 - $crumbs->addTextCrumb($client->getName()); 20 + $crumbs = $this->buildApplicationCrumbs() 21 + ->addTextCrumb($client->getName()) 22 + ->setBorder(true); 24 23 25 24 $timeline = $this->buildTransactionTimeline( 26 25 $client, ··· 28 27 $timeline->setShouldTerminate(true); 29 28 30 29 $box = id(new PHUIObjectBoxView()) 31 - ->setHeader($header) 30 + ->setHeaderText(pht('Details')) 31 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 32 32 ->addPropertyList($properties); 33 33 34 34 $title = pht('OAuth Application: %s', $client->getName()); 35 35 36 - return $this->newPage() 37 - ->setCrumbs($crumbs) 38 - ->setTitle($title) 39 - ->appendChild( 36 + $curtain = $this->buildCurtain($client); 37 + 38 + $columns = id(new PHUITwoColumnView()) 39 + ->setHeader($header) 40 + ->setCurtain($curtain) 41 + ->setMainColumn( 40 42 array( 41 43 $box, 42 44 $timeline, 43 45 )); 46 + 47 + return $this->newPage() 48 + ->setCrumbs($crumbs) 49 + ->setTitle($title) 50 + ->appendChild($columns); 44 51 } 45 52 46 53 private function buildHeaderView(PhabricatorOAuthServerClient $client) { ··· 60 67 return $header; 61 68 } 62 69 63 - private function buildActionView(PhabricatorOAuthServerClient $client) { 70 + private function buildCurtain(PhabricatorOAuthServerClient $client) { 64 71 $viewer = $this->getViewer(); 72 + $actions = array(); 65 73 66 74 $can_edit = PhabricatorPolicyFilter::hasCapability( 67 75 $viewer, ··· 70 78 71 79 $id = $client->getID(); 72 80 73 - $view = id(new PhabricatorActionListView()) 74 - ->setUser($viewer); 81 + $actions[] = id(new PhabricatorActionView()) 82 + ->setName(pht('Edit Application')) 83 + ->setIcon('fa-pencil') 84 + ->setWorkflow(!$can_edit) 85 + ->setDisabled(!$can_edit) 86 + ->setHref($client->getEditURI()); 75 87 76 - $view->addAction( 77 - id(new PhabricatorActionView()) 78 - ->setName(pht('Edit Application')) 79 - ->setIcon('fa-pencil') 80 - ->setWorkflow(!$can_edit) 81 - ->setDisabled(!$can_edit) 82 - ->setHref($client->getEditURI())); 83 - 84 - $view->addAction( 85 - id(new PhabricatorActionView()) 86 - ->setName(pht('Show Application Secret')) 87 - ->setIcon('fa-eye') 88 - ->setHref($this->getApplicationURI("client/secret/{$id}/")) 89 - ->setDisabled(!$can_edit) 90 - ->setWorkflow(true)); 88 + $actions[] = id(new PhabricatorActionView()) 89 + ->setName(pht('Show Application Secret')) 90 + ->setIcon('fa-eye') 91 + ->setHref($this->getApplicationURI("client/secret/{$id}/")) 92 + ->setDisabled(!$can_edit) 93 + ->setWorkflow(true); 91 94 92 95 $is_disabled = $client->getIsDisabled(); 93 96 if ($is_disabled) { ··· 100 103 101 104 $disable_uri = $this->getApplicationURI("client/disable/{$id}/"); 102 105 103 - $view->addAction( 104 - id(new PhabricatorActionView()) 105 - ->setName($disable_text) 106 - ->setIcon($disable_icon) 107 - ->setWorkflow(true) 108 - ->setDisabled(!$can_edit) 109 - ->setHref($disable_uri)); 106 + $actions[] = id(new PhabricatorActionView()) 107 + ->setName($disable_text) 108 + ->setIcon($disable_icon) 109 + ->setWorkflow(true) 110 + ->setDisabled(!$can_edit) 111 + ->setHref($disable_uri); 110 112 111 - $view->addAction( 112 - id(new PhabricatorActionView()) 113 - ->setName(pht('Generate Test Token')) 114 - ->setIcon('fa-plus') 115 - ->setWorkflow(true) 116 - ->setHref($this->getApplicationURI("client/test/{$id}/"))); 113 + $actions[] = id(new PhabricatorActionView()) 114 + ->setName(pht('Generate Test Token')) 115 + ->setIcon('fa-plus') 116 + ->setWorkflow(true) 117 + ->setHref($this->getApplicationURI("client/test/{$id}/")); 118 + 119 + $curtain = $this->newCurtainView($client); 120 + 121 + foreach ($actions as $action) { 122 + $curtain->addAction($action); 123 + } 117 124 118 - return $view; 125 + return $curtain; 119 126 } 120 127 121 128 private function buildPropertyListView(PhabricatorOAuthServerClient $client) { ··· 131 138 $view->addProperty( 132 139 pht('Redirect URI'), 133 140 $client->getRedirectURI()); 134 - 135 - $view->addProperty( 136 - pht('Created'), 137 - phabricator_datetime($client->getDateCreated(), $viewer)); 138 141 139 142 return $view; 140 143 }