diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -399,7 +399,7 @@ 'rsrc/js/application/drydock/drydock-live-operation-status.js' => '901935ef', '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' => '91a6031b', + 'rsrc/js/application/herald/HeraldRuleEditor.js' => '5bd8f385', 'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec', 'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3', 'rsrc/js/application/maniphest/behavior-batch-editor.js' => '782ab6e7', @@ -554,7 +554,7 @@ 'global-drag-and-drop-css' => '697324ad', 'harbormaster-css' => 'b0758ca5', 'herald-css' => '826075fa', - 'herald-rule-editor' => '91a6031b', + 'herald-rule-editor' => '5bd8f385', 'herald-test-css' => 'a52e323e', 'inline-comment-summary-css' => '51efda3a', 'javelin-aphlict' => '5359e785', @@ -1225,6 +1225,15 @@ 'javelin-uri', 'javelin-routable', ), + '5bd8f385' => array( + 'multirow-row-manager', + 'javelin-install', + 'javelin-util', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-json', + 'phabricator-prefab', + ), '5c54cbf3' => array( 'javelin-behavior', 'javelin-stratcom', @@ -1533,15 +1542,6 @@ 'javelin-dom', 'javelin-request', ), - '91a6031b' => array( - 'multirow-row-manager', - 'javelin-install', - 'javelin-util', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-json', - 'phabricator-prefab', - ), '93d0c9e3' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/src/applications/herald/action/HeraldAction.php b/src/applications/herald/action/HeraldAction.php --- a/src/applications/herald/action/HeraldAction.php +++ b/src/applications/herald/action/HeraldAction.php @@ -95,9 +95,13 @@ switch ($type) { case self::STANDARD_PHID_LIST: - $handles = $viewer->loadHandles($target); - $handles = iterator_to_array($handles); - return mpull($handles, 'getName', 'getPHID'); + $datasource = $this->getDatasource(); + + if (!$datasource) { + return array(); + } + + return $datasource->getWireTokens($target); } return $target; diff --git a/src/applications/herald/value/HeraldTokenizerFieldValue.php b/src/applications/herald/value/HeraldTokenizerFieldValue.php --- a/src/applications/herald/value/HeraldTokenizerFieldValue.php +++ b/src/applications/herald/value/HeraldTokenizerFieldValue.php @@ -80,24 +80,10 @@ $viewer = $this->getViewer(); $value = (array)$value; - // TODO: This should eventually render properly through the datasource - // to get icons and colors. + $datasource = $this->getDatasource() + ->setViewer($viewer); - if ($this->valueMap !== null) { - $map = array(); - foreach ($value as $v) { - $map[$v] = idx($this->valueMap, $v, $v); - } - return $map; - } - - $handles = $viewer->loadHandles($value); - - $map = array(); - foreach ($value as $v) { - $map[$v] = $handles[$v]->getName(); - } - return $map; + return $datasource->getWireTokens($value); } } diff --git a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js --- a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js +++ b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js @@ -293,7 +293,8 @@ }, function(map) { for (var k in map) { - build.tokenizer.addToken(k, map[k]); + var v = JX.Prefab.transformDatasourceResults(map[k]); + build.tokenizer.addToken(k, v); } }]; },