From 8dd7b544fe0a52fccf6fa4caf21478ac3dd175f0 Mon Sep 17 00:00:00 2001 From: Austin McKinley Date: Mon, 13 Feb 2017 07:02:11 -0800 Subject: [PATCH] Don't show an auth provider as enabled if it's still being created Test Plan: attempted to create a new auth provider; observed that "enabled" ui element does not render. viewed existing auth provider and observed that "enabled" ui element still renders Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Maniphest Tasks: T12245 Differential Revision: https://secure.phabricator.com/D17337 --- .../config/PhabricatorAuthEditController.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/applications/auth/controller/config/PhabricatorAuthEditController.php b/src/applications/auth/controller/config/PhabricatorAuthEditController.php index ec2941a3fb..6ff0be4383 100644 --- a/src/applications/auth/controller/config/PhabricatorAuthEditController.php +++ b/src/applications/auth/controller/config/PhabricatorAuthEditController.php @@ -191,16 +191,18 @@ final class PhabricatorAuthEditController ->setHeader(pht('%s: %s', $title, $provider->getProviderName())) ->setHeaderIcon($header_icon); - if ($config->getIsEnabled()) { - $status_name = pht('Enabled'); - $status_color = 'green'; - $status_icon = 'fa-check'; - $header->setStatus($status_icon, $status_color, $status_name); - } else if (!$is_new) { - $status_name = pht('Disabled'); - $status_color = 'indigo'; - $status_icon = 'fa-ban'; - $header->setStatus($status_icon, $status_color, $status_name); + if (!$is_new) { + if ($config->getIsEnabled()) { + $status_name = pht('Enabled'); + $status_color = 'green'; + $status_icon = 'fa-check'; + $header->setStatus($status_icon, $status_color, $status_name); + } else { + $status_name = pht('Disabled'); + $status_color = 'indigo'; + $status_icon = 'fa-ban'; + $header->setStatus($status_icon, $status_color, $status_name); + } } $config_name = 'auth.email-domains';