diff --git a/resources/celerity/map.php b/resources/celerity/map.php index c13dd2c0c5..04034037e6 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -371,7 +371,7 @@ return array( 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => 'e5822781', 'rsrc/js/application/files/behavior-icon-composer.js' => '8ef9ab58', 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', - 'rsrc/js/application/herald/HeraldRuleEditor.js' => '271ffdd7', + 'rsrc/js/application/herald/HeraldRuleEditor.js' => 'b2cae298', 'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec', 'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3', 'rsrc/js/application/maniphest/behavior-batch-editor.js' => 'f5d1233b', @@ -527,7 +527,7 @@ return array( 'global-drag-and-drop-css' => '697324ad', 'harbormaster-css' => '49d64eb4', 'herald-css' => '826075fa', - 'herald-rule-editor' => '271ffdd7', + 'herald-rule-editor' => 'b2cae298', 'herald-test-css' => '778b008e', 'homepage-panel-css' => 'e34bf140', 'inline-comment-summary-css' => '51efda3a', @@ -1009,15 +1009,6 @@ return array( 'phabricator-drag-and-drop-file-upload', 'phabricator-draggable-list', ), - '271ffdd7' => array( - 'multirow-row-manager', - 'javelin-install', - 'javelin-util', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-json', - 'phabricator-prefab', - ), '2818f5ce' => array( 'javelin-install', 'javelin-util', @@ -1701,6 +1692,15 @@ return array( 'javelin-uri', 'javelin-request', ), + 'b2cae298' => array( + 'multirow-row-manager', + 'javelin-install', + 'javelin-util', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-json', + 'phabricator-prefab', + ), 'b3a4b884' => array( 'javelin-behavior', 'phabricator-prefab', diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php index f50bdf4203..a43592c345 100644 --- a/src/applications/herald/adapter/HeraldAdapter.php +++ b/src/applications/herald/adapter/HeraldAdapter.php @@ -44,6 +44,7 @@ abstract class HeraldAdapter { const FIELD_TASK_STATUS = 'taskstatus'; const FIELD_PUSHER_IS_COMMITTER = 'pusher-is-committer'; const FIELD_PATH = 'path'; + const FIELD_SPACE = 'space'; const CONDITION_CONTAINS = 'contains'; const CONDITION_NOT_CONTAINS = '!contains'; @@ -101,6 +102,7 @@ abstract class HeraldAdapter { const VALUE_TASK_STATUS = 'taskstatus'; const VALUE_LEGAL_DOCUMENTS = 'legaldocuments'; const VALUE_APPLICATION_EMAIL = 'applicationemail'; + const VALUE_SPACE = 'space'; private $contentSource; private $isNewObject; @@ -219,6 +221,19 @@ abstract class HeraldAdapter { $value[] = $this->getApplicationEmail()->getPHID(); } return $value; + case self::FIELD_SPACE: + $object = $this->getObject(); + + if (!($object instanceof PhabricatorSpacesInterface)) { + throw new Exception( + pht( + 'Adapter object (of class "%s") does not implement interface '. + '"%s", so the Space field value can not be determined.', + get_class($object), + 'PhabricatorSpacesInterface')); + } + + return PhabricatorSpacesNamespaceQuery::getObjectSpacePHID($object); default: if ($this->isHeraldCustomKey($field_name)) { return $this->getCustomFieldValue($field_name); @@ -400,6 +415,7 @@ abstract class HeraldAdapter { self::FIELD_TASK_STATUS => pht('Task status'), self::FIELD_PUSHER_IS_COMMITTER => pht('Pusher same as committer'), self::FIELD_PATH => pht('Path'), + self::FIELD_SPACE => pht('Space'), ) + $this->getCustomFieldNameMap(); } @@ -453,6 +469,7 @@ abstract class HeraldAdapter { case self::FIELD_PUSHER: case self::FIELD_TASK_PRIORITY: case self::FIELD_TASK_STATUS: + case self::FIELD_SPACE: return array( self::CONDITION_IS_ANY, self::CONDITION_IS_NOT_ANY, @@ -957,6 +974,8 @@ abstract class HeraldAdapter { return self::VALUE_TASK_PRIORITY; case self::FIELD_TASK_STATUS: return self::VALUE_TASK_STATUS; + case self::FIELD_SPACE: + return self::VALUE_SPACE; default: return self::VALUE_USER; } diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php index a84130095a..906981af39 100644 --- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php +++ b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php @@ -73,6 +73,7 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter { self::FIELD_TASK_STATUS, self::FIELD_IS_NEW_OBJECT, self::FIELD_APPLICATION_EMAIL, + self::FIELD_SPACE, ), parent::getFields()); } diff --git a/src/applications/herald/adapter/HeraldPholioMockAdapter.php b/src/applications/herald/adapter/HeraldPholioMockAdapter.php index e4aab69e95..5c9c78c0ac 100644 --- a/src/applications/herald/adapter/HeraldPholioMockAdapter.php +++ b/src/applications/herald/adapter/HeraldPholioMockAdapter.php @@ -52,6 +52,7 @@ final class HeraldPholioMockAdapter extends HeraldAdapter { self::FIELD_CC, self::FIELD_PROJECTS, self::FIELD_IS_NEW_OBJECT, + self::FIELD_SPACE, ), parent::getFields()); } diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php index a2fbe7a108..a956063fdf 100644 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -632,6 +632,7 @@ final class HeraldRuleController extends HeraldController { 'email' => new PhabricatorMetaMTAMailableDatasource(), 'userorproject' => new PhabricatorProjectOrUserDatasource(), 'applicationemail' => new PhabricatorMetaMTAApplicationEmailDatasource(), + 'space' => new PhabricatorSpacesNamespaceDatasource(), ); foreach ($sources as $key => $source) { diff --git a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js index e7300528d6..c94dd0d6c0 100644 --- a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js +++ b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js @@ -222,6 +222,7 @@ JX.install('HeraldRuleEditor', { case 'taskstatus': case 'legaldocuments': case 'applicationemail': + case 'space': var tokenizer = this._newTokenizer(type); input = tokenizer[0]; get_fn = tokenizer[1];