Add a cancel button, provider crumb, and account card to registration
Summary:
Ref T1536.
- Add a "Cancel" button, to get back to login.
- Add a crumb showing the registering provider.
- Add an account card when registering with an external account
- Tailor some language to make it less ambiguous ("Phabricator Username", "Register Phabricator Account").
Test Plan:
{F46618}
{F46619}
Reviewers: chad, btrahan
Reviewed By: chad
CC: aran
Maniphest Tasks: T1536
Differential Revision: https://secure.phabricator.com/D6213
This commit is contained in:
@@ -23,8 +23,10 @@ final class PhabricatorAuthRegisterController
|
|||||||
if (strlen($this->accountKey)) {
|
if (strlen($this->accountKey)) {
|
||||||
$result = $this->loadAccountForRegistrationOrLinking($this->accountKey);
|
$result = $this->loadAccountForRegistrationOrLinking($this->accountKey);
|
||||||
list($account, $provider, $response) = $result;
|
list($account, $provider, $response) = $result;
|
||||||
|
$is_default = false;
|
||||||
} else {
|
} else {
|
||||||
list($account, $provider, $response) = $this->loadDefaultAccount();
|
list($account, $provider, $response) = $this->loadDefaultAccount();
|
||||||
|
$is_default = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($response) {
|
if ($response) {
|
||||||
@@ -259,10 +261,24 @@ final class PhabricatorAuthRegisterController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$form = id(new AphrontFormView())
|
$form = id(new AphrontFormView())
|
||||||
->setUser($request->getUser())
|
->setUser($request->getUser());
|
||||||
|
|
||||||
|
if (!$is_default) {
|
||||||
|
$form->appendChild(
|
||||||
|
id(new AphrontFormMarkupControl())
|
||||||
|
->setLabel(pht('External Account'))
|
||||||
|
->setValue(
|
||||||
|
id(new PhabricatorAuthAccountView())
|
||||||
|
->setUser($request->getUser())
|
||||||
|
->setExternalAccount($account)
|
||||||
|
->setAuthProvider($provider)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setLabel(pht('Username'))
|
->setLabel(pht('Phabricator Username'))
|
||||||
->setName('username')
|
->setName('username')
|
||||||
->setValue($value_username)
|
->setValue($value_username)
|
||||||
->setError($e_username));
|
->setError($e_username));
|
||||||
@@ -305,7 +321,8 @@ final class PhabricatorAuthRegisterController
|
|||||||
|
|
||||||
$form->appendChild(
|
$form->appendChild(
|
||||||
id(new AphrontFormSubmitControl())
|
id(new AphrontFormSubmitControl())
|
||||||
->setValue(pht('Create Account')));
|
->addCancelButton($this->getApplicationURI('start/'))
|
||||||
|
->setValue(pht('Register Phabricator Account')));
|
||||||
|
|
||||||
$title = pht('Phabricator Registration');
|
$title = pht('Phabricator Registration');
|
||||||
|
|
||||||
@@ -313,6 +330,9 @@ final class PhabricatorAuthRegisterController
|
|||||||
$crumbs->addCrumb(
|
$crumbs->addCrumb(
|
||||||
id(new PhabricatorCrumbView())
|
id(new PhabricatorCrumbView())
|
||||||
->setName(pht('Register')));
|
->setName(pht('Register')));
|
||||||
|
$crumbs->addCrumb(
|
||||||
|
id(new PhabricatorCrumbView())
|
||||||
|
->setName($provider->getProviderName()));
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
|
|||||||
Reference in New Issue
Block a user