Skip to content

Commit 3b60b18

Browse files
committed
herald: Remove custom actions
They're broken with HEAD and need to be re-written. Signed-off-by: Austin Seipp <[email protected]>
1 parent 22a0a47 commit 3b60b18

5 files changed

+130
-134
lines changed

src/__phutil_library_map__.php

-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
'PhabricatorBotMiscGhcHandler' => 'extensions/bot/handler/PhabricatorBotMiscGhcHandler.php',
1515
'PhabricatorBotServerAdminLogHandler' => 'extensions/bot/handler/PhabricatorBotServerAdminLogHandler.php',
1616
'PhabricatorRemarkupGhcTracRule' => 'extensions/markup/engine/remarkup/markuprule/PhabricatorRemarkupGhcTracRule.php',
17-
'SetTaskEditPolicyHeraldCustomAction' => 'extensions/herald/customaction/SetTaskEditPolicyHeraldCustomAction.php',
18-
'SetTaskViewPolicyHeraldCustomAction' => 'extensions/herald/customaction/SetTaskViewPolicyHeraldCustomAction.php',
1917
),
2018
'function' => array(),
2119
'xmap' => array(
@@ -24,7 +22,5 @@
2422
'PhabricatorBotMiscGhcHandler' => 'PhabricatorBotHandler',
2523
'PhabricatorBotServerAdminLogHandler' => 'PhabricatorBotHandler',
2624
'PhabricatorRemarkupGhcTracRule' => 'PhabricatorRemarkupCustomInlineRule',
27-
'SetTaskEditPolicyHeraldCustomAction' => 'HeraldCustomAction',
28-
'SetTaskViewPolicyHeraldCustomAction' => 'HeraldCustomAction',
2925
),
3026
));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
/**
4+
* Extends Herald with a custom 'Set "Editable By" policy' action for Maniphest
5+
* tasks.
6+
*
7+
* Primarily useful for email/support related addresses to be assigned to
8+
* private projects.
9+
*/
10+
//final class SetTaskEditPolicyHeraldAction extends HeraldAction {
11+
//
12+
// public function appliesToAdapter(HeraldAdapter $adapter) {
13+
// return $adapter instanceof HeraldManiphestTaskAdapter;
14+
// }
15+
//
16+
// public function appliesToRuleType($type) {
17+
// return $type == HeraldRuleTypeConfig::RULE_TYPE_GLOBAL;
18+
// }
19+
//
20+
// public function getActionKey() {
21+
// return 'custom:edit-policy';
22+
// }
23+
//
24+
// public function getActionName() {
25+
// return 'Set edit policy to project';
26+
// }
27+
//
28+
// public function getActionType() {
29+
// return HeraldAdapter::VALUE_PROJECT;
30+
// }
31+
//
32+
// public function applyEffect(
33+
// HeraldAdapter $adapter,
34+
// $object,
35+
// HeraldEffect $effect) {
36+
//
37+
// // First off, ensure there's only one set project
38+
// if (count($effect->getTarget()) != 1) {
39+
// throw new HeraldInvalidConditionException(
40+
// 'Expected only one project to be set for editability policy');
41+
// }
42+
//
43+
// $project = $effect->getTarget();
44+
// $project_phid = $project[0];
45+
//
46+
// // Set new value by queueing a transaction, and returning the transcript.
47+
// $adapter->queueTransaction(
48+
// id(new ManiphestTransaction())
49+
// ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
50+
// ->setNewValue($project_phid));
51+
//
52+
// return new HeraldApplyTranscript(
53+
// $effect,
54+
// true,
55+
// pht('Set edit policy of task'));
56+
// }
57+
//
58+
//}
59+
60+
// Local Variables:
61+
// fill-column: 80
62+
// indent-tabs-mode: nil
63+
// c-basic-offset: 2
64+
// buffer-file-coding-system: utf-8-unix
65+
// End:

src/extensions/herald/customaction/SetTaskEditPolicyHeraldCustomAction.php

-65
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
/**
4+
* Extends Herald with a custom 'Set "Visible To" policy' action for Maniphest
5+
* tasks.
6+
*
7+
* Primarily useful for email/support related addresses to be assigned to
8+
* private projects.
9+
*/
10+
//final class SetTaskViewPolicyHeraldAction extends HeraldAction {
11+
//
12+
// public function appliesToAdapter(HeraldAdapter $adapter) {
13+
// return $adapter instanceof HeraldManiphestTaskAdapter;
14+
// }
15+
//
16+
// public function appliesToRuleType($type) {
17+
// return $type == HeraldRuleTypeConfig::RULE_TYPE_GLOBAL;
18+
// }
19+
//
20+
// public function getActionKey() {
21+
// return 'custom:view-policy';
22+
// }
23+
//
24+
// public function getActionName() {
25+
// return 'Set view policy to project';
26+
// }
27+
//
28+
// public function getActionType() {
29+
// return HeraldAdapter::VALUE_PROJECT;
30+
// }
31+
//
32+
// public function applyEffect(
33+
// HeraldAdapter $adapter,
34+
// $object,
35+
// HeraldEffect $effect) {
36+
//
37+
// // First off, ensure there's only one set project
38+
// if (count($effect->getTarget()) != 1) {
39+
// throw new HeraldInvalidConditionException(
40+
// 'Expected only one project to be set for visibility policy');
41+
// }
42+
//
43+
// $project = $effect->getTarget();
44+
// $project_phid = $project[0];
45+
//
46+
// // Set new value by queueing a transaction, and returning the transcript.
47+
// $adapter->queueTransaction(
48+
// id(new ManiphestTransaction())
49+
// ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
50+
// ->setNewValue($project_phid));
51+
//
52+
// return new HeraldApplyTranscript(
53+
// $effect,
54+
// true,
55+
// pht('Set view policy of task'));
56+
// }
57+
//
58+
//}
59+
60+
// Local Variables:
61+
// fill-column: 80
62+
// indent-tabs-mode: nil
63+
// c-basic-offset: 2
64+
// buffer-file-coding-system: utf-8-unix
65+
// End:

src/extensions/herald/customaction/SetTaskViewPolicyHeraldCustomAction.php

-65
This file was deleted.

0 commit comments

Comments
 (0)