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

Changing default fallback behaviour of hovercard view

Summary:
Refs T1048; Depends on D5571 - Use names instead of `substr($handle->getType(), 0, 1).$handle->getAlternateID()`, which did not work for 70% of the handles

This, of course, breaks UI Examples, which was pretty off before anyway.

Unbreak UIExamples.

Test Plan: UIExamples, Hovercard Controller in human test mode

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1048

Differential Revision: https://secure.phabricator.com/D5572
This commit is contained in:
Anh Nhan Nguyen 2013-04-05 08:11:16 -07:00 committed by epriestley
parent d61ac3468b
commit 576804f67f
2 changed files with 7 additions and 22 deletions

View file

@ -18,8 +18,9 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample {
$elements = array();
$diff_handle = $this->createBasicDummyHandle(
"Introduce cooler Differential Revisions",
PhabricatorPHIDConstants::PHID_TYPE_DREV);
"D123",
PhabricatorPHIDConstants::PHID_TYPE_DREV,
"Introduce cooler Differential Revisions");
$panel = $this->createPanel("Differential Hovercard");
$panel->appendChild(id(new PhabricatorHovercardView())
@ -31,8 +32,9 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample {
$elements[] = $panel;
$task_handle = $this->createBasicDummyHandle(
"Improve Mobile Experience for Phabricator",
PhabricatorPHIDConstants::PHID_TYPE_TASK);
"T123",
PhabricatorPHIDConstants::PHID_TYPE_TASK,
"Improve Mobile Experience for Phabricator");
$tag = id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE)

View file

@ -11,26 +11,14 @@ final class PhabricatorHovercardView extends AphrontView {
*/
private $handle;
private $id;
private $title = array();
private $detail;
private $tags = array();
private $fields = array();
private $actions = array();
/**
* For overriding in case of Countdown, Paste, Pholio
*/
private $body;
private $color = 'grey';
public function setId($id) {
$this->id = $id;
return $this;
}
public function setObjectHandle(PhabricatorObjectHandle $handle) {
$this->handle = $handle;
return $this;
@ -79,10 +67,6 @@ final class PhabricatorHovercardView extends AphrontView {
}
$handle = $this->handle;
$user = $this->getUser();
$id = $handle->getAlternateID();
$type = $handle->getType();
require_celerity_resource("phabricator-hovercard-view-css");
@ -99,7 +83,7 @@ final class PhabricatorHovercardView extends AphrontView {
$title[] = pht("%s: %s",
$handle->getTypeName(),
$this->title ? $this->title : substr($type, 0, 1) . $id);
$this->title ? $this->title : $handle->getName());
$body = array();
if ($this->detail) {
@ -177,7 +161,6 @@ final class PhabricatorHovercardView extends AphrontView {
return phutil_tag('div',
array(
'class' => 'phabricator-hovercard-wrapper',
'id' => $this->id,
),
$hovercard);
}