mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-01 18:30:59 +01:00
Update Notifications for handleRequest
Summary: Updates Notifcations for handleRequest Test Plan: Test as much as I could, mark all, view, lists. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T8628 Differential Revision: https://secure.phabricator.com/D13767
This commit is contained in:
parent
ba2cc4f2ee
commit
f5be68c59c
6 changed files with 20 additions and 28 deletions
|
@ -3,10 +3,9 @@
|
|||
final class PhabricatorNotificationClearController
|
||||
extends PhabricatorNotificationController {
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$chrono_key = $request->getStr('chronoKey');
|
||||
$user = $request->getUser();
|
||||
|
||||
if ($request->isDialogFormPost()) {
|
||||
$table = new PhabricatorFeedStoryNotification();
|
||||
|
@ -16,7 +15,7 @@ final class PhabricatorNotificationClearController
|
|||
'UPDATE %T SET hasViewed = 1 '.
|
||||
'WHERE userPHID = %s AND hasViewed = 0 and chronologicalKey <= %s',
|
||||
$table->getTableName(),
|
||||
$user->getPHID(),
|
||||
$viewer->getPHID(),
|
||||
$chrono_key);
|
||||
|
||||
return id(new AphrontReloadResponse())
|
||||
|
@ -24,7 +23,7 @@ final class PhabricatorNotificationClearController
|
|||
}
|
||||
|
||||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($user);
|
||||
$dialog->setUser($viewer);
|
||||
$dialog->addCancelButton('/notification/');
|
||||
if ($chrono_key) {
|
||||
$dialog->setTitle(pht('Really mark all notifications as read?'));
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
final class PhabricatorNotificationIndividualController
|
||||
extends PhabricatorNotificationController {
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$stories = id(new PhabricatorNotificationQuery())
|
||||
->setViewer($viewer)
|
||||
|
|
|
@ -3,15 +3,11 @@
|
|||
final class PhabricatorNotificationListController
|
||||
extends PhabricatorNotificationController {
|
||||
|
||||
private $queryKey;
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$querykey = $request->getURIData('queryKey');
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->queryKey = idx($data, 'queryKey');
|
||||
}
|
||||
|
||||
public function processRequest() {
|
||||
$controller = id(new PhabricatorApplicationSearchController())
|
||||
->setQueryKey($this->queryKey)
|
||||
->setQueryKey($querykey)
|
||||
->setSearchEngine(new PhabricatorNotificationSearchEngine())
|
||||
->setNavigation($this->buildSideNavView());
|
||||
|
||||
|
@ -19,13 +15,13 @@ final class PhabricatorNotificationListController
|
|||
}
|
||||
|
||||
public function buildSideNavView() {
|
||||
$user = $this->getRequest()->getUser();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
|
||||
id(new PhabricatorNotificationSearchEngine())
|
||||
->setViewer($user)
|
||||
->setViewer($viewer)
|
||||
->addNavigationItems($nav->getMenu());
|
||||
$nav->selectFilter(null);
|
||||
|
||||
|
|
|
@ -3,14 +3,12 @@
|
|||
final class PhabricatorNotificationPanelController
|
||||
extends PhabricatorNotificationController {
|
||||
|
||||
public function processRequest() {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$user = $request->getUser();
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$query = id(new PhabricatorNotificationQuery())
|
||||
->setViewer($user)
|
||||
->withUserPHIDs(array($user->getPHID()))
|
||||
->setViewer($viewer)
|
||||
->withUserPHIDs(array($viewer->getPHID()))
|
||||
->setLimit(15);
|
||||
|
||||
$stories = $query->execute();
|
||||
|
@ -81,7 +79,7 @@ final class PhabricatorNotificationPanelController
|
|||
$connection_ui);
|
||||
|
||||
$unread_count = id(new PhabricatorFeedStoryNotification())
|
||||
->countUnread($user);
|
||||
->countUnread($viewer);
|
||||
|
||||
$json = array(
|
||||
'content' => $content,
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
final class PhabricatorNotificationStatusController
|
||||
extends PhabricatorNotificationController {
|
||||
|
||||
public function processRequest() {
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
|
||||
try {
|
||||
$status = PhabricatorNotificationClient::getServerStatus();
|
||||
$status = $this->renderServerStatus($status);
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
final class PhabricatorNotificationTestController
|
||||
extends PhabricatorNotificationController {
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$story_type = 'PhabricatorNotificationTestFeedStory';
|
||||
$story_data = array(
|
||||
|
|
Loading…
Reference in a new issue