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

Update Auth for new UI

Summary: [WIP] Tossing this up for safety and to read through it. Need to test, update some of the other flows. This updates everything in Auth for new UI and modern conventions.

Test Plan: Loooots of random testing, new providers, edit providers, logging out, forgot password... more coming.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+156 -153
+5 -8
src/applications/auth/controller/PhabricatorAuthConfirmLinkController.php
··· 66 66 $crumbs = $this->buildApplicationCrumbs(); 67 67 $crumbs->addTextCrumb(pht('Confirm Link'), $panel_uri); 68 68 $crumbs->addTextCrumb($provider->getProviderName()); 69 + $crumbs->setBorder(true); 69 70 70 - return $this->buildApplicationPage( 71 - array( 72 - $crumbs, 73 - $dialog, 74 - ), 75 - array( 76 - 'title' => pht('Confirm External Account Link'), 77 - )); 71 + return $this->newPage() 72 + ->setTitle(pht('Confirm External Account Link')) 73 + ->setCrumbs($crumbs) 74 + ->appendChild($dialog); 78 75 } 79 76 80 77
+3 -5
src/applications/auth/controller/PhabricatorAuthController.php
··· 7 7 $view->setTitle($title); 8 8 $view->setErrors($messages); 9 9 10 - return $this->buildApplicationPage( 11 - $view, 12 - array( 13 - 'title' => $title, 14 - )); 10 + return $this->newPage() 11 + ->setTitle($title) 12 + ->appendChild($view); 15 13 16 14 } 17 15
+5 -8
src/applications/auth/controller/PhabricatorAuthLinkController.php
··· 116 116 $crumbs = $this->buildApplicationCrumbs(); 117 117 $crumbs->addTextCrumb(pht('Link Account'), $panel_uri); 118 118 $crumbs->addTextCrumb($provider->getProviderName($name)); 119 + $crumbs->setBorder(true); 119 120 120 - return $this->buildApplicationPage( 121 - array( 122 - $crumbs, 123 - $form, 124 - ), 125 - array( 126 - 'title' => $title, 127 - )); 121 + return $this->newPage() 122 + ->setTitle($title) 123 + ->setCrumbs($crumbs) 124 + ->appendChild($form); 128 125 } 129 126 130 127 }
+5 -9
src/applications/auth/controller/PhabricatorAuthLoginController.php
··· 236 236 $content) { 237 237 238 238 $crumbs = $this->buildApplicationCrumbs(); 239 - $crumbs->setBorder(true); 240 239 241 240 if ($this->getRequest()->getUser()->isLoggedIn()) { 242 241 $crumbs->addTextCrumb(pht('Link Account'), $provider->getSettingsURI()); ··· 245 244 } 246 245 247 246 $crumbs->addTextCrumb($provider->getProviderName()); 247 + $crumbs->setBorder(true); 248 248 249 - return $this->buildApplicationPage( 250 - array( 251 - $crumbs, 252 - $content, 253 - ), 254 - array( 255 - 'title' => pht('Login'), 256 - )); 249 + return $this->newPage() 250 + ->setTitle(pht('Login')) 251 + ->setCrumbs($crumbs) 252 + ->appendChild($content); 257 253 } 258 254 259 255 public function buildProviderErrorResponse(
+4 -5
src/applications/auth/controller/PhabricatorAuthNeedsApprovalController.php
··· 28 28 ->appendChild($wait_for_approval) 29 29 ->addCancelButton('/', pht('Wait Patiently')); 30 30 31 - return $this->buildApplicationPage( 32 - $dialog, 33 - array( 34 - 'title' => pht('Wait For Approval'), 35 - )); 31 + return $this->newPage() 32 + ->setTitle(pht('Wait For Approval')) 33 + ->appendChild($dialog); 34 + 36 35 } 37 36 38 37 }
+10 -9
src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php
··· 76 76 )); 77 77 } 78 78 79 - return $this->buildApplicationPage( 80 - array( 81 - $crumbs, 82 - $help, 83 - $panel, 84 - ), 85 - array( 86 - 'title' => pht('Add Multi-Factor Authentication'), 87 - )); 79 + $view = array( 80 + $help, 81 + $panel, 82 + ); 83 + 84 + return $this->newPage() 85 + ->setTitle(pht('Add Multi-Factor Authentication')) 86 + ->setCrumbs($crumbs) 87 + ->appendChild($view); 88 + 88 89 } 89 90 90 91 }
+16 -11
src/applications/auth/controller/PhabricatorAuthRegisterController.php
··· 497 497 $crumbs->addTextCrumb($provider->getProviderName()); 498 498 $title = pht('Phabricator Registration'); 499 499 } 500 + $crumbs->setBorder(true); 500 501 501 502 $welcome_view = null; 502 503 if ($is_setup) { ··· 511 512 } 512 513 513 514 $object_box = id(new PHUIObjectBoxView()) 514 - ->setHeaderText($title) 515 515 ->setForm($form) 516 516 ->setFormErrors($errors); 517 517 ··· 520 520 $invite_header = $this->renderInviteHeader($invite); 521 521 } 522 522 523 - return $this->buildApplicationPage( 524 - array( 525 - $crumbs, 526 - $welcome_view, 527 - $invite_header, 528 - $object_box, 529 - ), 530 - array( 531 - 'title' => $title, 532 - )); 523 + $header = id(new PHUIHeaderView()) 524 + ->setHeader($title); 525 + 526 + $view = id(new PHUITwoColumnView()) 527 + ->setHeader($header) 528 + ->setFooter(array( 529 + $welcome_view, 530 + $invite_header, 531 + $object_box, 532 + )); 533 + 534 + return $this->newPage() 535 + ->setTitle($title) 536 + ->setCrumbs($crumbs) 537 + ->appendChild($view); 533 538 } 534 539 535 540 private function loadDefaultAccount() {
+11 -10
src/applications/auth/controller/PhabricatorAuthStartController.php
··· 189 189 $crumbs->addTextCrumb(pht('Login')); 190 190 $crumbs->setBorder(true); 191 191 192 - return $this->buildApplicationPage( 193 - array( 194 - $crumbs, 195 - $header, 196 - $invite_message, 197 - $out, 198 - ), 199 - array( 200 - 'title' => pht('Login to Phabricator'), 201 - )); 192 + $title = pht('Login to Phabricator'); 193 + $view = array( 194 + $header, 195 + $invite_message, 196 + $out, 197 + ); 198 + 199 + return $this->newPage() 200 + ->setTitle($title) 201 + ->setCrumbs($crumbs) 202 + ->appendChild($view); 202 203 } 203 204 204 205
+1 -2
src/applications/auth/controller/PhabricatorDisabledUserController.php
··· 15 15 return new Aphront404Response(); 16 16 } 17 17 18 - return id(new AphrontDialogView()) 19 - ->setUser($viewer) 18 + return $this->newDialog() 20 19 ->setTitle(pht('Account Disabled')) 21 20 ->addCancelButton('/logout/', pht('Okay')) 22 21 ->appendParagraph(pht('Your account has been disabled.'));
+6 -8
src/applications/auth/controller/PhabricatorEmailLoginController.php
··· 144 144 145 145 $crumbs = $this->buildApplicationCrumbs(); 146 146 $crumbs->addTextCrumb(pht('Reset Password')); 147 + $crumbs->setBorder(true); 147 148 148 149 $dialog = new AphrontDialogView(); 149 150 $dialog->setUser($request->getUser()); ··· 152 153 $dialog->addSubmitButton(pht('Send Email')); 153 154 $dialog->setSubmitURI('/login/email/'); 154 155 155 - return $this->buildApplicationPage( 156 - array( 157 - $crumbs, 158 - $dialog, 159 - ), 160 - array( 161 - 'title' => pht('Forgot Password'), 162 - )); 156 + return $this->newPage() 157 + ->setTitle(pht('Forgot Password')) 158 + ->setCrumbs($crumbs) 159 + ->appendChild($dialog); 160 + 163 161 } 164 162 165 163 }
+6 -8
src/applications/auth/controller/PhabricatorEmailVerificationController.php
··· 77 77 78 78 $crumbs = $this->buildApplicationCrumbs(); 79 79 $crumbs->addTextCrumb(pht('Verify Email')); 80 + $crumbs->setBorder(true); 80 81 81 - return $this->buildApplicationPage( 82 - array( 83 - $crumbs, 84 - $dialog, 85 - ), 86 - array( 87 - 'title' => pht('Verify Email'), 88 - )); 82 + return $this->newPage() 83 + ->setTitle(pht('Verify Email')) 84 + ->setCrumbs($crumbs) 85 + ->appendChild($dialog); 86 + 89 87 } 90 88 91 89 }
+1 -4
src/applications/auth/controller/PhabricatorLogoutController.php
··· 56 56 } 57 57 58 58 if ($viewer->getPHID()) { 59 - $dialog = id(new AphrontDialogView()) 60 - ->setUser($viewer) 59 + return $this->newDialog() 61 60 ->setTitle(pht('Log out of Phabricator?')) 62 61 ->appendChild(pht('Are you sure you want to log out?')) 63 62 ->addSubmitButton(pht('Logout')) 64 63 ->addCancelButton('/'); 65 - 66 - return id(new AphrontDialogResponse())->setDialog($dialog); 67 64 } 68 65 69 66 return id(new AphrontRedirectResponse())->setURI('/');
+9 -8
src/applications/auth/controller/PhabricatorMustVerifyEmailController.php
··· 53 53 ->appendParagraph($send_again) 54 54 ->addSubmitButton(pht('Send Another Email')); 55 55 56 - return $this->buildApplicationPage( 57 - array( 58 - $sent, 59 - $dialog, 60 - ), 61 - array( 62 - 'title' => pht('Must Verify Email'), 63 - )); 56 + $view = array( 57 + $sent, 58 + $dialog, 59 + ); 60 + 61 + return $this->newPage() 62 + ->setTitle(pht('Must Verify Email')) 63 + ->appendChild($view); 64 + 64 65 } 65 66 66 67 }
+33 -33
src/applications/auth/controller/config/PhabricatorAuthEditController.php
··· 176 176 $button = pht('Add Provider'); 177 177 } 178 178 $crumb = pht('Add Provider'); 179 - $title = pht('Add Authentication Provider'); 179 + $title = pht('Add Auth Provider'); 180 + $header_icon = 'fa-plus-square'; 180 181 $cancel_uri = $this->getApplicationURI('/config/new/'); 181 182 } else { 182 183 $button = pht('Save'); 183 184 $crumb = pht('Edit Provider'); 184 - $title = pht('Edit Authentication Provider'); 185 + $title = pht('Edit Auth Provider'); 186 + $header_icon = 'fa-pencil'; 185 187 $cancel_uri = $this->getApplicationURI(); 188 + } 189 + 190 + $header = id(new PHUIHeaderView()) 191 + ->setHeader(pht('%s: %s', $title, $provider->getProviderName())) 192 + ->setHeaderIcon($header_icon); 193 + 194 + if ($config->getIsEnabled()) { 195 + $status_name = pht('Enabled'); 196 + $status_color = 'green'; 197 + $status_icon = 'fa-check'; 198 + $header->setStatus($status_icon, $status_color, $status_name); 199 + } else if (!$is_new) { 200 + $status_name = pht('Disabled'); 201 + $status_color = 'indigo'; 202 + $status_icon = 'fa-ban'; 203 + $header->setStatus($status_icon, $status_color, $status_name); 186 204 } 187 205 188 206 $config_name = 'auth.email-domains'; ··· 253 271 'Phabricator will automatically login with this provider if it is '. 254 272 'the only available provider.')); 255 273 256 - $status_tag = id(new PHUITagView()) 257 - ->setType(PHUITagView::TYPE_STATE); 258 - if ($is_new) { 259 - $status_tag 260 - ->setName(pht('New Provider')) 261 - ->setBackgroundColor('blue'); 262 - } else if ($config->getIsEnabled()) { 263 - $status_tag 264 - ->setName(pht('Enabled')) 265 - ->setBackgroundColor('green'); 266 - } else { 267 - $status_tag 268 - ->setName(pht('Disabled')) 269 - ->setBackgroundColor('red'); 270 - } 271 - 272 274 $form = id(new AphrontFormView()) 273 275 ->setUser($viewer) 274 - ->appendChild( 275 - id(new AphrontFormStaticControl()) 276 - ->setLabel(pht('Provider')) 277 - ->setValue($provider->getProviderName())) 278 - ->appendChild( 279 - id(new AphrontFormStaticControl()) 280 - ->setLabel(pht('Status')) 281 - ->setValue($status_tag)) 282 276 ->appendChild( 283 277 id(new AphrontFormCheckboxControl()) 284 278 ->setLabel(pht('Allow')) ··· 348 342 349 343 $crumbs = $this->buildApplicationCrumbs(); 350 344 $crumbs->addTextCrumb($crumb); 345 + $crumbs->setBorder(true); 351 346 352 347 $timeline = null; 353 348 if (!$is_new) { ··· 358 353 foreach ($xactions as $xaction) { 359 354 $xaction->setProvider($provider); 360 355 } 356 + $timeline->setShouldTerminate(true); 361 357 } 362 358 363 359 $form_box = id(new PHUIObjectBoxView()) 364 - ->setHeaderText($title) 360 + ->setHeaderText(pht('Provider')) 365 361 ->setFormErrors($errors) 362 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 366 363 ->setForm($form); 367 364 368 - return $this->buildApplicationPage( 369 - array( 370 - $crumbs, 365 + $view = id(new PHUITwoColumnView()) 366 + ->setHeader($header) 367 + ->setFooter(array( 371 368 $form_box, 372 369 $footer, 373 370 $timeline, 374 - ), 375 - array( 376 - 'title' => $title, 377 371 )); 372 + 373 + return $this->newPage() 374 + ->setTitle($title) 375 + ->setCrumbs($crumbs) 376 + ->appendChild($view); 377 + 378 378 } 379 379 380 380 }
+20 -15
src/applications/auth/controller/config/PhabricatorAuthListController.php
··· 3 3 final class PhabricatorAuthListController 4 4 extends PhabricatorAuthProviderConfigController { 5 5 6 - public function processRequest() { 7 - $request = $this->getRequest(); 8 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $this->getViewer(); 9 8 10 9 $configs = id(new PhabricatorAuthProviderConfigQuery()) 11 10 ->setViewer($viewer) ··· 93 92 94 93 $crumbs = $this->buildApplicationCrumbs(); 95 94 $crumbs->addTextCrumb(pht('Auth Providers')); 95 + $crumbs->setBorder(true); 96 96 97 97 $domains_key = 'auth.email-domains'; 98 98 $domains_link = $this->renderConfigLink($domains_key); ··· 155 155 ->setDisabled(!$can_manage) 156 156 ->setText(pht('Add Provider')); 157 157 158 + $list->setFlush(true); 159 + $list = id(new PHUIObjectBoxView()) 160 + ->setHeaderText(pht('Providers')) 161 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 162 + ->appendChild($list); 163 + 164 + $title = pht('Auth Providers'); 158 165 $header = id(new PHUIHeaderView()) 159 - ->setHeader(pht('Authentication Providers')) 166 + ->setHeader($title) 167 + ->setHeaderIcon('fa-key') 160 168 ->addActionLink($button); 161 169 162 - $list->setFlush(true); 163 - $list = id(new PHUIObjectBoxView()) 170 + $view = id(new PHUITwoColumnView()) 164 171 ->setHeader($header) 165 - ->setInfoView($warning) 166 - ->appendChild($list); 167 - 168 - return $this->buildApplicationPage( 169 - array( 170 - $crumbs, 172 + ->setFooter(array( 173 + $warning, 171 174 $list, 172 - ), 173 - array( 174 - 'title' => pht('Authentication Providers'), 175 175 )); 176 + 177 + return $this->newPage() 178 + ->setTitle($title) 179 + ->setCrumbs($crumbs) 180 + ->appendChild($view); 176 181 } 177 182 178 183 private function renderConfigLink($key) {
+18 -7
src/applications/auth/controller/config/PhabricatorAuthNewController.php
··· 80 80 ->setValue(pht('Continue'))); 81 81 82 82 $form_box = id(new PHUIObjectBoxView()) 83 - ->setHeaderText(pht('Add Authentication Provider')) 83 + ->setHeaderText(pht('Provider')) 84 84 ->setFormErrors($errors) 85 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 85 86 ->setForm($form); 86 87 87 88 $crumbs = $this->buildApplicationCrumbs(); 88 89 $crumbs->addTextCrumb(pht('Add Provider')); 90 + $crumbs->setBorder(true); 89 91 90 - return $this->buildApplicationPage( 91 - array( 92 - $crumbs, 92 + $title = pht('Add Auth Provider'); 93 + 94 + $header = id(new PHUIHeaderView()) 95 + ->setHeader($title) 96 + ->setHeaderIcon('fa-plus-square'); 97 + 98 + $view = id(new PHUITwoColumnView()) 99 + ->setHeader($header) 100 + ->setFooter(array( 93 101 $form_box, 94 - ), 95 - array( 96 - 'title' => pht('Add Authentication Provider'), 97 102 )); 103 + 104 + return $this->newPage() 105 + ->setTitle($title) 106 + ->setCrumbs($crumbs) 107 + ->appendChild($view); 108 + 98 109 } 99 110 100 111 }
+3 -3
src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php
··· 44 44 switch ($this->getTransactionType()) { 45 45 case self::TYPE_ENABLE: 46 46 if ($new) { 47 - return 'fa-play'; 47 + return 'fa-check'; 48 48 } else { 49 - return 'fa-pause'; 49 + return 'fa-ban'; 50 50 } 51 51 } 52 52 ··· 62 62 if ($new) { 63 63 return 'green'; 64 64 } else { 65 - return 'red'; 65 + return 'indigo'; 66 66 } 67 67 } 68 68