Differential D20645 Diff 49264 src/applications/auth/controller/config/PhabricatorAuthListController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/config/PhabricatorAuthListController.php
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$guidance_context = id(new PhabricatorAuthProvidersGuidanceContext()) | $guidance_context = id(new PhabricatorAuthProvidersGuidanceContext()) | ||||
->setCanManage($can_manage); | ->setCanManage($can_manage); | ||||
$guidance = id(new PhabricatorGuidanceEngine()) | $guidance = id(new PhabricatorGuidanceEngine()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setGuidanceContext($guidance_context) | ->setGuidanceContext($guidance_context) | ||||
->newInfoView(); | ->newInfoView(); | ||||
$is_disabled = (!$can_manage || $is_locked); | |||||
$button = id(new PHUIButtonView()) | $button = id(new PHUIButtonView()) | ||||
->setTag('a') | ->setTag('a') | ||||
->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE) | ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE) | ||||
->setHref($this->getApplicationURI('config/new/')) | |||||
->setIcon('fa-plus') | ->setIcon('fa-plus') | ||||
->setDisabled(!$can_manage || $is_locked) | ->setDisabled($is_disabled) | ||||
->setWorkflow($is_disabled) | |||||
->setHref($this->getApplicationURI('config/new/')) | |||||
->setText(pht('Add Provider')); | ->setText(pht('Add Provider')); | ||||
$list->setFlush(true); | $list->setFlush(true); | ||||
$list = id(new PHUIObjectBoxView()) | $list = id(new PHUIObjectBoxView()) | ||||
->setHeaderText(pht('Providers')) | ->setHeaderText(pht('Providers')) | ||||
amckinley: This feels bad, but without this the button is still clickable, even if it's been… | |||||
Not Done Inline ActionsIn general, we let you click disabled things elsewhere and explain why the thing is disabled when you click it, so that's possibly fine? epriestley: In general, we let you click disabled things elsewhere and explain why the thing is disabled… | |||||
Done Inline ActionsWithout this change, clicking the button navigates to /auth/config/new/ which shows the config warning instead of displaying the normal form. Is that ok, or should the click pop a little dialogue with the warning instead of navigating away from /auth/? amckinley: Without this change, clicking the button navigates to `/auth/config/new/` which shows the… | |||||
Not Done Inline ActionsOh -- preferably, link the button in both cases and use setWorkflow($is_disabled) to make it pop a dialog if you click the disabled state. epriestley: Oh -- preferably, link the button in both cases and use `setWorkflow($is_disabled)` to make it… | |||||
Done Inline ActionsAhhhh, that's what I was looking for. amckinley: Ahhhh, that's what I was looking for. | |||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
->appendChild($list); | ->appendChild($list); | ||||
$title = pht('Login and Registration Providers'); | $title = pht('Login and Registration Providers'); | ||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setHeader($title) | ->setHeader($title) | ||||
->setHeaderIcon('fa-key') | ->setHeaderIcon('fa-key') | ||||
->addActionLink($button); | ->addActionLink($button); | ||||
Show All 21 Lines |
This feels bad, but without this the button is still clickable, even if it's been setDisable'd.