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

Modernize "Test Console" and fix a minor display bug with "Always"

Summary:
- Use the box view in the test console.
- Let the test console load tasks and mocks. We should move this to the adapters (`canAdaptObject($object)` or something).
- Fix a minor issue with "Always": hiding the whole cell could make the table layout weird in Safari, at least. Just hide the select instead.

Test Plan:
- Used test console on task.
- Used test console on mock.
- Created (silly) rule with "Always" and also some other conditions.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+21 -21
+1 -1
src/__celerity_resource_map__.php
··· 1176 1176 ), 1177 1177 'herald-rule-editor' => 1178 1178 array( 1179 - 'uri' => '/res/36222dde/rsrc/js/application/herald/HeraldRuleEditor.js', 1179 + 'uri' => '/res/c42c0444/rsrc/js/application/herald/HeraldRuleEditor.js', 1180 1180 'type' => 'js', 1181 1181 'requires' => 1182 1182 array(
+18 -13
src/applications/herald/controller/HeraldTestConsoleController.php
··· 31 31 } 32 32 33 33 if (!$errors) { 34 + 35 + // TODO: Let the adapters claim objects instead. 36 + 34 37 if ($object instanceof DifferentialRevision) { 35 38 $adapter = HeraldDifferentialRevisionAdapter::newLegacyAdapter( 36 39 $object, ··· 43 46 $object->getRepository(), 44 47 $object, 45 48 $data); 49 + } else if ($object instanceof ManiphestTask) { 50 + $adapter = id(new HeraldManiphestTaskAdapter()) 51 + ->setTask($object); 52 + } else if ($object instanceof PholioMock) { 53 + $adapter = id(new HeraldPholioMockAdapter()) 54 + ->setMock($object); 46 55 } else { 47 56 throw new Exception("Can not build adapter for object!"); 48 57 } ··· 77 86 $error_view = null; 78 87 } 79 88 80 - $text = pht('Enter an object to test rules '. 81 - 'for, like a Diffusion commit (e.g., rX123) or a '. 82 - 'Differential revision (e.g., D123). You will be shown the '. 83 - 'results of a dry run on the object.'); 89 + $text = pht( 90 + 'Enter an object to test rules for, like a Diffusion commit (e.g., '. 91 + 'rX123) or a Differential revision (e.g., D123). You will be shown '. 92 + 'the results of a dry run on the object.'); 84 93 85 94 $form = id(new AphrontFormView()) 86 95 ->setUser($user) ··· 96 105 id(new AphrontFormSubmitControl()) 97 106 ->setValue(pht('Test Rules'))); 98 107 99 - $nav = $this->buildSideNavView(); 100 - $nav->selectFilter('test'); 101 - $nav->appendChild( 102 - array( 103 - $error_view, 104 - $form, 105 - )); 108 + $box = id(new PHUIObjectBoxView()) 109 + ->setHeaderText(pht('Herald Test Console')) 110 + ->setFormError($error_view) 111 + ->setForm($form); 106 112 107 113 $crumbs = id($this->buildApplicationCrumbs()) 108 114 ->addCrumb( ··· 112 118 ->addCrumb( 113 119 id(new PhabricatorCrumbView()) 114 120 ->setName(pht('Test Console'))); 115 - $nav->setCrumbs($crumbs); 116 121 117 122 return $this->buildApplicationPage( 118 - $nav, 123 + $box, 119 124 array( 120 125 'title' => pht('Test Console'), 121 126 'device' => true,
+2 -7
webroot/rsrc/js/application/herald/HeraldRuleEditor.js
··· 165 165 this._onconditionchange(r); 166 166 167 167 var condition_name = this._config.conditions[row_id][1]; 168 - switch (condition_name) { 169 - case 'unconditionally': 170 - JX.DOM.hide(condition_cell); 171 - break; 172 - default: 173 - JX.DOM.show(condition_cell); 174 - break; 168 + if (condition_name == 'unconditionally') { 169 + JX.DOM.hide(condition_select); 175 170 } 176 171 }, 177 172 _onconditionchange : function(r) {