@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.

"Please Refresh" Notifications

Summary:
Based off D2704. Adds humane.js and a bit of plumbing. Currently does
not seem to load notification.css (which causes notifications not to display)
for reasons entirely opaque to me.

Test Plan:
tried locally. currently works except for the actual display due to
css loading difficulties

Reviewers: epriestley

Reviewed By: epriestley

CC: allenjohnashton, keebuhm, aran, Korvin

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

authored by

David Fisher and committed by
epriestley
e5195815 d5e61f52

+33 -2
+3 -2
src/__celerity_resource_map__.php
··· 772 772 ), 773 773 'javelin-behavior-aphlict-listen' => 774 774 array( 775 - 'uri' => '/res/0ba6b119/rsrc/js/application/aphlict/behavior-aphlict-listen.js', 775 + 'uri' => '/res/4b1dc678/rsrc/js/application/aphlict/behavior-aphlict-listen.js', 776 776 'type' => 'js', 777 777 'requires' => 778 778 array( ··· 781 781 2 => 'javelin-util', 782 782 3 => 'javelin-stratcom', 783 783 4 => 'javelin-behavior-aphlict-dropdown', 784 + 5 => 'phabricator-notification', 784 785 ), 785 786 'disk' => '/rsrc/js/application/aphlict/behavior-aphlict-listen.js', 786 787 ), ··· 2160 2161 ), 2161 2162 'phabricator-notification' => 2162 2163 array( 2163 - 'uri' => '/res/8497d4b2/rsrc/js/application/core/Notification.js', 2164 + 'uri' => '/res/253b3262/rsrc/js/application/core/Notification.js', 2164 2165 'type' => 'js', 2165 2166 'requires' => 2166 2167 array(
+1
src/applications/maniphest/controller/ManiphestController.php
··· 30 30 $page->setBaseURI('/maniphest/'); 31 31 $page->setTitle(idx($data, 'title')); 32 32 $page->setGlyph("\xE2\x9A\x93"); 33 + $page->appendPageObjects(idx($data, 'pageObjects', array())); 33 34 $page->appendChild($view); 34 35 $page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_OPEN_TASKS); 35 36
+1
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 523 523 ), 524 524 array( 525 525 'title' => 'T'.$task->getID().' '.$task->getTitle(), 526 + 'pageObjects' => array($task->getPHID()), 526 527 )); 527 528 } 528 529
+7
src/applications/maniphest/controller/ManiphestTaskEditController.php
··· 556 556 'uri' => '/maniphest/task/descriptionpreview/', 557 557 )); 558 558 559 + if ($task->getID()) { 560 + $page_objects = array( $task->getPHID() ); 561 + } else { 562 + $page_objects = array(); 563 + } 564 + 559 565 return $this->buildStandardPageResponse( 560 566 array( 561 567 $error_view, ··· 564 570 ), 565 571 array( 566 572 'title' => $header_name, 573 + 'pageObjects' => $page_objects, 567 574 )); 568 575 } 569 576 }
+11
src/view/page/PhabricatorStandardPageView.php
··· 30 30 private $isFrameable = false; 31 31 private $disableConsole; 32 32 private $searchDefaultScope; 33 + private $pageObjects = array(); 33 34 34 35 public function setIsAdminInterface($is_admin_interface) { 35 36 $this->isAdminInterface = $is_admin_interface; ··· 113 114 return $this->searchDefaultScope; 114 115 } 115 116 117 + public function appendPageObjects(array $objs) { 118 + foreach ($objs as $obj) { 119 + $this->pageObjects[] = $obj; 120 + } 121 + } 122 + 116 123 public function getTitle() { 117 124 $use_glyph = true; 118 125 $request = $this->getRequest(); ··· 142 149 require_celerity_resource('phabricator-core-css'); 143 150 require_celerity_resource('phabricator-core-buttons-css'); 144 151 require_celerity_resource('phabricator-standard-page-view'); 152 + if (PhabricatorEnv::getEnvConfig('notification.enabled')) { 153 + require_celerity_resource('phabricator-notification-css'); 154 + } 145 155 146 156 $current_token = null; 147 157 $request = $this->getRequest(); ··· 388 398 'id' => $aphlict_object_id, 389 399 'server' => $server_domain, 390 400 'port' => 2600, 401 + 'pageObjects' => $this->pageObjects, 391 402 )); 392 403 393 404 Javelin::initBehavior('aphlict-dropdown', array());
+10
webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js
··· 5 5 * javelin-util 6 6 * javelin-stratcom 7 7 * javelin-behavior-aphlict-dropdown 8 + * phabricator-notification 8 9 */ 9 10 10 11 JX.behavior('aphlict-listen', function(config) { 11 12 function onready() { 13 + 12 14 var client = new JX.Aphlict(config.id, config.server, config.port) 13 15 .setHandler(function(type, message) { 14 16 if (message) { ··· 16 18 var request = new JX.Request('/notification/individual/', 17 19 function(response) { 18 20 if (response.pertinent) { 21 + if (config.pageObjects.indexOf(response.primaryObjectPHID) 22 + > -1) { 23 + var notification = new JX.Notification() 24 + .setContent('Page updated. Please refresh.') 25 + .setDuration(0) // never timeout 26 + .show(); 27 + } 28 + 19 29 JX.Stratcom.invoke('notification-panel-update', null, {}); 20 30 } 21 31 });