1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-27 07:50:57 +01:00

Use Workflow, not Request, for Differential populate/show more requests

Summary: When a JX.Request fails, there's no default error handling. Rather than
write some kind of custom stuff, just use JX.Workflow so we get exception
dialogs. We have plans to enhance these anyway (see T302).
Test Plan: Changed the changeset view controller to throw exceptions. Verified I
got un-mysterious exception dialogs when a changeset failed because of an
exception in either initial rendering or after hitting "see more".
Reviewed By: tomo
Reviewers: jungejason, tuomaspelkonen, aran, tomo
CC: aran, epriestley, tomo
Differential Revision: 679
This commit is contained in:
epriestley 2011-07-16 07:09:19 -07:00
parent 5e00d00cf7
commit d2954dae40
3 changed files with 25 additions and 23 deletions

View file

@ -464,12 +464,12 @@ celerity_register_resource_map(array(
), ),
'javelin-behavior-differential-populate' => 'javelin-behavior-differential-populate' =>
array( array(
'uri' => '/res/025171e1/rsrc/js/application/differential/behavior-populate.js', 'uri' => '/res/6efe5cd2/rsrc/js/application/differential/behavior-populate.js',
'type' => 'js', 'type' => 'js',
'requires' => 'requires' =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',
1 => 'javelin-request', 1 => 'javelin-workflow',
2 => 'javelin-util', 2 => 'javelin-util',
3 => 'javelin-dom', 3 => 'javelin-dom',
), ),
@ -489,13 +489,13 @@ celerity_register_resource_map(array(
), ),
'javelin-behavior-differential-show-more' => 'javelin-behavior-differential-show-more' =>
array( array(
'uri' => '/res/a766c717/rsrc/js/application/differential/behavior-show-more.js', 'uri' => '/res/eaaccd7a/rsrc/js/application/differential/behavior-show-more.js',
'type' => 'js', 'type' => 'js',
'requires' => 'requires' =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',
1 => 'javelin-dom', 1 => 'javelin-dom',
2 => 'javelin-request', 2 => 'javelin-workflow',
3 => 'javelin-util', 3 => 'javelin-util',
4 => 'javelin-stratcom', 4 => 'javelin-stratcom',
), ),
@ -1162,7 +1162,7 @@ celerity_register_resource_map(array(
), ),
'phriction-document-css' => 'phriction-document-css' =>
array( array(
'uri' => '/res/84784c2d/rsrc/css/application/phriction/phriction-document-css.css', 'uri' => '/res/a6d15e09/rsrc/css/application/phriction/phriction-document-css.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -1283,7 +1283,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/d0713563/workflow.pkg.js', 'uri' => '/res/pkg/d0713563/workflow.pkg.js',
'type' => 'js', 'type' => 'js',
), ),
'da416e1c' => 'dba261c2' =>
array ( array (
'name' => 'differential.pkg.js', 'name' => 'differential.pkg.js',
'symbols' => 'symbols' =>
@ -1294,7 +1294,7 @@ celerity_register_resource_map(array(
3 => 'javelin-behavior-differential-show-more', 3 => 'javelin-behavior-differential-show-more',
4 => 'javelin-behavior-differential-diff-radios', 4 => 'javelin-behavior-differential-diff-radios',
), ),
'uri' => '/res/pkg/da416e1c/differential.pkg.js', 'uri' => '/res/pkg/dba261c2/differential.pkg.js',
'type' => 'js', 'type' => 'js',
), ),
), ),
@ -1321,11 +1321,11 @@ celerity_register_resource_map(array(
'javelin-behavior' => '307df223', 'javelin-behavior' => '307df223',
'javelin-behavior-aphront-basic-tokenizer' => '25f94e94', 'javelin-behavior-aphront-basic-tokenizer' => '25f94e94',
'javelin-behavior-aphront-form-disable-on-submit' => 'd0713563', 'javelin-behavior-aphront-form-disable-on-submit' => 'd0713563',
'javelin-behavior-differential-diff-radios' => 'da416e1c', 'javelin-behavior-differential-diff-radios' => 'dba261c2',
'javelin-behavior-differential-edit-inline-comments' => 'da416e1c', 'javelin-behavior-differential-edit-inline-comments' => 'dba261c2',
'javelin-behavior-differential-feedback-preview' => 'da416e1c', 'javelin-behavior-differential-feedback-preview' => 'dba261c2',
'javelin-behavior-differential-populate' => 'da416e1c', 'javelin-behavior-differential-populate' => 'dba261c2',
'javelin-behavior-differential-show-more' => 'da416e1c', 'javelin-behavior-differential-show-more' => 'dba261c2',
'javelin-behavior-phabricator-keyboard-shortcuts' => 'd0713563', 'javelin-behavior-phabricator-keyboard-shortcuts' => 'd0713563',
'javelin-behavior-workflow' => 'd0713563', 'javelin-behavior-workflow' => 'd0713563',
'javelin-dom' => '307df223', 'javelin-dom' => '307df223',

View file

@ -1,7 +1,7 @@
/** /**
* @provides javelin-behavior-differential-populate * @provides javelin-behavior-differential-populate
* @requires javelin-behavior * @requires javelin-behavior
* javelin-request * javelin-workflow
* javelin-util * javelin-util
* javelin-dom * javelin-dom
*/ */
@ -13,12 +13,14 @@ JX.behavior('differential-populate', function(config) {
} }
for (var k in config.registry) { for (var k in config.registry) {
new JX.Request(config.uri, JX.bind(null, onresponse, k)) var data = {
.setData({ ref : config.registry[k],
ref : config.registry[k], whitespace: config.whitespace
whitespace: config.whitespace };
})
.send(); new JX.Workflow(config.uri, data)
.setHandler(JX.bind(null, onresponse, k))
.start();
} }
}); });

View file

@ -2,7 +2,7 @@
* @provides javelin-behavior-differential-show-more * @provides javelin-behavior-differential-show-more
* @requires javelin-behavior * @requires javelin-behavior
* javelin-dom * javelin-dom
* javelin-request * javelin-workflow
* javelin-util * javelin-util
* javelin-stratcom * javelin-stratcom
*/ */
@ -27,9 +27,9 @@ JX.behavior('differential-show-more', function(config) {
JX.DOM.alterClass(context, 'differential-show-more-loading', true); JX.DOM.alterClass(context, 'differential-show-more-loading', true);
var data = e.getNodeData('show-more'); var data = e.getNodeData('show-more');
data['whitespace'] = config.whitespace; data['whitespace'] = config.whitespace;
new JX.Request(config.uri, JX.bind(null, onresponse, e)) new JX.Workflow(config.uri, data)
.setData(data) .setHandler(JX.bind(null, onresponse, e))
.send(); .start();
e.kill(); e.kill();
}); });