1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

When workflow dialog buttons are clicked, disable the button

Summary:
Depends on D19245. Fixes T11145. Ref T13108. See PHI488. Disable workflow buttons when they're clicked to prevent accidental client-side double submission.

This might have some weird side effects but we should normally never need to re-use a workflow dialog form so it's not immediately obvious that this can break anything.

Test Plan:
  - Added `sleep(1)` to the Mute controller and the Maniphest task controller.
  - Added `phlog(...)` to the Mute controller.
  - Opened the mute dialog, mashed the button a thousand times.
    - Before: Saw a bunch of logs.
    - After: Button immediately disables, saw only one log.

Maniphest Tasks: T13108, T11145

Differential Revision: https://secure.phabricator.com/D19246
This commit is contained in:
epriestley 2018-03-21 11:51:12 -07:00
parent 9e278a89ba
commit c8583b016d
2 changed files with 18 additions and 14 deletions

View file

@ -10,7 +10,7 @@ return array(
'conpherence.pkg.css' => 'e68cf1fa', 'conpherence.pkg.css' => 'e68cf1fa',
'conpherence.pkg.js' => '15191c65', 'conpherence.pkg.js' => '15191c65',
'core.pkg.css' => '6da3c0e5', 'core.pkg.css' => '6da3c0e5',
'core.pkg.js' => 'b305dbe2', 'core.pkg.js' => '27f3489f',
'differential.pkg.css' => '113e692c', 'differential.pkg.css' => '113e692c',
'differential.pkg.js' => 'f6d809c0', 'differential.pkg.js' => 'f6d809c0',
'diffusion.pkg.css' => 'a2d17c7d', 'diffusion.pkg.css' => 'a2d17c7d',
@ -253,7 +253,7 @@ return array(
'rsrc/externals/javelin/lib/URI.js' => 'c989ade3', 'rsrc/externals/javelin/lib/URI.js' => 'c989ade3',
'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8', 'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8',
'rsrc/externals/javelin/lib/WebSocket.js' => '3ffe32d6', 'rsrc/externals/javelin/lib/WebSocket.js' => '3ffe32d6',
'rsrc/externals/javelin/lib/Workflow.js' => '33fea02f', 'rsrc/externals/javelin/lib/Workflow.js' => '7dd6653c',
'rsrc/externals/javelin/lib/__tests__/Cookie.js' => '5ed109e8', 'rsrc/externals/javelin/lib/__tests__/Cookie.js' => '5ed109e8',
'rsrc/externals/javelin/lib/__tests__/DOM.js' => 'c984504b', 'rsrc/externals/javelin/lib/__tests__/DOM.js' => 'c984504b',
'rsrc/externals/javelin/lib/__tests__/JSON.js' => '837a7d68', 'rsrc/externals/javelin/lib/__tests__/JSON.js' => '837a7d68',
@ -739,7 +739,7 @@ return array(
'javelin-workboard-card' => 'c587b80f', 'javelin-workboard-card' => 'c587b80f',
'javelin-workboard-column' => '758b4758', 'javelin-workboard-column' => '758b4758',
'javelin-workboard-controller' => '26167537', 'javelin-workboard-controller' => '26167537',
'javelin-workflow' => '33fea02f', 'javelin-workflow' => '7dd6653c',
'maniphest-report-css' => '9b9580b7', 'maniphest-report-css' => '9b9580b7',
'maniphest-task-edit-css' => 'fda62a9b', 'maniphest-task-edit-css' => 'fda62a9b',
'maniphest-task-summary-css' => '11cc5344', 'maniphest-task-summary-css' => '11cc5344',
@ -1097,17 +1097,6 @@ return array(
'javelin-util', 'javelin-util',
'javelin-magical-init', 'javelin-magical-init',
), ),
'33fea02f' => array(
'javelin-stratcom',
'javelin-request',
'javelin-dom',
'javelin-vector',
'javelin-install',
'javelin-util',
'javelin-mask',
'javelin-uri',
'javelin-routable',
),
'358b8c04' => array( '358b8c04' => array(
'javelin-install', 'javelin-install',
'javelin-util', 'javelin-util',
@ -1538,6 +1527,17 @@ return array(
'javelin-request', 'javelin-request',
'javelin-router', 'javelin-router',
), ),
'7dd6653c' => array(
'javelin-stratcom',
'javelin-request',
'javelin-dom',
'javelin-vector',
'javelin-install',
'javelin-util',
'javelin-mask',
'javelin-uri',
'javelin-routable',
),
'7e41274a' => array( '7e41274a' => array(
'javelin-install', 'javelin-install',
), ),

View file

@ -151,6 +151,10 @@ JX.install('Workflow', {
// NOTE: Don't remove the current dialog yet because additional // NOTE: Don't remove the current dialog yet because additional
// handlers may still want to access the nodes. // handlers may still want to access the nodes.
// Disable whatever button the user clicked to prevent duplicate
// submission mistakes when you accidentally . See T11145.
button.disabled = true;
active active
.setURI(form.getAttribute('action') || active.getURI()) .setURI(form.getAttribute('action') || active.getURI())
.setDataWithListOfPairs(data) .setDataWithListOfPairs(data)