@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.

Add Herald support for projects

Summary:
Ref T10054. Ref T6113. I'm going to remove subscribers from projects to fix the confusion between "watch" and "subscribe".

Users who have unusual use cases where they legitimately want to know when a project's description is updated or members change can use Herald to follow it.

This is also useful in general and improves consistency, although I don't have too many use cases for it.

Test Plan: Wrote a Herald rule, edited a project, saw the rule fire and send me email about the change.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6113, T10054

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

+140 -2
+2 -2
resources/celerity/map.php
··· 152 152 'rsrc/css/phui/phui-text.css' => 'cf019f54', 153 153 'rsrc/css/phui/phui-timeline-view.css' => '2efceff8', 154 154 'rsrc/css/phui/phui-two-column-view.css' => '39ecafb1', 155 - 'rsrc/css/phui/phui-workboard-view.css' => '95a54f74', 155 + 'rsrc/css/phui/phui-workboard-view.css' => '8330bca5', 156 156 'rsrc/css/phui/phui-workpanel-view.css' => 'adec7699', 157 157 'rsrc/css/sprite-login.css' => '60e8560e', 158 158 'rsrc/css/sprite-menu.css' => '9dd65b92', ··· 829 829 'phui-theme-css' => '981a58f8', 830 830 'phui-timeline-view-css' => '2efceff8', 831 831 'phui-two-column-view-css' => '39ecafb1', 832 - 'phui-workboard-view-css' => '95a54f74', 832 + 'phui-workboard-view-css' => '8330bca5', 833 833 'phui-workpanel-view-css' => 'adec7699', 834 834 'phuix-action-list-view' => 'b5c256b8', 835 835 'phuix-action-view' => '8cf6d262',
+6
src/__phutil_library_map__.php
··· 1147 1147 'HeraldEffect' => 'applications/herald/engine/HeraldEffect.php', 1148 1148 'HeraldEmptyFieldValue' => 'applications/herald/value/HeraldEmptyFieldValue.php', 1149 1149 'HeraldEngine' => 'applications/herald/engine/HeraldEngine.php', 1150 + 'HeraldExactProjectsField' => 'applications/project/herald/HeraldExactProjectsField.php', 1150 1151 'HeraldField' => 'applications/herald/field/HeraldField.php', 1151 1152 'HeraldFieldGroup' => 'applications/herald/field/HeraldFieldGroup.php', 1152 1153 'HeraldFieldTestCase' => 'applications/herald/field/__tests__/HeraldFieldTestCase.php', ··· 2883 2884 'PhabricatorProjectEditPictureController' => 'applications/project/controller/PhabricatorProjectEditPictureController.php', 2884 2885 'PhabricatorProjectFulltextEngine' => 'applications/project/search/PhabricatorProjectFulltextEngine.php', 2885 2886 'PhabricatorProjectHeraldAction' => 'applications/project/herald/PhabricatorProjectHeraldAction.php', 2887 + 'PhabricatorProjectHeraldAdapter' => 'applications/project/herald/PhabricatorProjectHeraldAdapter.php', 2888 + 'PhabricatorProjectHeraldFieldGroup' => 'applications/project/herald/PhabricatorProjectHeraldFieldGroup.php', 2886 2889 'PhabricatorProjectHistoryController' => 'applications/project/controller/PhabricatorProjectHistoryController.php', 2887 2890 'PhabricatorProjectIconSet' => 'applications/project/icon/PhabricatorProjectIconSet.php', 2888 2891 'PhabricatorProjectInterface' => 'applications/project/interface/PhabricatorProjectInterface.php', ··· 5247 5250 'HeraldEffect' => 'Phobject', 5248 5251 'HeraldEmptyFieldValue' => 'HeraldFieldValue', 5249 5252 'HeraldEngine' => 'Phobject', 5253 + 'HeraldExactProjectsField' => 'HeraldField', 5250 5254 'HeraldField' => 'Phobject', 5251 5255 'HeraldFieldGroup' => 'HeraldGroup', 5252 5256 'HeraldFieldTestCase' => 'PhutilTestCase', ··· 7285 7289 'PhabricatorProjectEditPictureController' => 'PhabricatorProjectController', 7286 7290 'PhabricatorProjectFulltextEngine' => 'PhabricatorFulltextEngine', 7287 7291 'PhabricatorProjectHeraldAction' => 'HeraldAction', 7292 + 'PhabricatorProjectHeraldAdapter' => 'HeraldAdapter', 7293 + 'PhabricatorProjectHeraldFieldGroup' => 'HeraldFieldGroup', 7288 7294 'PhabricatorProjectHistoryController' => 'PhabricatorProjectController', 7289 7295 'PhabricatorProjectIconSet' => 'PhabricatorIconSet', 7290 7296 'PhabricatorProjectListController' => 'PhabricatorProjectController',
+15
src/applications/project/editor/PhabricatorProjectTransactionEditor.php
··· 917 917 ->save(); 918 918 } 919 919 920 + 921 + protected function shouldApplyHeraldRules( 922 + PhabricatorLiskDAO $object, 923 + array $xactions) { 924 + return true; 925 + } 926 + 927 + protected function buildHeraldAdapter( 928 + PhabricatorLiskDAO $object, 929 + array $xactions) { 930 + 931 + return id(new PhabricatorProjectHeraldAdapter()) 932 + ->setProject($object); 933 + } 934 + 920 935 }
+31
src/applications/project/herald/HeraldExactProjectsField.php
··· 1 + <?php 2 + 3 + final class HeraldExactProjectsField extends HeraldField { 4 + 5 + const FIELDCONST = 'projects.exact'; 6 + 7 + public function getHeraldFieldName() { 8 + return pht('Projects being edited'); 9 + } 10 + 11 + public function getFieldGroupKey() { 12 + return PhabricatorProjectHeraldFieldGroup::FIELDGROUPKEY; 13 + } 14 + 15 + public function supportsObject($object) { 16 + return ($object instanceof PhabricatorProject); 17 + } 18 + 19 + public function getHeraldFieldValue($object) { 20 + return array($object->getPHID()); 21 + } 22 + 23 + protected function getHeraldFieldStandardType() { 24 + return self::STANDARD_PHID_LIST; 25 + } 26 + 27 + protected function getDatasource() { 28 + return new PhabricatorProjectDatasource(); 29 + } 30 + 31 + }
+66
src/applications/project/herald/PhabricatorProjectHeraldAdapter.php
··· 1 + <?php 2 + 3 + final class PhabricatorProjectHeraldAdapter extends HeraldAdapter { 4 + 5 + private $project; 6 + 7 + protected function newObject() { 8 + return new PhabricatorProject(); 9 + } 10 + 11 + public function getAdapterApplicationClass() { 12 + return 'PhabricatorProjectApplication'; 13 + } 14 + 15 + public function getAdapterContentDescription() { 16 + return pht('React to projects being created or updated.'); 17 + } 18 + 19 + protected function initializeNewAdapter() { 20 + $this->project = $this->newObject(); 21 + } 22 + 23 + public function supportsApplicationEmail() { 24 + return true; 25 + } 26 + 27 + public function getRepetitionOptions() { 28 + return array( 29 + HeraldRepetitionPolicyConfig::EVERY, 30 + HeraldRepetitionPolicyConfig::FIRST, 31 + ); 32 + } 33 + 34 + public function supportsRuleType($rule_type) { 35 + switch ($rule_type) { 36 + case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL: 37 + case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL: 38 + return true; 39 + case HeraldRuleTypeConfig::RULE_TYPE_OBJECT: 40 + default: 41 + return false; 42 + } 43 + } 44 + 45 + public function setProject(PhabricatorProject $project) { 46 + $this->project = $project; 47 + return $this; 48 + } 49 + 50 + public function getProject() { 51 + return $this->project; 52 + } 53 + 54 + public function getObject() { 55 + return $this->project; 56 + } 57 + 58 + public function getAdapterContentName() { 59 + return pht('Projects'); 60 + } 61 + 62 + public function getHeraldName() { 63 + return pht('Project %s', $this->getProject()->getName()); 64 + } 65 + 66 + }
+15
src/applications/project/herald/PhabricatorProjectHeraldFieldGroup.php
··· 1 + <?php 2 + 3 + final class PhabricatorProjectHeraldFieldGroup extends HeraldFieldGroup { 4 + 5 + const FIELDGROUPKEY = 'projects.project'; 6 + 7 + public function getGroupLabel() { 8 + return pht('Project Fields'); 9 + } 10 + 11 + protected function getGroupOrder() { 12 + return 500; 13 + } 14 + 15 + }
+5
webroot/rsrc/css/phui/phui-workboard-view.css
··· 41 41 left: 253px; 42 42 } 43 43 44 + .device-desktop .phui-profile-menu-collapsed .project-board-wrapper 45 + .phui-workboard-view-shadow { 46 + left: 93px; 47 + } 48 + 44 49 .device-desktop .phui-workboard-view .aphront-multi-column-fixed 45 50 .aphront-multi-column-inner { 46 51 margin-left: 0;