1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Set some more data on PhabricatorApplicationTransactionFeedStory

Summary:
Kind of just guessed what to do here. It seemed reasonable.

Take the transaction, use the author to get an actor image. Get the main object handle type, use that for the app icon. Use the transaction's created date as a time.

Ref T2988

@chad I think there's still no icon for mock?

Test Plan: Look at my feed. See some info.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: chad, aran, epriestley, Korvin

Maniphest Tasks: T2988

Differential Revision: https://secure.phabricator.com/D6044
This commit is contained in:
Gareth Evans 2013-05-26 07:54:29 -07:00 committed by epriestley
parent 9acc91d691
commit 9a9e556ca7
2 changed files with 20 additions and 2 deletions

View file

@ -35,8 +35,11 @@ class PhabricatorApplicationTransactionFeedStory
$view = new PHUIFeedStoryView();
$view->setViewed($this->getHasViewed());
$href = $this->getHandle($this->getPrimaryObjectPHID())->getURI();
$view->setHref($view);
$handle = $this->getHandle($this->getPrimaryObjectPHID());
$view->setHref($handle->getURI());
$view->setEpoch($this->getPrimaryTransaction()->getDateCreated());
$view->setAppIconFromPHID($handle->getPHID());
$xaction_phids = $this->getValue('transactionPHIDs');
$xaction = $this->getObject(head($xaction_phids));
@ -44,6 +47,10 @@ class PhabricatorApplicationTransactionFeedStory
$xaction->setHandles($this->getHandles());
$view->setTitle($xaction->getTitleForFeed());
$view->setImage(
$this->getHandle(
$this->getPrimaryTransaction()->getAuthorPHID())->getImageURI());
return $view;
}

View file

@ -206,4 +206,15 @@ final class PHUIFeedStoryView extends AphrontView {
->addMargin(PHUI::MARGIN_MEDIUM_BOTTOM)
->appendChild(array($head, $body, $foot));
}
public function setAppIconFromPHID($phid) {
switch(phid_get_type($phid)) {
case PhabricatorPHIDConstants::PHID_TYPE_MOCK:
$this->setAppIcon("pholio-dark");
break;
case PhabricatorPHIDConstants::PHID_TYPE_MCRO:
$this->setAppIcon("macro-dark");
break;
}
}
}