diff --git a/resources/celerity/map.php b/resources/celerity/map.php index dfc8e986a9..5c303ae781 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => 'ca3f6a60', - 'core.pkg.js' => 'dcd6c8e3', + 'core.pkg.js' => '919c56b5', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => 'bb338e4b', 'differential.pkg.js' => '895b8d62', @@ -341,12 +341,12 @@ return array( 'rsrc/image/texture/table_header_hover.png' => '038ec3b9', 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 'rsrc/js/application/aphlict/Aphlict.js' => '5359e785', - 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '0323afdd', + 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '995ad707', 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'b1a59974', 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761', 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', - 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '7a608e21', + 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '9e507b59', 'rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js' => 'cf86d16a', 'rsrc/js/application/conpherence/behavior-durable-column.js' => '657c2b50', 'rsrc/js/application/conpherence/behavior-menu.js' => '804b0773', @@ -513,7 +513,7 @@ return array( 'conpherence-menu-css' => 'f389e048', 'conpherence-message-pane-css' => '3150e2a2', 'conpherence-notification-css' => 'd208f806', - 'conpherence-thread-manager' => '7a608e21', + 'conpherence-thread-manager' => '9e507b59', 'conpherence-transaction-css' => '25138b7f', 'conpherence-update-css' => '1099a660', 'conpherence-widget-pane-css' => '2af42ebe', @@ -541,7 +541,7 @@ return array( 'inline-comment-summary-css' => 'eb5f8e8c', 'javelin-aphlict' => '5359e785', 'javelin-behavior' => '61cbc29a', - 'javelin-behavior-aphlict-dropdown' => '0323afdd', + 'javelin-behavior-aphlict-dropdown' => '995ad707', 'javelin-behavior-aphlict-listen' => 'b1a59974', 'javelin-behavior-aphlict-status' => 'ea681761', 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', @@ -836,16 +836,6 @@ return array( '029a133d' => array( 'aphront-dialog-view-css', ), - '0323afdd' => array( - 'javelin-behavior', - 'javelin-request', - 'javelin-stratcom', - 'javelin-vector', - 'javelin-dom', - 'javelin-uri', - 'javelin-behavior-device', - 'phabricator-title', - ), '048330fa' => array( 'javelin-behavior', 'javelin-typeahead-ondemand-source', @@ -1387,17 +1377,6 @@ return array( 'javelin-behavior', 'javelin-quicksand', ), - '7a608e21' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-aphlict', - 'javelin-workflow', - 'javelin-router', - 'javelin-behavior-device', - 'javelin-vector', - ), '7a68dda3' => array( 'owners-path-editor', 'javelin-behavior', @@ -1589,6 +1568,16 @@ return array( 'javelin-dom', 'javelin-reactor-dom', ), + '995ad707' => array( + 'javelin-behavior', + 'javelin-request', + 'javelin-stratcom', + 'javelin-vector', + 'javelin-dom', + 'javelin-uri', + 'javelin-behavior-device', + 'phabricator-title', + ), '9a340b3d' => array( 'javelin-behavior', 'javelin-dom', @@ -1598,6 +1587,17 @@ return array( 'phuix-action-view', 'javelin-workflow', ), + '9e507b59' => array( + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-install', + 'javelin-aphlict', + 'javelin-workflow', + 'javelin-router', + 'javelin-behavior-device', + 'javelin-vector', + ), '9f36c42d' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/src/applications/conpherence/controller/ConpherenceColumnViewController.php b/src/applications/conpherence/controller/ConpherenceColumnViewController.php index 0155784015..9a146b4b23 100644 --- a/src/applications/conpherence/controller/ConpherenceColumnViewController.php +++ b/src/applications/conpherence/controller/ConpherenceColumnViewController.php @@ -88,12 +88,19 @@ final class ConpherenceColumnViewController extends PhabricatorPolicyCapability::CAN_EDIT); } + $dropdown_query = id(new AphlictDropdownDataQuery()) + ->setViewer($user); + $dropdown_query->execute(); $response = array( 'content' => hsprintf('%s', $durable_column), 'threadID' => $conpherence_id, 'threadPHID' => $conpherence_phid, 'latestTransactionID' => $latest_transaction_id, 'canEdit' => $can_edit, + 'aphlictDropdownData' => array( + $dropdown_query->getNotificationData(), + $dropdown_query->getConpherenceData(), + ), ); return id(new AphrontAjaxResponse())->setContent($response); diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php index 7b5bc9a8b6..3e86accf7c 100644 --- a/src/applications/conpherence/controller/ConpherenceUpdateController.php +++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php @@ -543,8 +543,10 @@ final class ConpherenceUpdateController break; } } - $data = $conpherence->getDisplayData($user); + $dropdown_query = id(new AphlictDropdownDataQuery()) + ->setViewer($user); + $dropdown_query->execute(); $content = array( 'non_update' => $non_update, 'transactions' => hsprintf('%s', $rendered_transactions), @@ -555,6 +557,10 @@ final class ConpherenceUpdateController 'header' => $header, 'file_widget' => $file_widget, 'people_widget' => $people_widget, + 'aphlictDropdownData' => array( + $dropdown_query->getNotificationData(), + $dropdown_query->getConpherenceData(), + ), ); return $content; diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php index 7a3027dc53..e0a39030c3 100644 --- a/src/applications/conpherence/controller/ConpherenceViewController.php +++ b/src/applications/conpherence/controller/ConpherenceViewController.php @@ -94,6 +94,9 @@ final class ConpherenceViewController extends $content['title'] = $title = $d_data['title']; if ($request->isAjax()) { + $dropdown_query = id(new AphlictDropdownDataQuery()) + ->setViewer($user); + $dropdown_query->execute(); $content['threadID'] = $conpherence->getID(); $content['threadPHID'] = $conpherence->getPHID(); $content['latestTransactionID'] = $data['latest_transaction_id']; @@ -101,6 +104,10 @@ final class ConpherenceViewController extends $user, $conpherence, PhabricatorPolicyCapability::CAN_EDIT); + $content['aphlictDropdownData'] = array( + $dropdown_query->getNotificationData(), + $dropdown_query->getConpherenceData(), + ); return id(new AphrontAjaxResponse())->setContent($content); } diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js index b1446593f3..110ab8a175 100644 --- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js +++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js @@ -93,23 +93,34 @@ JX.behavior('aphlict-dropdown', function(config, statics) { if (!data.fromServer) { return; } - var updated = false; var new_data = data.newResponse.aphlictDropdownData; - for (var ii = 0; ii < new_data.length; ii++) { - if (new_data[ii].countType != config.countType) { - continue; - } - if (!new_data[ii].isInstalled) { - continue; - } - updated = true; - _updateCount(parseInt(new_data[ii].count)); - } - if (updated) { - dirty = true; - } + update_counts(new_data); }); + JX.Stratcom.listen( + 'conpherence-redraw-aphlict', + null, + function (e) { + update_counts(e.getData()); + }); + + function update_counts(new_data) { + var updated = false; + for (var ii = 0; ii < new_data.length; ii++) { + if (new_data[ii].countType != config.countType) { + continue; + } + if (!new_data[ii].isInstalled) { + continue; + } + updated = true; + _updateCount(parseInt(new_data[ii].count)); + } + if (updated) { + dirty = true; + } + } + function set_visible(menu, icon) { if (menu) { statics.visible = {menu: menu, icon: icon}; diff --git a/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js b/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js index 0e97321605..37dad6f2ba 100644 --- a/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js +++ b/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js @@ -205,7 +205,10 @@ JX.install('ConpherenceThreadManager', { _markUpdated: function(r) { this._updating.knownID = r.latest_transaction_id; this._latestTransactionID = r.latest_transaction_id; - JX.Stratcom.invoke('notification-panel-update', null, {}); + JX.Stratcom.invoke( + 'conpherence-redraw-aphlict', + null, + r.aphlictDropdownData); }, _updateThread: function() { @@ -298,7 +301,10 @@ JX.install('ConpherenceThreadManager', { this._latestTransactionID = r.latestTransactionID; this._canEditLoadedThread = r.canEdit; - JX.Stratcom.invoke('notification-panel-update', null, {}); + JX.Stratcom.invoke( + 'conpherence-redraw-aphlict', + null, + r.aphlictDropdownData); this._didLoadThreadCallback(r);