@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Pass all adjacent card PHIDs from the client to the server when moving a card

Summary:
Depends on D20321. Fixes T12175. Ref T13074. Now that before/after PHIDs are suggestions, we can give the server a more complete view of what the client is trying to do so we're more likely to get a good outcome if the client view is out of date.

Instead of passing only the one directly adjacent card PHID, pass all the card PHIDs that the client thinks are in the same group.

(For gigantic columns with tens of thousands of tasks this might need some tweaking -- like, slice both lists down to 10 items -- but we can cross that bridge when we come to it.)

Test Plan:
- Dragged some cards around to top/bottom/middle positions, saw good positioning in all cases.
- In two windows, dragged stuff around on the same board. At least at first glance, conflicting simultaneous edits seemed to do reasonable things.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13074, T12175

Differential Revision: https://secure.phabricator.com/D20322

+40 -60
+14 -14
resources/celerity/map.php
··· 409 409 'rsrc/js/application/phortune/phortune-credit-card-form.js' => 'd12d214f', 410 410 'rsrc/js/application/policy/behavior-policy-control.js' => '0eaa33a9', 411 411 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '9347f172', 412 - 'rsrc/js/application/projects/WorkboardBoard.js' => '106d870f', 412 + 'rsrc/js/application/projects/WorkboardBoard.js' => 'c02a5497', 413 413 'rsrc/js/application/projects/WorkboardCard.js' => '0392a5d8', 414 414 'rsrc/js/application/projects/WorkboardCardTemplate.js' => '2a61f8d4', 415 415 'rsrc/js/application/projects/WorkboardColumn.js' => 'c3d24e63', ··· 737 737 'javelin-view-renderer' => '9aae2b66', 738 738 'javelin-view-visitor' => '308f9fe4', 739 739 'javelin-websocket' => 'fdc13e4e', 740 - 'javelin-workboard-board' => '106d870f', 740 + 'javelin-workboard-board' => 'c02a5497', 741 741 'javelin-workboard-card' => '0392a5d8', 742 742 'javelin-workboard-card-template' => '2a61f8d4', 743 743 'javelin-workboard-column' => 'c3d24e63', ··· 1014 1014 'phuix-action-view', 1015 1015 'javelin-workflow', 1016 1016 'phuix-icon-view', 1017 - ), 1018 - '106d870f' => array( 1019 - 'javelin-install', 1020 - 'javelin-dom', 1021 - 'javelin-util', 1022 - 'javelin-stratcom', 1023 - 'javelin-workflow', 1024 - 'phabricator-draggable-list', 1025 - 'javelin-workboard-column', 1026 - 'javelin-workboard-header-template', 1027 - 'javelin-workboard-card-template', 1028 - 'javelin-workboard-order-template', 1029 1017 ), 1030 1018 '111bfd2d' => array( 1031 1019 'javelin-install', ··· 1939 1927 ), 1940 1928 'bde53589' => array( 1941 1929 'phui-inline-comment-view-css', 1930 + ), 1931 + 'c02a5497' => array( 1932 + 'javelin-install', 1933 + 'javelin-dom', 1934 + 'javelin-util', 1935 + 'javelin-stratcom', 1936 + 'javelin-workflow', 1937 + 'phabricator-draggable-list', 1938 + 'javelin-workboard-column', 1939 + 'javelin-workboard-header-template', 1940 + 'javelin-workboard-card-template', 1941 + 'javelin-workboard-order-template', 1942 1942 ), 1943 1943 'c03f2fb4' => array( 1944 1944 'javelin-install',
+6 -19
src/applications/project/controller/PhabricatorProjectMoveController.php
··· 12 12 $column_phid = $request->getStr('columnPHID'); 13 13 $object_phid = $request->getStr('objectPHID'); 14 14 15 - $after_phid = $request->getStr('afterPHID'); 16 - $before_phid = $request->getStr('beforePHID'); 17 - 18 - $after_phids = array(); 19 - if ($after_phid) { 20 - $after_phids[] = $after_phid; 21 - } 22 - 23 - $before_phids = array(); 24 - if ($before_phid) { 25 - $before_phids[] = $before_phid; 26 - } 15 + $after_phids = $request->getStrList('afterPHIDs'); 16 + $before_phids = $request->getStrList('beforePHIDs'); 27 17 28 18 $order = $request->getStr('order'); 29 19 if (!strlen($order)) { ··· 98 88 ->setObjectPHIDs(array($object_phid)) 99 89 ->executeLayout(); 100 90 101 - $order_params = array(); 102 - if ($after_phid) { 103 - $order_params['afterPHIDs'] = $after_phids; 104 - } 105 - if ($before_phid) { 106 - $order_params['beforePHIDs'] = $before_phids; 107 - } 91 + $order_params = array( 92 + 'afterPHIDs' => $after_phids, 93 + 'beforePHIDs' => $before_phids, 94 + ); 108 95 109 96 $xactions = array(); 110 97 $xactions[] = id(new ManiphestTransaction())
+20 -27
webroot/rsrc/js/application/projects/WorkboardBoard.js
··· 409 409 410 410 _getDropContext: function(after_node, item) { 411 411 var header_key; 412 - var before_phid; 413 - var after_phid; 412 + var after_phids = []; 413 + var before_phids = []; 414 414 415 415 // We're going to send an "afterPHID" and a "beforePHID" if the card 416 416 // was dropped immediately adjacent to another card. If a card was ··· 424 424 var after_card = after_node; 425 425 while (after_card) { 426 426 after_data = JX.Stratcom.getData(after_card); 427 - if (after_data.objectPHID) { 428 - break; 429 - } 427 + 430 428 if (after_data.headerKey) { 431 429 break; 432 430 } 433 - after_card = after_card.previousSibling; 434 - } 435 431 436 - if (after_data) { 437 432 if (after_data.objectPHID) { 438 - after_phid = after_data.objectPHID; 433 + after_phids.push(after_data.objectPHID); 439 434 } 435 + 436 + after_card = after_card.previousSibling; 440 437 } 441 438 442 439 if (item) { ··· 444 441 var before_card = item.nextSibling; 445 442 while (before_card) { 446 443 before_data = JX.Stratcom.getData(before_card); 447 - if (before_data.objectPHID) { 448 - break; 449 - } 444 + 450 445 if (before_data.headerKey) { 451 446 break; 452 447 } 453 - before_card = before_card.nextSibling; 454 - } 455 448 456 - if (before_data) { 457 449 if (before_data.objectPHID) { 458 - before_phid = before_data.objectPHID; 450 + before_phids.push(before_data.objectPHID); 459 451 } 452 + 453 + before_card = before_card.nextSibling; 460 454 } 461 455 } 462 456 ··· 476 470 477 471 return { 478 472 headerKey: header_key, 479 - afterPHID: after_phid, 480 - beforePHID: before_phid 473 + afterPHIDs: after_phids, 474 + beforePHIDs: before_phids 481 475 }; 482 476 }, 483 477 ··· 496 490 }; 497 491 498 492 var context = this._getDropContext(after_node, item); 499 - 500 - if (context.afterPHID) { 501 - data.afterPHID = context.afterPHID; 502 - } 503 - 504 - if (context.beforePHID) { 505 - data.beforePHID = context.beforePHID; 506 - } 493 + data.afterPHIDs = context.afterPHIDs.join(','); 494 + data.beforePHIDs = context.beforePHIDs.join(','); 507 495 508 496 if (context.headerKey) { 509 497 var properties = this.getHeaderTemplate(context.headerKey) ··· 530 518 src_phid, 531 519 dst_phid); 532 520 521 + var after_phid = null; 522 + if (data.afterPHIDs.length) { 523 + after_phid = data.afterPHIDs[0]; 524 + } 525 + 533 526 var onupdate = JX.bind( 534 527 this, 535 528 this._oncardupdate, 536 529 list, 537 530 src_phid, 538 531 dst_phid, 539 - data.afterPHID); 532 + after_phid); 540 533 541 534 new JX.Workflow(this.getController().getMoveURI(), data) 542 535 .setHandler(onupdate)