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

Respect token limits for "Assign to" and custom datasource fields in Herald

Summary:
See PHI173. Currently, Herald has an "Assign to" action for tasks, and you can specify custom fields with datasource values (like users or projects) that have a limit (like 1 "Owner", or 12 "Jury Members").

Herald doesn't support these limits right now, so you can write `[ Assign to ][ X, Y, Z ]`. This just means "Assign to X", but make it more clear by actually enforcing the limit in the UI.

Test Plan:
- Created a "projects" custom field with limit 1.
- Tried to create actions that 'assign to' or 'set custom field to' more than one thing, got helpfully rebuffed by the UI.
- Created an "add subscribers" action with more than one value.

Reviewers: amckinley

Reviewed By: amckinley

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

+24 -16
+11 -11
resources/celerity/map.php
··· 416 416 'rsrc/js/application/drydock/drydock-live-operation-status.js' => '901935ef', 417 417 'rsrc/js/application/files/behavior-icon-composer.js' => '8499b6ab', 418 418 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', 419 - 'rsrc/js/application/herald/HeraldRuleEditor.js' => '2dff5579', 419 + 'rsrc/js/application/herald/HeraldRuleEditor.js' => 'dca75c0e', 420 420 'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec', 421 421 'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3', 422 422 'rsrc/js/application/maniphest/behavior-batch-selector.js' => 'ad54037e', ··· 580 580 'global-drag-and-drop-css' => 'b556a948', 581 581 'harbormaster-css' => 'f491c9f4', 582 582 'herald-css' => 'cd8d0134', 583 - 'herald-rule-editor' => '2dff5579', 583 + 'herald-rule-editor' => 'dca75c0e', 584 584 'herald-test-css' => 'a52e323e', 585 585 'inline-comment-summary-css' => 'f23d4e8f', 586 586 'javelin-aphlict' => 'e1d4b11a', ··· 1105 1105 '2caa8fb8' => array( 1106 1106 'javelin-install', 1107 1107 'javelin-event', 1108 - ), 1109 - '2dff5579' => array( 1110 - 'multirow-row-manager', 1111 - 'javelin-install', 1112 - 'javelin-util', 1113 - 'javelin-dom', 1114 - 'javelin-stratcom', 1115 - 'javelin-json', 1116 - 'phabricator-prefab', 1117 1108 ), 1118 1109 '2ee659ce' => array( 1119 1110 'javelin-install', ··· 2029 2020 'javelin-dom', 2030 2021 'javelin-util', 2031 2022 'phabricator-shaped-request', 2023 + ), 2024 + 'dca75c0e' => array( 2025 + 'multirow-row-manager', 2026 + 'javelin-install', 2027 + 'javelin-util', 2028 + 'javelin-dom', 2029 + 'javelin-stratcom', 2030 + 'javelin-json', 2031 + 'phabricator-prefab', 2032 2032 ), 2033 2033 'de2e896f' => array( 2034 2034 'javelin-behavior',
+1
src/applications/herald/value/HeraldTokenizerFieldValue.php
··· 58 58 'datasourceURI' => $datasource->getDatasourceURI(), 59 59 'browseURI' => $datasource->getBrowseURI(), 60 60 'placeholder' => $datasource->getPlaceholderText(), 61 + 'limit' => $datasource->getLimit(), 61 62 ), 62 63 ); 63 64 }
+2 -3
src/applications/maniphest/herald/ManiphestTaskAssignOtherHeraldAction.php
··· 22 22 } 23 23 24 24 protected function getDatasource() { 25 - // TODO: Eventually, it would be nice to get "limit = 1" exported from here 26 - // up to the UI. 27 - return new ManiphestAssigneeDatasource(); 25 + return id(new ManiphestAssigneeDatasource()) 26 + ->setLimit(1); 28 27 } 29 28 30 29 public function renderActionDescription($value) {
+8 -1
src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldTokenizer.php
··· 94 94 } 95 95 96 96 public function getHeraldActionDatasource() { 97 - return $this->getDatasource(); 97 + $datasource = $this->getDatasource(); 98 + 99 + $limit = $this->getFieldConfigValue('limit'); 100 + if ($limit) { 101 + $datasource->setLimit($limit); 102 + } 103 + 104 + return $datasource; 98 105 } 99 106 100 107 private function renderHeraldHandleList($value) {
+2 -1
webroot/rsrc/js/application/herald/HeraldRuleEditor.js
··· 283 283 var tokenizerConfig = { 284 284 src: spec.datasourceURI, 285 285 placeholder: spec.placeholder, 286 - browseURI: spec.browseURI 286 + browseURI: spec.browseURI, 287 + limit: spec.limit 287 288 }; 288 289 289 290 var build = JX.Prefab.newTokenizerFromTemplate(