Provide basic scaffolding for workboard column triggers
Summary: Depends on D20278. Ref T5474. This change creates some new empty objects that do nothing, and some new views for looking at those objects. There's no actual useful behavior yet. The "Edit" controller is custom instead of being driven by "EditEngine" because I expect it to be a Herald-style "add new rules" UI, and EditEngine isn't a clean match for those today (although maybe I'll try to move it over). The general idea here is: - Triggers are "real" objects with a real PHID. - Each trigger has a name and a collection of rules, like "Change status to: X" or "Play sound: Y". - Each column may be bound to a trigger. - Multiple columns may share the same trigger. - Later UI refinements will make the cases around "copy trigger" vs "reference the same trigger" vs "create a new ad-hoc trigger" more clear. - Triggers have their own edit policy. - Triggers are always world-visible, like Herald rules. Test Plan: Poked around, created some empty trigger objects, and nothing exploded. This doesn't actually do anything useful yet since triggers can't have any rule behavior and columns can't actually be bound to triggers. Reviewers: amckinley Reviewed By: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T5474 Differential Revision: https://secure.phabricator.com/D20279
This commit is contained in:
@@ -1111,10 +1111,8 @@ final class PhabricatorProjectBoardViewController
|
||||
));
|
||||
}
|
||||
|
||||
if (count($specs) > 1) {
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setType(PhabricatorActionView::TYPE_DIVIDER);
|
||||
}
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setType(PhabricatorActionView::TYPE_DIVIDER);
|
||||
|
||||
$batch_edit_uri = $request->getRequestURI();
|
||||
$batch_edit_uri->replaceQueryParam('batch', $column->getID());
|
||||
@@ -1174,6 +1172,40 @@ final class PhabricatorProjectBoardViewController
|
||||
->setWorkflow(true);
|
||||
}
|
||||
|
||||
if ($column->canHaveTrigger()) {
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setType(PhabricatorActionView::TYPE_DIVIDER);
|
||||
|
||||
$trigger = $column->getTrigger();
|
||||
if (!$trigger) {
|
||||
$set_uri = $this->getApplicationURI(
|
||||
new PhutilURI(
|
||||
'trigger/edit/',
|
||||
array(
|
||||
'columnPHID' => $column->getPHID(),
|
||||
)));
|
||||
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setIcon('fa-cogs')
|
||||
->setName(pht('New Trigger...'))
|
||||
->setHref($set_uri)
|
||||
->setDisabled(!$can_edit);
|
||||
} else {
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setIcon('fa-cogs')
|
||||
->setName(pht('View Trigger'))
|
||||
->setHref($trigger->getURI())
|
||||
->setDisabled(!$can_edit);
|
||||
}
|
||||
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setIcon('fa-times')
|
||||
->setName(pht('Remove Trigger'))
|
||||
->setHref('#')
|
||||
->setWorkflow(true)
|
||||
->setDisabled(!$can_edit || !$trigger);
|
||||
}
|
||||
|
||||
$column_menu = id(new PhabricatorActionListView())
|
||||
->setUser($viewer);
|
||||
foreach ($column_items as $item) {
|
||||
|
||||
Reference in New Issue
Block a user