1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +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:
Chad Little 2017-04-23 12:32:27 -07:00
parent d0e6bf831d
commit b3c8226cbb
3 changed files with 45 additions and 13 deletions

View file

@ -155,7 +155,7 @@ return array(
'rsrc/css/phui/phui-form.css' => 'a5570f70', 'rsrc/css/phui/phui-form.css' => 'a5570f70',
'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f', 'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f',
'rsrc/css/phui/phui-header-view.css' => 'e082678d', '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-set-selector.css' => '87db8fee',
'rsrc/css/phui/phui-icon.css' => '12b387a1', 'rsrc/css/phui/phui-icon.css' => '12b387a1',
'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c', 'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c',
@ -862,7 +862,7 @@ return array(
'phui-head-thing-view-css' => 'fd311e5f', 'phui-head-thing-view-css' => 'fd311e5f',
'phui-header-view-css' => 'e082678d', 'phui-header-view-css' => 'e082678d',
'phui-hovercard' => '1bd28176', 'phui-hovercard' => '1bd28176',
'phui-hovercard-view-css' => 'ae091fc5', 'phui-hovercard-view-css' => 'df27a6c2',
'phui-icon-set-selector-css' => '87db8fee', 'phui-icon-set-selector-css' => '87db8fee',
'phui-icon-view-css' => '12b387a1', 'phui-icon-view-css' => '12b387a1',
'phui-image-mask-css' => 'a8498f9c', 'phui-image-mask-css' => 'a8498f9c',

View file

@ -24,24 +24,52 @@ final class ManiphestHovercardEngineExtension
$task, $task,
$data) { $data) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
require_celerity_resource('phui-workcard-view-css');
$hovercard $id = $task->getID();
->setTitle($task->getMonogram()) $task = id(new ManiphestTaskQuery())
->setDetail($task->getTitle()); ->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(); $owner_phid = $task->getOwnerPHID();
if ($owner_phid) { if ($owner_phid) {
$owner = $viewer->renderHandle($owner_phid); $owner_handle = $handles[$owner_phid];
} else { $card->setOwner($owner_handle);
$owner = phutil_tag('em', array(), pht('None'));
} }
$hovercard->addField(pht('Assigned To'), $owner);
$hovercard->addField( $project_phids = $task->getProjectPHIDs();
pht('Priority'), $project_handles = array_select_keys($handles, $project_phids);
ManiphestTaskPriority::getTaskPriorityName($task->getPriority())); 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));
} }
} }

View file

@ -105,3 +105,7 @@
.phui-hovercard-tail a.button { .phui-hovercard-tail a.button {
margin: 3px; margin: 3px;
} }
.phui-hovercard-wrapper .hovercard-task-view {
box-shadow: 0px 4px 16px rgba(0,0,0,.2);
}