@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement a "Space is any of..." condition in Herald

Summary: Ref T8498. Allow Herald rules to act on the Space which contains an object.

Test Plan:
- Wrote a "Space is any of..." rule, created tasks that matched and failed the rule.
- Also created a Pholio rule with the "Space..." condition.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8498

Differential Revision: https://secure.phabricator.com/D13242

+34 -11
+11 -11
resources/celerity/map.php
··· 371 371 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => 'e5822781', 372 372 'rsrc/js/application/files/behavior-icon-composer.js' => '8ef9ab58', 373 373 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', 374 - 'rsrc/js/application/herald/HeraldRuleEditor.js' => '271ffdd7', 374 + 'rsrc/js/application/herald/HeraldRuleEditor.js' => 'b2cae298', 375 375 'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec', 376 376 'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3', 377 377 'rsrc/js/application/maniphest/behavior-batch-editor.js' => 'f5d1233b', ··· 527 527 'global-drag-and-drop-css' => '697324ad', 528 528 'harbormaster-css' => '49d64eb4', 529 529 'herald-css' => '826075fa', 530 - 'herald-rule-editor' => '271ffdd7', 530 + 'herald-rule-editor' => 'b2cae298', 531 531 'herald-test-css' => '778b008e', 532 532 'homepage-panel-css' => 'e34bf140', 533 533 'inline-comment-summary-css' => '51efda3a', ··· 1008 1008 'phabricator-phtize', 1009 1009 'phabricator-drag-and-drop-file-upload', 1010 1010 'phabricator-draggable-list', 1011 - ), 1012 - '271ffdd7' => array( 1013 - 'multirow-row-manager', 1014 - 'javelin-install', 1015 - 'javelin-util', 1016 - 'javelin-dom', 1017 - 'javelin-stratcom', 1018 - 'javelin-json', 1019 - 'phabricator-prefab', 1020 1011 ), 1021 1012 '2818f5ce' => array( 1022 1013 'javelin-install', ··· 1700 1691 'javelin-dom', 1701 1692 'javelin-uri', 1702 1693 'javelin-request', 1694 + ), 1695 + 'b2cae298' => array( 1696 + 'multirow-row-manager', 1697 + 'javelin-install', 1698 + 'javelin-util', 1699 + 'javelin-dom', 1700 + 'javelin-stratcom', 1701 + 'javelin-json', 1702 + 'phabricator-prefab', 1703 1703 ), 1704 1704 'b3a4b884' => array( 1705 1705 'javelin-behavior',
+19
src/applications/herald/adapter/HeraldAdapter.php
··· 44 44 const FIELD_TASK_STATUS = 'taskstatus'; 45 45 const FIELD_PUSHER_IS_COMMITTER = 'pusher-is-committer'; 46 46 const FIELD_PATH = 'path'; 47 + const FIELD_SPACE = 'space'; 47 48 48 49 const CONDITION_CONTAINS = 'contains'; 49 50 const CONDITION_NOT_CONTAINS = '!contains'; ··· 101 102 const VALUE_TASK_STATUS = 'taskstatus'; 102 103 const VALUE_LEGAL_DOCUMENTS = 'legaldocuments'; 103 104 const VALUE_APPLICATION_EMAIL = 'applicationemail'; 105 + const VALUE_SPACE = 'space'; 104 106 105 107 private $contentSource; 106 108 private $isNewObject; ··· 219 221 $value[] = $this->getApplicationEmail()->getPHID(); 220 222 } 221 223 return $value; 224 + case self::FIELD_SPACE: 225 + $object = $this->getObject(); 226 + 227 + if (!($object instanceof PhabricatorSpacesInterface)) { 228 + throw new Exception( 229 + pht( 230 + 'Adapter object (of class "%s") does not implement interface '. 231 + '"%s", so the Space field value can not be determined.', 232 + get_class($object), 233 + 'PhabricatorSpacesInterface')); 234 + } 235 + 236 + return PhabricatorSpacesNamespaceQuery::getObjectSpacePHID($object); 222 237 default: 223 238 if ($this->isHeraldCustomKey($field_name)) { 224 239 return $this->getCustomFieldValue($field_name); ··· 400 415 self::FIELD_TASK_STATUS => pht('Task status'), 401 416 self::FIELD_PUSHER_IS_COMMITTER => pht('Pusher same as committer'), 402 417 self::FIELD_PATH => pht('Path'), 418 + self::FIELD_SPACE => pht('Space'), 403 419 ) + $this->getCustomFieldNameMap(); 404 420 } 405 421 ··· 453 469 case self::FIELD_PUSHER: 454 470 case self::FIELD_TASK_PRIORITY: 455 471 case self::FIELD_TASK_STATUS: 472 + case self::FIELD_SPACE: 456 473 return array( 457 474 self::CONDITION_IS_ANY, 458 475 self::CONDITION_IS_NOT_ANY, ··· 957 974 return self::VALUE_TASK_PRIORITY; 958 975 case self::FIELD_TASK_STATUS: 959 976 return self::VALUE_TASK_STATUS; 977 + case self::FIELD_SPACE: 978 + return self::VALUE_SPACE; 960 979 default: 961 980 return self::VALUE_USER; 962 981 }
+1
src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
··· 73 73 self::FIELD_TASK_STATUS, 74 74 self::FIELD_IS_NEW_OBJECT, 75 75 self::FIELD_APPLICATION_EMAIL, 76 + self::FIELD_SPACE, 76 77 ), 77 78 parent::getFields()); 78 79 }
+1
src/applications/herald/adapter/HeraldPholioMockAdapter.php
··· 52 52 self::FIELD_CC, 53 53 self::FIELD_PROJECTS, 54 54 self::FIELD_IS_NEW_OBJECT, 55 + self::FIELD_SPACE, 55 56 ), 56 57 parent::getFields()); 57 58 }
+1
src/applications/herald/controller/HeraldRuleController.php
··· 632 632 'email' => new PhabricatorMetaMTAMailableDatasource(), 633 633 'userorproject' => new PhabricatorProjectOrUserDatasource(), 634 634 'applicationemail' => new PhabricatorMetaMTAApplicationEmailDatasource(), 635 + 'space' => new PhabricatorSpacesNamespaceDatasource(), 635 636 ); 636 637 637 638 foreach ($sources as $key => $source) {
+1
webroot/rsrc/js/application/herald/HeraldRuleEditor.js
··· 222 222 case 'taskstatus': 223 223 case 'legaldocuments': 224 224 case 'applicationemail': 225 + case 'space': 225 226 var tokenizer = this._newTokenizer(type); 226 227 input = tokenizer[0]; 227 228 get_fn = tokenizer[1];