mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
New hovercard UI for Maniphest Tasks
Summary: Swaps out hovercard boring view for super cool workboard card view. Will have more diffs to add additional information down the road. Test Plan: {F4921092} Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17769
This commit is contained in:
parent
d0e6bf831d
commit
b3c8226cbb
3 changed files with 45 additions and 13 deletions
|
@ -155,7 +155,7 @@ return array(
|
|||
'rsrc/css/phui/phui-form.css' => 'a5570f70',
|
||||
'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f',
|
||||
'rsrc/css/phui/phui-header-view.css' => 'e082678d',
|
||||
'rsrc/css/phui/phui-hovercard.css' => 'ae091fc5',
|
||||
'rsrc/css/phui/phui-hovercard.css' => 'df27a6c2',
|
||||
'rsrc/css/phui/phui-icon-set-selector.css' => '87db8fee',
|
||||
'rsrc/css/phui/phui-icon.css' => '12b387a1',
|
||||
'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c',
|
||||
|
@ -862,7 +862,7 @@ return array(
|
|||
'phui-head-thing-view-css' => 'fd311e5f',
|
||||
'phui-header-view-css' => 'e082678d',
|
||||
'phui-hovercard' => '1bd28176',
|
||||
'phui-hovercard-view-css' => 'ae091fc5',
|
||||
'phui-hovercard-view-css' => 'df27a6c2',
|
||||
'phui-icon-set-selector-css' => '87db8fee',
|
||||
'phui-icon-view-css' => '12b387a1',
|
||||
'phui-image-mask-css' => 'a8498f9c',
|
||||
|
|
|
@ -24,24 +24,52 @@ final class ManiphestHovercardEngineExtension
|
|||
$task,
|
||||
$data) {
|
||||
$viewer = $this->getViewer();
|
||||
require_celerity_resource('phui-workcard-view-css');
|
||||
|
||||
$hovercard
|
||||
->setTitle($task->getMonogram())
|
||||
->setDetail($task->getTitle());
|
||||
$id = $task->getID();
|
||||
$task = id(new ManiphestTaskQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($id))
|
||||
->needProjectPHIDs(true)
|
||||
->executeOne();
|
||||
|
||||
$phids = array();
|
||||
$owner_phid = $task->getOwnerPHID();
|
||||
if ($owner_phid) {
|
||||
$phids[$owner_phid] = $owner_phid;
|
||||
}
|
||||
foreach ($task->getProjectPHIDs() as $phid) {
|
||||
$phids[$phid] = $phid;
|
||||
}
|
||||
|
||||
$handles = $viewer->loadHandles($phids);
|
||||
$handles = iterator_to_array($handles);
|
||||
|
||||
$card = id(new ProjectBoardTaskCard())
|
||||
->setViewer($viewer)
|
||||
->setTask($task)
|
||||
->setCanEdit(false);
|
||||
|
||||
$owner_phid = $task->getOwnerPHID();
|
||||
if ($owner_phid) {
|
||||
$owner = $viewer->renderHandle($owner_phid);
|
||||
} else {
|
||||
$owner = phutil_tag('em', array(), pht('None'));
|
||||
$owner_handle = $handles[$owner_phid];
|
||||
$card->setOwner($owner_handle);
|
||||
}
|
||||
$hovercard->addField(pht('Assigned To'), $owner);
|
||||
|
||||
$hovercard->addField(
|
||||
pht('Priority'),
|
||||
ManiphestTaskPriority::getTaskPriorityName($task->getPriority()));
|
||||
$project_phids = $task->getProjectPHIDs();
|
||||
$project_handles = array_select_keys($handles, $project_phids);
|
||||
if ($project_handles) {
|
||||
$card->setProjectHandles($project_handles);
|
||||
}
|
||||
|
||||
$item = $card->getItem();
|
||||
$card = id(new PHUIObjectItemListView())
|
||||
->setFlush(true)
|
||||
->setItemClass('phui-workcard')
|
||||
->addClass('hovercard-task-view')
|
||||
->addItem($item);
|
||||
$hovercard->appendChild($card);
|
||||
|
||||
$hovercard->addTag(ManiphestView::renderTagForTask($task));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,3 +105,7 @@
|
|||
.phui-hovercard-tail a.button {
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
.phui-hovercard-wrapper .hovercard-task-view {
|
||||
box-shadow: 0px 4px 16px rgba(0,0,0,.2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue