1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Implemented fallback for unimplemented notifications with silly message.

Summary:
Most notifications are not implemented, a fallback message should
be displayed for these cases.

Test Plan: Commented out renderNotificationView in PhabricatorFeedStoryManiphest and watched the notifications render.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: ddfisher, keebuhm, aran, Korvin

Differential Revision: https://secure.phabricator.com/D2700
This commit is contained in:
John-Ashton Allen 2012-06-08 20:24:48 -07:00 committed by epriestley
parent b695558223
commit 1f3b058daa
2 changed files with 22 additions and 2 deletions

View file

@ -29,8 +29,11 @@ abstract class PhabricatorFeedStory {
abstract public function renderView(); abstract public function renderView();
// TODO: Restore this once subclasses actually implement it. // TODO: Make abstract once all subclasses implement it.
// abstract public function renderNotificationView(); public function renderNotificationView() {
return id(new PhabricatorFeedStoryUnknown($this->data))
->renderNotificationView();
}
public function getRequiredHandlePHIDs() { public function getRequiredHandlePHIDs() {
return array(); return array();

View file

@ -34,4 +34,21 @@ final class PhabricatorFeedStoryUnknown extends PhabricatorFeedStory {
return $view; return $view;
} }
public function renderNotificationView() {
$data = $this->getStoryData();
$view = new PhabricatorNotificationStoryView();
$view->setTitle('A wild notifcation appeared!');
$view->setEpoch($data->getEpoch());
$view->appendChild(
'This is an unrenderable feed story of type '.
'"'.phutil_escape_html($data->getStoryType()).'".');
return $view;
}
} }