Hard code a "close task" action on every column Trigger

Summary: Depends on D20287. Ref T5474. This hard-codes a storage value for every trigger, with a "Change status to <default closed status>" rule and two bogus rules. Rules may now apply transactions when cards are dropped.

Test Plan: Dragged cards to a column with a trigger, saw them close.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T5474

Differential Revision: https://secure.phabricator.com/D20288
This commit is contained in:
epriestley
2019-03-14 16:40:18 -07:00
parent 916bf1a8f9
commit 149f8cc959
10 changed files with 408 additions and 3 deletions

View File

@@ -1270,6 +1270,7 @@ final class PhabricatorProjectBoardViewController
array(
'items' => hsprintf('%s', $trigger_menu),
'tip' => $trigger_tip,
'size' => 300,
));
return $trigger_button;

View File

@@ -70,6 +70,7 @@ final class PhabricatorProjectMoveController
$columns = id(new PhabricatorProjectColumnQuery())
->setViewer($viewer)
->withProjectPHIDs(array($project->getPHID()))
->needTriggers(true)
->execute();
$columns = mpull($columns, null, 'getPHID');
@@ -110,6 +111,19 @@ final class PhabricatorProjectMoveController
$xactions[] = $header_xaction;
}
if ($column->canHaveTrigger()) {
$trigger = $column->getTrigger();
if ($trigger) {
$trigger_xactions = $trigger->newDropTransactions(
$viewer,
$column,
$object);
foreach ($trigger_xactions as $trigger_xaction) {
$xactions[] = $trigger_xaction;
}
}
}
$editor = id(new ManiphestTransactionEditor())
->setActor($viewer)
->setContinueOnMissingFields(true)