3 final class DiffusionBlockHeraldAction
6 const ACTIONCONST
= 'diffusion.block';
8 const DO_BLOCK
= 'do.block';
10 public function getHeraldActionName() {
11 return pht('Block push with message');
14 public function getActionGroupKey() {
15 return HeraldApplicationActionGroup
::ACTIONGROUPKEY
;
18 public function supportsObject($object) {
19 return ($object instanceof PhabricatorRepositoryPushLog
);
22 public function supportsRuleType($rule_type) {
23 return ($rule_type != HeraldRuleTypeConfig
::RULE_TYPE_PERSONAL
);
26 public function applyEffect($object, HeraldEffect
$effect) {
27 // This rule intentionally has no direct effect: the caller handles it
28 // after executing Herald.
29 $this->logEffect(self
::DO_BLOCK
);
32 public function getHeraldActionStandardType() {
33 return self
::STANDARD_TEXT
;
36 public function renderActionDescription($value) {
37 return pht('Block push with message: %s', $value);
40 protected function getActionEffectMap() {
42 self
::DO_BLOCK
=> array(
45 'name' => pht('Blocked Push'),
50 protected function renderActionEffectDescription($type, $data) {
53 return pht('Blocked push.');