1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 23:10:57 +01:00

fix workflow to work with complicated content

Summary:
we were aggressively checking to make sure the event target was a workflow element. instead, just update the event target to the workflow element if necessary.

could probably just do this unconditionally as well.

Test Plan: D3705 works with this in place!

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3707
This commit is contained in:
Bob Trahan 2012-10-15 15:40:44 -07:00
parent 9c94bf1bea
commit 2ccf1a9e48
2 changed files with 24 additions and 28 deletions

View file

@ -1742,7 +1742,7 @@ celerity_register_resource_map(array(
), ),
'javelin-behavior-workflow' => 'javelin-behavior-workflow' =>
array( array(
'uri' => '/res/ce154288/rsrc/js/application/core/behavior-workflow.js', 'uri' => '/res/fb94a030/rsrc/js/application/core/behavior-workflow.js',
'type' => 'js', 'type' => 'js',
'requires' => 'requires' =>
array( array(
@ -3029,7 +3029,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/315e8536/core.pkg.css', 'uri' => '/res/pkg/315e8536/core.pkg.css',
'type' => 'css', 'type' => 'css',
), ),
'3a455e4f' => '25356ea5' =>
array( array(
'name' => 'core.pkg.js', 'name' => 'core.pkg.js',
'symbols' => 'symbols' =>
@ -3052,7 +3052,7 @@ celerity_register_resource_map(array(
15 => 'javelin-behavior-phabricator-tooltips', 15 => 'javelin-behavior-phabricator-tooltips',
16 => 'phabricator-prefab', 16 => 'phabricator-prefab',
), ),
'uri' => '/res/pkg/3a455e4f/core.pkg.js', 'uri' => '/res/pkg/25356ea5/core.pkg.js',
'type' => 'js', 'type' => 'js',
), ),
'2ba14b3d' => '2ba14b3d' =>
@ -3225,7 +3225,7 @@ celerity_register_resource_map(array(
'javelin-behavior-aphront-basic-tokenizer' => '81c9cd69', 'javelin-behavior-aphront-basic-tokenizer' => '81c9cd69',
'javelin-behavior-aphront-drag-and-drop' => 'a569df32', 'javelin-behavior-aphront-drag-and-drop' => 'a569df32',
'javelin-behavior-aphront-drag-and-drop-textarea' => 'a569df32', 'javelin-behavior-aphront-drag-and-drop-textarea' => 'a569df32',
'javelin-behavior-aphront-form-disable-on-submit' => '3a455e4f', 'javelin-behavior-aphront-form-disable-on-submit' => '25356ea5',
'javelin-behavior-audit-preview' => '5e68be89', 'javelin-behavior-audit-preview' => '5e68be89',
'javelin-behavior-differential-accept-with-errors' => 'a569df32', 'javelin-behavior-differential-accept-with-errors' => 'a569df32',
'javelin-behavior-differential-add-reviewers-and-ccs' => 'a569df32', 'javelin-behavior-differential-add-reviewers-and-ccs' => 'a569df32',
@ -3244,20 +3244,20 @@ celerity_register_resource_map(array(
'javelin-behavior-maniphest-transaction-controls' => '7707de41', 'javelin-behavior-maniphest-transaction-controls' => '7707de41',
'javelin-behavior-maniphest-transaction-expand' => '7707de41', 'javelin-behavior-maniphest-transaction-expand' => '7707de41',
'javelin-behavior-maniphest-transaction-preview' => '7707de41', 'javelin-behavior-maniphest-transaction-preview' => '7707de41',
'javelin-behavior-phabricator-autofocus' => '3a455e4f', 'javelin-behavior-phabricator-autofocus' => '25356ea5',
'javelin-behavior-phabricator-keyboard-shortcuts' => '3a455e4f', 'javelin-behavior-phabricator-keyboard-shortcuts' => '25356ea5',
'javelin-behavior-phabricator-object-selector' => 'a569df32', 'javelin-behavior-phabricator-object-selector' => 'a569df32',
'javelin-behavior-phabricator-oncopy' => '3a455e4f', 'javelin-behavior-phabricator-oncopy' => '25356ea5',
'javelin-behavior-phabricator-tooltips' => '3a455e4f', 'javelin-behavior-phabricator-tooltips' => '25356ea5',
'javelin-behavior-phabricator-watch-anchor' => '3a455e4f', 'javelin-behavior-phabricator-watch-anchor' => '25356ea5',
'javelin-behavior-refresh-csrf' => '3a455e4f', 'javelin-behavior-refresh-csrf' => '25356ea5',
'javelin-behavior-repository-crossreference' => 'a569df32', 'javelin-behavior-repository-crossreference' => 'a569df32',
'javelin-behavior-workflow' => '3a455e4f', 'javelin-behavior-workflow' => '25356ea5',
'javelin-dom' => '6c45a1d8', 'javelin-dom' => '6c45a1d8',
'javelin-event' => '6c45a1d8', 'javelin-event' => '6c45a1d8',
'javelin-install' => '6c45a1d8', 'javelin-install' => '6c45a1d8',
'javelin-json' => '6c45a1d8', 'javelin-json' => '6c45a1d8',
'javelin-mask' => '3a455e4f', 'javelin-mask' => '25356ea5',
'javelin-request' => '6c45a1d8', 'javelin-request' => '6c45a1d8',
'javelin-stratcom' => '6c45a1d8', 'javelin-stratcom' => '6c45a1d8',
'javelin-tokenizer' => '81c9cd69', 'javelin-tokenizer' => '81c9cd69',
@ -3269,7 +3269,7 @@ celerity_register_resource_map(array(
'javelin-uri' => '6c45a1d8', 'javelin-uri' => '6c45a1d8',
'javelin-util' => '6c45a1d8', 'javelin-util' => '6c45a1d8',
'javelin-vector' => '6c45a1d8', 'javelin-vector' => '6c45a1d8',
'javelin-workflow' => '3a455e4f', 'javelin-workflow' => '25356ea5',
'maniphest-task-summary-css' => '7839ae2d', 'maniphest-task-summary-css' => '7839ae2d',
'maniphest-transaction-detail-css' => '7839ae2d', 'maniphest-transaction-detail-css' => '7839ae2d',
'phabricator-app-buttons-css' => '315e8536', 'phabricator-app-buttons-css' => '315e8536',
@ -3278,20 +3278,20 @@ celerity_register_resource_map(array(
'phabricator-core-css' => '315e8536', 'phabricator-core-css' => '315e8536',
'phabricator-directory-css' => '315e8536', 'phabricator-directory-css' => '315e8536',
'phabricator-drag-and-drop-file-upload' => 'a569df32', 'phabricator-drag-and-drop-file-upload' => 'a569df32',
'phabricator-dropdown-menu' => '3a455e4f', 'phabricator-dropdown-menu' => '25356ea5',
'phabricator-flag-css' => '315e8536', 'phabricator-flag-css' => '315e8536',
'phabricator-jump-nav' => '315e8536', 'phabricator-jump-nav' => '315e8536',
'phabricator-keyboard-shortcut' => '3a455e4f', 'phabricator-keyboard-shortcut' => '25356ea5',
'phabricator-keyboard-shortcut-manager' => '3a455e4f', 'phabricator-keyboard-shortcut-manager' => '25356ea5',
'phabricator-menu-item' => '3a455e4f', 'phabricator-menu-item' => '25356ea5',
'phabricator-object-selector-css' => '2ba14b3d', 'phabricator-object-selector-css' => '2ba14b3d',
'phabricator-paste-file-upload' => '3a455e4f', 'phabricator-paste-file-upload' => '25356ea5',
'phabricator-prefab' => '3a455e4f', 'phabricator-prefab' => '25356ea5',
'phabricator-project-tag-css' => '7839ae2d', 'phabricator-project-tag-css' => '7839ae2d',
'phabricator-remarkup-css' => '315e8536', 'phabricator-remarkup-css' => '315e8536',
'phabricator-shaped-request' => 'a569df32', 'phabricator-shaped-request' => 'a569df32',
'phabricator-standard-page-view' => '315e8536', 'phabricator-standard-page-view' => '315e8536',
'phabricator-tooltip' => '3a455e4f', 'phabricator-tooltip' => '25356ea5',
'phabricator-transaction-view-css' => '315e8536', 'phabricator-transaction-view-css' => '315e8536',
'syntax-highlighting-css' => '315e8536', 'syntax-highlighting-css' => '315e8536',
), ),

View file

@ -13,11 +13,9 @@ JX.behavior('workflow', function() {
if (JX.Stratcom.pass()) { if (JX.Stratcom.pass()) {
return; return;
} }
if (e.getNode('workflow') !== e.getTarget()) { var target = e.getNode('workflow');
return;
}
e.prevent(); e.prevent();
JX.Workflow.newFromForm(e.getTarget()).start(); JX.Workflow.newFromForm(target).start();
}); });
JX.Stratcom.listen( JX.Stratcom.listen(
'click', 'click',
@ -26,14 +24,12 @@ JX.behavior('workflow', function() {
if (JX.Stratcom.pass()) { if (JX.Stratcom.pass()) {
return; return;
} }
if (e.getNode('workflow') !== e.getTarget()) { var target = e.getNode('workflow');
return;
}
var raw = e.getRawEvent(); var raw = e.getRawEvent();
if (raw.altKey || raw.ctrlKey || raw.metaKey || raw.shiftKey) { if (raw.altKey || raw.ctrlKey || raw.metaKey || raw.shiftKey) {
return; return;
} }
e.prevent(); e.prevent();
JX.Workflow.newFromLink(e.getTarget()).start(); JX.Workflow.newFromLink(target).start();
}); });
}); });