1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Maniphest + Differential - don't show transaction preview until user interacts with the form.

Summary: Fixes T4846. These are one off (for now) since they have various crazy actions with them. I think this will get unified and more cleaned up when we refine the UI for taking multiple actions at once, etc.

Test Plan: noted no "commented on x" in either maniphest or differential. starting making a comment and noted prevew showed. started adding a subscriber (added to tokenizer) and preview showed.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T4846

Differential Revision: https://secure.phabricator.com/D12936
This commit is contained in:
Bob Trahan 2015-05-20 13:54:22 -07:00
parent bb0004fd41
commit 9de39c12a2
3 changed files with 68 additions and 37 deletions

View file

@ -11,11 +11,11 @@ return array(
'core.pkg.js' => '328799d0', 'core.pkg.js' => '328799d0',
'darkconsole.pkg.js' => 'e7393ebb', 'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => 'bb338e4b', 'differential.pkg.css' => 'bb338e4b',
'differential.pkg.js' => '45b3b51d', 'differential.pkg.js' => '63a77807',
'diffusion.pkg.css' => '591664fa', 'diffusion.pkg.css' => '591664fa',
'diffusion.pkg.js' => '0115b37c', 'diffusion.pkg.js' => '0115b37c',
'maniphest.pkg.css' => '68d4dd3d', 'maniphest.pkg.css' => '68d4dd3d',
'maniphest.pkg.js' => 'df4aa49f', 'maniphest.pkg.js' => '2f4f52c2',
'rsrc/css/aphront/aphront-bars.css' => '231ac33c', 'rsrc/css/aphront/aphront-bars.css' => '231ac33c',
'rsrc/css/aphront/dark-console.css' => '6378ef3d', 'rsrc/css/aphront/dark-console.css' => '6378ef3d',
'rsrc/css/aphront/dialog-view.css' => '9b32db0a', 'rsrc/css/aphront/dialog-view.css' => '9b32db0a',
@ -349,7 +349,7 @@ return array(
'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'd4c87bf4', 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'd4c87bf4',
'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18', 'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18',
'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d', 'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d',
'rsrc/js/application/differential/behavior-comment-preview.js' => '8e1389b5', 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76',
'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1',
'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb', 'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb',
'rsrc/js/application/differential/behavior-edit-inline-comments.js' => 'e723c323', 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => 'e723c323',
@ -379,7 +379,7 @@ return array(
'rsrc/js/application/maniphest/behavior-subpriorityeditor.js' => '84845b5b', 'rsrc/js/application/maniphest/behavior-subpriorityeditor.js' => '84845b5b',
'rsrc/js/application/maniphest/behavior-transaction-controls.js' => '44168bad', 'rsrc/js/application/maniphest/behavior-transaction-controls.js' => '44168bad',
'rsrc/js/application/maniphest/behavior-transaction-expand.js' => '5fefb143', 'rsrc/js/application/maniphest/behavior-transaction-expand.js' => '5fefb143',
'rsrc/js/application/maniphest/behavior-transaction-preview.js' => 'f8248bc5', 'rsrc/js/application/maniphest/behavior-transaction-preview.js' => '4c95d29e',
'rsrc/js/application/owners/OwnersPathEditor.js' => 'aa1733d0', 'rsrc/js/application/owners/OwnersPathEditor.js' => 'aa1733d0',
'rsrc/js/application/owners/owners-path-editor.js' => '7a68dda3', 'rsrc/js/application/owners/owners-path-editor.js' => '7a68dda3',
'rsrc/js/application/passphrase/passphrase-credential-control.js' => '3cb0b2fc', 'rsrc/js/application/passphrase/passphrase-credential-control.js' => '3cb0b2fc',
@ -466,7 +466,7 @@ return array(
'rsrc/js/core/behavior-scrollbar.js' => '834a1173', 'rsrc/js/core/behavior-scrollbar.js' => '834a1173',
'rsrc/js/core/behavior-search-typeahead.js' => '048330fa', 'rsrc/js/core/behavior-search-typeahead.js' => '048330fa',
'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6', 'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6',
'rsrc/js/core/behavior-time-typeahead.js' => '8cf340fd', 'rsrc/js/core/behavior-time-typeahead.js' => '3416cef7',
'rsrc/js/core/behavior-toggle-class.js' => '5d7c9f33', 'rsrc/js/core/behavior-toggle-class.js' => '5d7c9f33',
'rsrc/js/core/behavior-tokenizer.js' => 'b3a4b884', 'rsrc/js/core/behavior-tokenizer.js' => 'b3a4b884',
'rsrc/js/core/behavior-tooltip.js' => '3ee3408b', 'rsrc/js/core/behavior-tooltip.js' => '3ee3408b',
@ -559,7 +559,7 @@ return array(
'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 'javelin-behavior-differential-diff-radios' => 'e1ff79b1',
'javelin-behavior-differential-dropdown-menus' => '2035b9cb', 'javelin-behavior-differential-dropdown-menus' => '2035b9cb',
'javelin-behavior-differential-edit-inline-comments' => 'e723c323', 'javelin-behavior-differential-edit-inline-comments' => 'e723c323',
'javelin-behavior-differential-feedback-preview' => '8e1389b5', 'javelin-behavior-differential-feedback-preview' => 'b064af76',
'javelin-behavior-differential-keyboard-navigation' => '2c426492', 'javelin-behavior-differential-keyboard-navigation' => '2c426492',
'javelin-behavior-differential-populate' => '8694b1df', 'javelin-behavior-differential-populate' => '8694b1df',
'javelin-behavior-differential-show-field-details' => 'bba9eedf', 'javelin-behavior-differential-show-field-details' => 'bba9eedf',
@ -590,7 +590,7 @@ return array(
'javelin-behavior-maniphest-subpriority-editor' => '84845b5b', 'javelin-behavior-maniphest-subpriority-editor' => '84845b5b',
'javelin-behavior-maniphest-transaction-controls' => '44168bad', 'javelin-behavior-maniphest-transaction-controls' => '44168bad',
'javelin-behavior-maniphest-transaction-expand' => '5fefb143', 'javelin-behavior-maniphest-transaction-expand' => '5fefb143',
'javelin-behavior-maniphest-transaction-preview' => 'f8248bc5', 'javelin-behavior-maniphest-transaction-preview' => '4c95d29e',
'javelin-behavior-owners-path-editor' => '7a68dda3', 'javelin-behavior-owners-path-editor' => '7a68dda3',
'javelin-behavior-passphrase-credential-control' => '3cb0b2fc', 'javelin-behavior-passphrase-credential-control' => '3cb0b2fc',
'javelin-behavior-persona-login' => '9414ff18', 'javelin-behavior-persona-login' => '9414ff18',
@ -641,7 +641,7 @@ return array(
'javelin-behavior-slowvote-embed' => '887ad43f', 'javelin-behavior-slowvote-embed' => '887ad43f',
'javelin-behavior-stripe-payment-form' => '3f5d6dbf', 'javelin-behavior-stripe-payment-form' => '3f5d6dbf',
'javelin-behavior-test-payment-form' => 'fc91ab6c', 'javelin-behavior-test-payment-form' => 'fc91ab6c',
'javelin-behavior-time-typeahead' => '8cf340fd', 'javelin-behavior-time-typeahead' => '3416cef7',
'javelin-behavior-toggle-class' => '5d7c9f33', 'javelin-behavior-toggle-class' => '5d7c9f33',
'javelin-behavior-typeahead-browse' => '635de1ec', 'javelin-behavior-typeahead-browse' => '635de1ec',
'javelin-behavior-typeahead-search' => '93d0c9e3', 'javelin-behavior-typeahead-search' => '93d0c9e3',
@ -1041,6 +1041,14 @@ return array(
'331b1611' => array( '331b1611' => array(
'javelin-install', 'javelin-install',
), ),
'3416cef7' => array(
'javelin-behavior',
'javelin-util',
'javelin-dom',
'javelin-stratcom',
'javelin-vector',
'javelin-typeahead-static-source',
),
'3975b470' => array( '3975b470' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@ -1130,6 +1138,14 @@ return array(
'javelin-request', 'javelin-request',
'javelin-util', 'javelin-util',
), ),
'4c95d29e' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-json',
'javelin-stratcom',
'phabricator-shaped-request',
),
'4cebc641' => array( '4cebc641' => array(
'javelin-install', 'javelin-install',
), ),
@ -1484,27 +1500,11 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-behavior', 'javelin-behavior',
), ),
'8cf340fd' => array(
'javelin-behavior',
'javelin-util',
'javelin-dom',
'javelin-stratcom',
'javelin-vector',
'javelin-typeahead-static-source',
),
'8cf6d262' => array( '8cf6d262' => array(
'javelin-install', 'javelin-install',
'javelin-dom', 'javelin-dom',
'javelin-util', 'javelin-util',
), ),
'8e1389b5' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
'javelin-request',
'javelin-util',
'phabricator-shaped-request',
),
'8ef9ab58' => array( '8ef9ab58' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@ -1663,6 +1663,14 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-install', 'javelin-install',
), ),
'b064af76' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
'javelin-request',
'javelin-util',
'phabricator-shaped-request',
),
'b1a59974' => array( 'b1a59974' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-aphlict', 'javelin-aphlict',
@ -1983,14 +1991,6 @@ return array(
'javelin-typeahead-ondemand-source', 'javelin-typeahead-ondemand-source',
'javelin-util', 'javelin-util',
), ),
'f8248bc5' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-json',
'javelin-stratcom',
'phabricator-shaped-request',
),
'f829edb3' => array( 'f829edb3' => array(
'javelin-view', 'javelin-view',
'javelin-install', 'javelin-install',

View file

@ -21,10 +21,25 @@ JX.behavior('differential-feedback-preview', function(config) {
var callback = function(r) { var callback = function(r) {
var preview = JX.$(config.preview); var preview = JX.$(config.preview);
var data = getdata();
var hide = true;
for (var field in data) {
if (field == 'action') {
continue;
}
if (data[field]) {
hide = false;
}
}
if (hide) {
JX.DOM.hide(preview);
} else {
JX.DOM.setContent(preview, JX.$H(r)); JX.DOM.setContent(preview, JX.$H(r));
JX.Stratcom.invoke('differential-preview-update', null, { JX.Stratcom.invoke('differential-preview-update', null, {
container: preview container: preview
}); });
JX.DOM.show(preview);
}
}; };
var getdata = function() { var getdata = function() {

View file

@ -14,7 +14,23 @@ JX.behavior('maniphest-transaction-preview', function(config) {
var action = JX.$(config.action); var action = JX.$(config.action);
var callback = function(r) { var callback = function(r) {
JX.DOM.setContent(JX.$(config.preview), JX.$H(r)); var panel = JX.$(config.preview);
var data = getdata();
var hide = true;
for (var field in data) {
if (field == 'action') {
continue;
}
if (data[field]) {
hide = false;
}
}
if (hide) {
JX.DOM.hide(panel);
} else {
JX.DOM.setContent(panel, JX.$H(r));
JX.DOM.show(panel);
}
}; };
var getdata = function() { var getdata = function() {