1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

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
This commit is contained in:
epriestley 2019-04-02 09:09:12 -07:00
parent 5b38d2142c
commit f504f40ee5

View file

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