1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Fix some small notification / token issues

Summary:
Fixes T3218.

  - Currently, Paste pages don't clear notifications about the paste (notably, token notifications).
  - Currently, Paste pages don't show tooltips on tokens.
  - `buildApplicationPage()` stopped respecting `pageObjects` (which controls whether "this page has been updated" is shown). Restore that.
  - Make `pageObjects` imply "clear notifications on this stuff".

Test Plan: Viewed a tokened Paste. Verified it cleared the notification and hovering over a token showed a tip.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3218

Differential Revision: https://secure.phabricator.com/D5971
This commit is contained in:
epriestley 2013-05-19 07:51:31 -07:00
parent 94e7878a57
commit 2214f96d3f
6 changed files with 16 additions and 11 deletions

View file

@ -166,10 +166,21 @@ abstract class PhabricatorController extends AphrontController {
$view = $nav; $view = $nav;
} }
$view->setUser($this->getRequest()->getUser()); $user = $this->getRequest()->getUser();
$view->setUser($user);
$page->appendChild($view); $page->appendChild($view);
$object_phids = idx($options, 'pageObjects', array());
if ($object_phids) {
$page->appendPageObjects($object_phids);
foreach ($object_phids as $object_phid) {
PhabricatorFeedStoryNotification::updateObjectNotificationViews(
$user,
$object_phid);
}
}
if (idx($options, 'device')) { if (idx($options, 'device')) {
$page->setDeviceReady(true); $page->setDeviceReady(true);
} }

View file

@ -398,9 +398,6 @@ final class DifferentialRevisionViewController extends DifferentialController {
$page_pane->appendChild($comment_form->render()); $page_pane->appendChild($comment_form->render());
} }
PhabricatorFeedStoryNotification::updateObjectNotificationViews(
$user, $revision->getPHID());
$object_id = 'D'.$revision->getID(); $object_id = 'D'.$revision->getID();
$top_anchor = id(new PhabricatorAnchorView()) $top_anchor = id(new PhabricatorAnchorView())
@ -445,6 +442,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$content, $content,
array( array(
'title' => $object_id.' '.$revision->getTitle(), 'title' => $object_id.' '.$revision->getTitle(),
'pageObjects' => array($revision->getPHID()),
)); ));
} }

View file

@ -331,9 +331,6 @@ final class ManiphestTaskDetailController extends ManiphestController {
$transaction_view->setAuxiliaryFields($aux_fields); $transaction_view->setAuxiliaryFields($aux_fields);
$transaction_view->setMarkupEngine($engine); $transaction_view->setMarkupEngine($engine);
PhabricatorFeedStoryNotification::updateObjectNotificationViews(
$user, $task->getPHID());
$object_name = 'T'.$task->getID(); $object_name = 'T'.$task->getID();
$actions = $this->buildActionView($task); $actions = $this->buildActionView($task);

View file

@ -70,6 +70,7 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController {
array( array(
'title' => $paste->getFullName(), 'title' => $paste->getFullName(),
'device' => true, 'device' => true,
'pageObjects' => array($paste->getPHID()),
)); ));
} }

View file

@ -101,10 +101,6 @@ final class PholioMockViewController extends PholioController {
$add_comment, $add_comment,
); );
PhabricatorFeedStoryNotification::updateObjectNotificationViews(
$user,
$mock->getPHID());
return $this->buildApplicationPage( return $this->buildApplicationPage(
$content, $content,
array( array(

View file

@ -96,6 +96,8 @@ final class PhabricatorTokenUIEventListener
->setViewer($user) ->setViewer($user)
->loadHandles(); ->loadHandles();
Javelin::initBehavior('phabricator-tooltips');
$list = array(); $list = array();
foreach ($tokens_given as $token_given) { foreach ($tokens_given as $token_given) {
if (!idx($tokens, $token_given->getTokenPHID())) { if (!idx($tokens, $token_given->getTokenPHID())) {