From f504f40ee581389c295ae2bb17c865346663d67b Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 2 Apr 2019 09:09:12 -0700 Subject: [PATCH] Put "workflow" on Dashboard edit links when they're disabled Summary: Depends on D20367. Ref T13272. When an edit action is disabled, we add "workflow" so that the "You can't do this" message renders in a dialog instead of a separate page. These actions are implemented in a nonstandard way; standardize them. Test Plan: Clicked both actions as a user who could take them (got normal behavior); and as a user who could not (got permissions dialog errors). Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13272 Differential Revision: https://secure.phabricator.com/D20368 --- .../dashboard/PhabricatorDashboardViewController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php index b0beb1d314..14f3e3059f 100644 --- a/src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php +++ b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php @@ -79,7 +79,8 @@ final class PhabricatorDashboardViewController ->setName(pht('Edit Dashboard')) ->setIcon('fa-pencil') ->setHref($this->getApplicationURI("edit/{$id}/")) - ->setDisabled(!$can_edit)); + ->setDisabled(!$can_edit) + ->setWorkflow(!$can_edit)); $curtain->addAction( id(new PhabricatorActionView()) @@ -95,7 +96,7 @@ final class PhabricatorDashboardViewController ->setIcon('fa-check') ->setHref($this->getApplicationURI("archive/{$id}/")) ->setDisabled(!$can_edit) - ->setWorkflow($can_edit)); + ->setWorkflow(true)); } else { $curtain->addAction( id(new PhabricatorActionView()) @@ -103,7 +104,7 @@ final class PhabricatorDashboardViewController ->setIcon('fa-ban') ->setHref($this->getApplicationURI("archive/{$id}/")) ->setDisabled(!$can_edit) - ->setWorkflow($can_edit)); + ->setWorkflow(true)); } return $curtain;