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

Improve trigger editor behavior when switching to/from tokenizers

Summary:
Ref T13269. See D20329. When we switch trigger rule control types, reset the rule value.

Also, pick slightly nicer defaults for status/priority.

Test Plan:
- Created a "Change Status To: X" rule.
- Saved it.
- Edited it.
- Selected "Assign to" for the existing action's dropdown.
- Before: tokenizer filled with nonsense.
- After: tokenizer cleared.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13269

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

+22 -5
+2 -2
resources/celerity/map.php
··· 433 433 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => '600f440c', 434 434 'rsrc/js/application/transactions/behavior-transaction-comment-form.js' => '2bdadf1a', 435 435 'rsrc/js/application/transactions/behavior-transaction-list.js' => '9cec214e', 436 - 'rsrc/js/application/trigger/TriggerRule.js' => '1c60c3fc', 436 + 'rsrc/js/application/trigger/TriggerRule.js' => '41b7b4f6', 437 437 'rsrc/js/application/trigger/TriggerRuleControl.js' => '5faf27b9', 438 438 'rsrc/js/application/trigger/TriggerRuleEditor.js' => 'b49fd60c', 439 439 'rsrc/js/application/trigger/TriggerRuleType.js' => '4feea7d3', ··· 894 894 'syntax-default-css' => '055fc231', 895 895 'syntax-highlighting-css' => '4234f572', 896 896 'tokens-css' => 'ce5a50bd', 897 - 'trigger-rule' => '1c60c3fc', 897 + 'trigger-rule' => '41b7b4f6', 898 898 'trigger-rule-control' => '5faf27b9', 899 899 'trigger-rule-editor' => 'b49fd60c', 900 900 'trigger-rule-type' => '4feea7d3',
+1 -1
src/applications/project/trigger/PhabricatorProjectTriggerManiphestPriorityRule.php
··· 54 54 } 55 55 56 56 protected function getDefaultValue() { 57 - return head_key(ManiphestTaskPriority::getTaskPriorityMap()); 57 + return ManiphestTaskPriority::getDefaultPriority(); 58 58 } 59 59 60 60 protected function getPHUIXControlType() {
+1 -1
src/applications/project/trigger/PhabricatorProjectTriggerManiphestStatusRule.php
··· 53 53 } 54 54 55 55 protected function getDefaultValue() { 56 - return head_key(ManiphestTaskStatus::getTaskStatusMap()); 56 + return ManiphestTaskStatus::getDefaultClosedStatus(); 57 57 } 58 58 59 59 protected function getPHUIXControlType() {
+18 -1
webroot/rsrc/js/application/trigger/TriggerRule.js
··· 98 98 }, 99 99 100 100 _onTypeChange: function(control) { 101 - this.setType(control.value); 101 + var new_type = control.value; 102 + 103 + this.setType(new_type); 104 + 105 + // Before we build a new control, change the rule value to be appropriate 106 + // for the new rule type. 107 + 108 + // TODO: Currently, we set the rule value to the default value for the 109 + // type. This works most of the time, but if the user selects type "A", 110 + // makes a change to the value, selects type "B", then changes back to 111 + // type "A", it would be better to retain their edit. This is currently 112 + // difficult because of tokenizers: if you save their value, you get a 113 + // list of PHIDs which do not restore cleanly into tokens later. 114 + 115 + var editor = this.getEditor(); 116 + var type = editor.getType(new_type); 117 + this.setValue(type.getDefaultValue()); 118 + 102 119 this._rebuildValueControl(); 103 120 }, 104 121