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:
parent
d61ac3468b
commit
576804f67f
|
@ -18,8 +18,9 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample {
|
||||||
$elements = array();
|
$elements = array();
|
||||||
|
|
||||||
$diff_handle = $this->createBasicDummyHandle(
|
$diff_handle = $this->createBasicDummyHandle(
|
||||||
"Introduce cooler Differential Revisions",
|
"D123",
|
||||||
PhabricatorPHIDConstants::PHID_TYPE_DREV);
|
PhabricatorPHIDConstants::PHID_TYPE_DREV,
|
||||||
|
"Introduce cooler Differential Revisions");
|
||||||
|
|
||||||
$panel = $this->createPanel("Differential Hovercard");
|
$panel = $this->createPanel("Differential Hovercard");
|
||||||
$panel->appendChild(id(new PhabricatorHovercardView())
|
$panel->appendChild(id(new PhabricatorHovercardView())
|
||||||
|
@ -31,8 +32,9 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample {
|
||||||
$elements[] = $panel;
|
$elements[] = $panel;
|
||||||
|
|
||||||
$task_handle = $this->createBasicDummyHandle(
|
$task_handle = $this->createBasicDummyHandle(
|
||||||
"Improve Mobile Experience for Phabricator",
|
"T123",
|
||||||
PhabricatorPHIDConstants::PHID_TYPE_TASK);
|
PhabricatorPHIDConstants::PHID_TYPE_TASK,
|
||||||
|
"Improve Mobile Experience for Phabricator");
|
||||||
|
|
||||||
$tag = id(new PhabricatorTagView())
|
$tag = id(new PhabricatorTagView())
|
||||||
->setType(PhabricatorTagView::TYPE_STATE)
|
->setType(PhabricatorTagView::TYPE_STATE)
|
||||||
|
|
|
@ -11,26 +11,14 @@ final class PhabricatorHovercardView extends AphrontView {
|
||||||
*/
|
*/
|
||||||
private $handle;
|
private $handle;
|
||||||
|
|
||||||
private $id;
|
|
||||||
|
|
||||||
private $title = array();
|
private $title = array();
|
||||||
private $detail;
|
private $detail;
|
||||||
private $tags = array();
|
private $tags = array();
|
||||||
private $fields = array();
|
private $fields = array();
|
||||||
private $actions = array();
|
private $actions = array();
|
||||||
|
|
||||||
/**
|
|
||||||
* For overriding in case of Countdown, Paste, Pholio
|
|
||||||
*/
|
|
||||||
private $body;
|
|
||||||
|
|
||||||
private $color = 'grey';
|
private $color = 'grey';
|
||||||
|
|
||||||
public function setId($id) {
|
|
||||||
$this->id = $id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setObjectHandle(PhabricatorObjectHandle $handle) {
|
public function setObjectHandle(PhabricatorObjectHandle $handle) {
|
||||||
$this->handle = $handle;
|
$this->handle = $handle;
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -79,10 +67,6 @@ final class PhabricatorHovercardView extends AphrontView {
|
||||||
}
|
}
|
||||||
|
|
||||||
$handle = $this->handle;
|
$handle = $this->handle;
|
||||||
$user = $this->getUser();
|
|
||||||
|
|
||||||
$id = $handle->getAlternateID();
|
|
||||||
$type = $handle->getType();
|
|
||||||
|
|
||||||
require_celerity_resource("phabricator-hovercard-view-css");
|
require_celerity_resource("phabricator-hovercard-view-css");
|
||||||
|
|
||||||
|
@ -99,7 +83,7 @@ final class PhabricatorHovercardView extends AphrontView {
|
||||||
|
|
||||||
$title[] = pht("%s: %s",
|
$title[] = pht("%s: %s",
|
||||||
$handle->getTypeName(),
|
$handle->getTypeName(),
|
||||||
$this->title ? $this->title : substr($type, 0, 1) . $id);
|
$this->title ? $this->title : $handle->getName());
|
||||||
|
|
||||||
$body = array();
|
$body = array();
|
||||||
if ($this->detail) {
|
if ($this->detail) {
|
||||||
|
@ -177,7 +161,6 @@ final class PhabricatorHovercardView extends AphrontView {
|
||||||
return phutil_tag('div',
|
return phutil_tag('div',
|
||||||
array(
|
array(
|
||||||
'class' => 'phabricator-hovercard-wrapper',
|
'class' => 'phabricator-hovercard-wrapper',
|
||||||
'id' => $this->id,
|
|
||||||
),
|
),
|
||||||
$hovercard);
|
$hovercard);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue