mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +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:
parent
b695558223
commit
1f3b058daa
2 changed files with 22 additions and 2 deletions
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue