Differential D20645 Diff 49256 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) | ||||
| ->setText(pht('Add Provider')); | ->setText(pht('Add Provider')); | ||||
| if (!$is_disabled) { | |||||
| $button->setHref($this->getApplicationURI('config/new/')); | |||||
| } | |||||
amckinley: This feels bad, but without this the button is still clickable, even if it's been… | |||||
epriestleyUnsubmitted 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… | |||||
amckinleyAuthorUnsubmitted 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… | |||||
epriestleyUnsubmitted 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… | |||||
amckinleyAuthorUnsubmitted Done Inline ActionsAhhhh, that's what I was looking for. amckinley: Ahhhh, that's what I was looking for. | |||||
| $list->setFlush(true); | $list->setFlush(true); | ||||
| $list = id(new PHUIObjectBoxView()) | $list = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Providers')) | ->setHeaderText(pht('Providers')) | ||||
| ->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()) | ||||
| Show All 24 Lines | |||||
This feels bad, but without this the button is still clickable, even if it's been setDisable'd.