mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-15 18:10:53 +01:00
(stable) Restore "Land Revision" action to UI
Summary: This was accidentally caught in the crossfire in D18150. This is stable enough to formalize instead of adding with an event hook. Test Plan: Looked at a candidate revision, saw "Land Revision" appear in UI again. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D18154
This commit is contained in:
parent
314723d309
commit
7cb67dc725
1 changed files with 23 additions and 0 deletions
|
@ -615,6 +615,29 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$curtain->addAction($relationship_submenu);
|
$curtain->addAction($relationship_submenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$repository = $revision->getRepository();
|
||||||
|
if ($repository && $repository->canPerformAutomation()) {
|
||||||
|
$revision_id = $revision->getID();
|
||||||
|
|
||||||
|
$op = new DrydockLandRepositoryOperation();
|
||||||
|
$barrier = $op->getBarrierToLanding($viewer, $revision);
|
||||||
|
|
||||||
|
if ($barrier) {
|
||||||
|
$can_land = false;
|
||||||
|
} else {
|
||||||
|
$can_land = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$action = id(new PhabricatorActionView())
|
||||||
|
->setName(pht('Land Revision'))
|
||||||
|
->setIcon('fa-fighter-jet')
|
||||||
|
->setHref("/differential/revision/operation/{$revision_id}/")
|
||||||
|
->setWorkflow(true)
|
||||||
|
->setDisabled(!$can_land);
|
||||||
|
|
||||||
|
$curtain->addAction($action);
|
||||||
|
}
|
||||||
|
|
||||||
return $curtain;
|
return $curtain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue