From da8beefa6c0b646c2a0fc98247a1ec0b5a9693dd Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 24 Jul 2011 12:28:51 -0700 Subject: [PATCH] Use AphrontFormLayoutView, not AphrontFormView, for GitHub 'Repository' interface Summary: See T58. When I originally wrote this interface you couldn't make a form that looked like a form but wasn't really a form, so I made it a real form. That meant you could hit "return" in the text input and submit the form, which didn't do anything but is vaguely silly. After D422 there's a layout-only form element, so switch to that. Test Plan: Loaded the tab, hit return in the textarea, it didn't do a form submit. Reviewed By: jungejason Reviewers: jungejason, tuomaspelkonen, aran CC: aran, jungejason, epriestley Differential Revision: 719 --- .../controller/edit/PhabricatorRepositoryEditController.php | 6 +++--- src/applications/repository/controller/edit/__init__.php | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/applications/repository/controller/edit/PhabricatorRepositoryEditController.php b/src/applications/repository/controller/edit/PhabricatorRepositoryEditController.php index 02b7623475..26dbe59196 100644 --- a/src/applications/repository/controller/edit/PhabricatorRepositoryEditController.php +++ b/src/applications/repository/controller/edit/PhabricatorRepositoryEditController.php @@ -508,7 +508,6 @@ class PhabricatorRepositoryEditController private function processGithubRequest() { $request = $this->getRequest(); - $user = $request->getUser(); $repository = $this->repository; $repository_id = $repository->getID(); @@ -516,9 +515,10 @@ class PhabricatorRepositoryEditController $path = '/github-post-receive/'.$repository_id.'/'.$token.'/'; $post_uri = PhabricatorEnv::getURI($path); - $gitform = new AphrontFormView(); + $gitform = new AphrontFormLayoutView(); $gitform - ->setUser($user) + ->setBackgroundShading(true) + ->setPadded(true) ->appendChild( '

You can configure GitHub to '. 'notify Phabricator after changes are pushed. Log into GitHub, go '. diff --git a/src/applications/repository/controller/edit/__init__.php b/src/applications/repository/controller/edit/__init__.php index 350f53cbc5..37a50995f1 100644 --- a/src/applications/repository/controller/edit/__init__.php +++ b/src/applications/repository/controller/edit/__init__.php @@ -22,6 +22,7 @@ phutil_require_module('phabricator', 'view/form/control/submit'); phutil_require_module('phabricator', 'view/form/control/text'); phutil_require_module('phabricator', 'view/form/control/textarea'); phutil_require_module('phabricator', 'view/form/error'); +phutil_require_module('phabricator', 'view/form/layout'); phutil_require_module('phabricator', 'view/layout/panel'); phutil_require_module('phabricator', 'view/layout/sidenav'); phutil_require_module('phabricator', 'view/utils');