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

View API Token: Only create AphrontFormView when needed

Summary: Only create `AphrontFormView $form` when needed. Makes the code logic slightly more readable.

Test Plan: Go to http://phorge.localhost/settings/panel/apitokens/ and create/view API Tokens. Still works.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D26199

+9 -10
+9 -10
src/applications/conduit/controller/PhabricatorConduitTokenEditController.php
··· 81 81 ->addSubmitButton($submit_button) 82 82 ->addCancelButton($panel_uri); 83 83 } else { 84 - $form = id(new AphrontFormView()) 85 - ->setUser($viewer); 86 - 87 84 if ($token->getTokenType() === PhabricatorConduitToken::TYPE_CLUSTER) { 88 85 $dialog->appendChild( 89 86 pht( ··· 91 88 'requests between nodes in a cluster. You can not use this '. 92 89 'token in external applications.')); 93 90 } else { 94 - $form->appendChild( 95 - id(new AphrontFormTextControl()) 96 - ->setLabel(pht('Token')) 97 - ->setValue($token->getToken())); 91 + $form = id(new AphrontFormView()) 92 + ->setUser($viewer) 93 + ->appendChild( 94 + id(new AphrontFormTextControl()) 95 + ->setLabel(pht('Token')) 96 + ->setValue($token->getToken())); 97 + 98 + $dialog->appendForm($form); 98 99 } 99 100 100 - $dialog 101 - ->appendForm($form) 102 - ->addCancelButton($panel_uri, pht('Done')); 101 + $dialog->addCancelButton($panel_uri, pht('Done')); 103 102 } 104 103 105 104 return $dialog;