diff --git a/resources/celerity/map.php b/resources/celerity/map.php index febcddca82..90ef62ed1b 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -412,7 +412,7 @@ return array( 'rsrc/js/application/phortune/phortune-credit-card-form.js' => 'd12d214f', 'rsrc/js/application/policy/behavior-policy-control.js' => '0eaa33a9', 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '9347f172', - 'rsrc/js/application/projects/WorkboardBoard.js' => '19df903f', + 'rsrc/js/application/projects/WorkboardBoard.js' => '75727403', 'rsrc/js/application/projects/WorkboardCard.js' => '0392a5d8', 'rsrc/js/application/projects/WorkboardCardTemplate.js' => '84f82dad', 'rsrc/js/application/projects/WorkboardColumn.js' => 'c3d24e63', @@ -743,7 +743,7 @@ return array( 'javelin-view-renderer' => '9aae2b66', 'javelin-view-visitor' => '308f9fe4', 'javelin-websocket' => 'fdc13e4e', - 'javelin-workboard-board' => '19df903f', + 'javelin-workboard-board' => '75727403', 'javelin-workboard-card' => '0392a5d8', 'javelin-workboard-card-template' => '84f82dad', 'javelin-workboard-column' => 'c3d24e63', @@ -1030,18 +1030,6 @@ return array( '17b71bbc' => array( 'phui-theme-css', ), - '19df903f' => array( - 'javelin-install', - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-workflow', - 'phabricator-draggable-list', - 'javelin-workboard-column', - 'javelin-workboard-header-template', - 'javelin-workboard-card-template', - 'javelin-workboard-order-template', - ), '1b6acc2a' => array( 'javelin-magical-init', 'javelin-util', @@ -1561,6 +1549,18 @@ return array( 'javelin-uri', 'javelin-request', ), + 75727403 => array( + 'javelin-install', + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-workflow', + 'phabricator-draggable-list', + 'javelin-workboard-column', + 'javelin-workboard-header-template', + 'javelin-workboard-card-template', + 'javelin-workboard-order-template', + ), '78bc5d94' => array( 'javelin-behavior', 'javelin-uri', diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php index 6255903eff..235c73280b 100644 --- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php +++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php @@ -859,4 +859,33 @@ final class ManiphestTransactionEditor return array_values($phid_list); } + + protected function didApplyTransactions($object, array $xactions) { + // TODO: This should include projects which the object was previously + // associated with but no longer is (so it can be removed from those + // boards) but currently does not. + + $edge_query = id(new PhabricatorEdgeQuery()) + ->withSourcePHIDs(array($object->getPHID())) + ->withEdgeTypes( + array( + PhabricatorProjectObjectHasProjectEdgeType::EDGECONST, + )); + + $edge_query->execute(); + + $project_phids = $edge_query->getDestinationPHIDs(); + + if ($project_phids) { + $data = array( + 'type' => 'workboards', + 'subscribers' => $project_phids, + ); + + PhabricatorNotificationClient::tryToPostMessage($data); + } + + return $xactions; + } + } diff --git a/webroot/rsrc/js/application/projects/WorkboardBoard.js b/webroot/rsrc/js/application/projects/WorkboardBoard.js index c78fcd4eaf..2f904b9f68 100644 --- a/webroot/rsrc/js/application/projects/WorkboardBoard.js +++ b/webroot/rsrc/js/application/projects/WorkboardBoard.js @@ -136,6 +136,36 @@ JX.install('WorkboardBoard', { .setHandler(on_reload) .register(); + var board_phid = this.getPHID(); + + JX.Stratcom.listen('aphlict-server-message', null, function(e) { + var message = e.getData(); + + if (message.type != 'workboards') { + return; + } + + // Check if this update notification is about the currently visible + // board. If it is, update the board state. + + var found_board = false; + for (var ii = 0; ii < message.subscribers.length; ii++) { + var subscriber_phid = message.subscribers[ii]; + if (subscriber_phid === board_phid) { + found_board = true; + break; + } + } + + if (found_board) { + on_reload(); + } + }); + + JX.Stratcom.listen('aphlict-reconnect', null, function(e) { + on_reload(); + }); + for (var k in this._columns) { this._columns[k].redraw(); }