1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Conpherence - add icon-based room switcher to durable column view

Summary: Ref T7380. This does the most basic thing ever and sticks up to 6 icons in there.

Test Plan: clicked the icons and noted new conpherences loaded in nicely

Reviewers: epriestley, chad

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7380

Differential Revision: https://secure.phabricator.com/D12037
This commit is contained in:
Bob Trahan 2015-03-10 15:30:49 -07:00
parent 5afa2c3b62
commit 4674a5eab9
5 changed files with 154 additions and 61 deletions

View file

@ -44,7 +44,7 @@ return array(
'rsrc/css/application/config/config-welcome.css' => '6abd79be',
'rsrc/css/application/config/setup-issue.css' => '22270af2',
'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2',
'rsrc/css/application/conpherence/durable-column.css' => '9207426d',
'rsrc/css/application/conpherence/durable-column.css' => '7abcc3f2',
'rsrc/css/application/conpherence/menu.css' => 'c6ac5299',
'rsrc/css/application/conpherence/message-pane.css' => '5930260a',
'rsrc/css/application/conpherence/notification.css' => '04a6e10a',
@ -207,8 +207,8 @@ return array(
'rsrc/externals/javelin/lib/Resource.js' => '44959b73',
'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692',
'rsrc/externals/javelin/lib/Router.js' => '29274e2b',
'rsrc/externals/javelin/lib/Scrollbar.js' => '1ed54a27',
'rsrc/externals/javelin/lib/Sound.js' => '59655c83',
'rsrc/externals/javelin/lib/Scrollbar.js' => '1feea462',
'rsrc/externals/javelin/lib/Sound.js' => '949c0fe5',
'rsrc/externals/javelin/lib/URI.js' => '6eff08aa',
'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8',
'rsrc/externals/javelin/lib/WebSocket.js' => 'e292eaf4',
@ -352,10 +352,11 @@ return array(
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761',
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'e4affa94',
'rsrc/js/application/conpherence/behavior-menu.js' => '869e3445',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '86df5915',
'rsrc/js/application/conpherence/behavior-widget-pane.js' => '40b1ff90',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'efef202b',
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'd8dab826',
'rsrc/js/application/conpherence/behavior-menu.js' => 'e476c952',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861',
'rsrc/js/application/conpherence/behavior-widget-pane.js' => '2c1cd7f5',
'rsrc/js/application/countdown/timer.js' => 'e4cc26b3',
'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e',
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '82439934',
@ -513,10 +514,11 @@ return array(
'changeset-view-manager' => '88be0133',
'config-options-css' => '7fedf08b',
'config-welcome-css' => '6abd79be',
'conpherence-durable-column-view' => '9207426d',
'conpherence-durable-column-view' => '7abcc3f2',
'conpherence-menu-css' => 'c6ac5299',
'conpherence-message-pane-css' => '5930260a',
'conpherence-notification-css' => '04a6e10a',
'conpherence-thread-manager' => 'efef202b',
'conpherence-update-css' => '1099a660',
'conpherence-widget-pane-css' => '3d575438',
'differential-changeset-view-css' => '6a8b172a',
@ -556,9 +558,9 @@ return array(
'javelin-behavior-boards-dropdown' => '0ec56e1d',
'javelin-behavior-choose-control' => '6153c708',
'javelin-behavior-config-reorder-fields' => '14a827de',
'javelin-behavior-conpherence-menu' => '869e3445',
'javelin-behavior-conpherence-pontificate' => '86df5915',
'javelin-behavior-conpherence-widget-pane' => '40b1ff90',
'javelin-behavior-conpherence-menu' => 'e476c952',
'javelin-behavior-conpherence-pontificate' => '21ba5861',
'javelin-behavior-conpherence-widget-pane' => '2c1cd7f5',
'javelin-behavior-countdown-timer' => 'e4cc26b3',
'javelin-behavior-dark-console' => '08883e8b',
'javelin-behavior-dashboard-async-panel' => '469c0d9e',
@ -583,7 +585,7 @@ return array(
'javelin-behavior-diffusion-locate-file' => '6d3e1947',
'javelin-behavior-diffusion-pull-lastmodified' => '2b228192',
'javelin-behavior-doorkeeper-tag' => 'e5822781',
'javelin-behavior-durable-column' => 'e4affa94',
'javelin-behavior-durable-column' => 'd8dab826',
'javelin-behavior-error-log' => '6882e80a',
'javelin-behavior-fancy-datepicker' => 'c51ae228',
'javelin-behavior-global-drag-and-drop' => '07f199d8',
@ -677,8 +679,8 @@ return array(
'javelin-resource' => '44959b73',
'javelin-routable' => 'b3e7d692',
'javelin-router' => '29274e2b',
'javelin-scrollbar' => '1ed54a27',
'javelin-sound' => '59655c83',
'javelin-scrollbar' => '1feea462',
'javelin-sound' => '949c0fe5',
'javelin-stratcom' => '6c53634d',
'javelin-tokenizer' => '7644823e',
'javelin-typeahead' => '70baed2f',
@ -952,7 +954,7 @@ return array(
'javelin-dom',
'javelin-reactor-dom',
),
'1ed54a27' => array(
'1feea462' => array(
'javelin-install',
'javelin-dom',
'javelin-stratcom',
@ -970,6 +972,14 @@ return array(
'phabricator-phtize',
'changeset-view-manager',
),
'21ba5861' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-workflow',
'javelin-stratcom',
'conpherence-thread-manager',
),
'2290aeef' => array(
'javelin-install',
'javelin-dom',
@ -1014,6 +1024,19 @@ return array(
'javelin-stratcom',
'javelin-dom',
),
'2c1cd7f5' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-workflow',
'javelin-util',
'phabricator-notification',
'javelin-behavior-device',
'phuix-dropdown-menu',
'phuix-action-list-view',
'phuix-action-view',
'conpherence-thread-manager',
),
'2c426492' => array(
'javelin-behavior',
'javelin-dom',
@ -1069,18 +1092,6 @@ return array(
'javelin-dom',
'javelin-reactor-dom',
),
'40b1ff90' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-workflow',
'javelin-util',
'phabricator-notification',
'javelin-behavior-device',
'phuix-dropdown-menu',
'phuix-action-list-view',
'phuix-action-view',
),
42126667 => array(
'javelin-behavior',
'javelin-dom',
@ -1177,9 +1188,6 @@ return array(
'javelin-vector',
'javelin-dom',
),
'59655c83' => array(
'javelin-install',
),
'59b251eb' => array(
'javelin-behavior',
'javelin-stratcom',
@ -1439,24 +1447,6 @@ return array(
'phabricator-tooltip',
'changeset-view-manager',
),
'869e3445' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-workflow',
'javelin-behavior-device',
'javelin-history',
'javelin-vector',
'phabricator-shaped-request',
),
'86df5915' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-workflow',
'javelin-stratcom',
),
'87cb6b51' => array(
'javelin-behavior',
'javelin-dom',
@ -1553,6 +1543,9 @@ return array(
'javelin-workflow',
'javelin-util',
),
'949c0fe5' => array(
'javelin-install',
),
'94b750d2' => array(
'javelin-install',
'javelin-stratcom',
@ -1793,6 +1786,15 @@ return array(
'javelin-util',
'phabricator-shaped-request',
),
'd8dab826' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-scrollbar',
'javelin-quicksand',
'phabricator-keyboard-shortcut',
'conpherence-thread-manager',
),
'dbbf48b6' => array(
'javelin-behavior',
'javelin-stratcom',
@ -1842,13 +1844,17 @@ return array(
'javelin-dom',
'javelin-uri',
),
'e4affa94' => array(
'e476c952' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-scrollbar',
'javelin-quicksand',
'phabricator-keyboard-shortcut',
'javelin-workflow',
'javelin-behavior-device',
'javelin-history',
'javelin-vector',
'phabricator-shaped-request',
'conpherence-thread-manager',
),
'e4cc26b3' => array(
'javelin-behavior',
@ -1897,6 +1903,16 @@ return array(
'javelin-install',
'javelin-util',
),
'efef202b' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
),
'f24f3253' => array(
'javelin-behavior',
'javelin-dom',

View file

@ -6,6 +6,24 @@ final class ConpherenceColumnViewController extends
public function handleRequest(AphrontRequest $request) {
$user = $request->getUser();
$latest_conpherences = array();
$latest_participant = id(new ConpherenceParticipantQuery())
->withParticipantPHIDs(array($user->getPHID()))
->setLimit(6)
->execute();
if ($latest_participant) {
$conpherence_phids = mpull($latest_participant, 'getConpherencePHID');
$latest_conpherences = id(new ConpherenceThreadQuery())
->setViewer($user)
->withPHIDs($conpherence_phids)
->needParticipantCache(true)
->execute();
$latest_conpherences = mpull($latest_conpherences, null, 'getPHID');
$latest_conpherences = array_select_keys(
$latest_conpherences,
$conpherence_phids);
}
$conpherence = null;
if ($request->getInt('id')) {
$conpherence = id(new ConpherenceThreadQuery())
@ -14,13 +32,7 @@ final class ConpherenceColumnViewController extends
->needTransactions(true)
->setTransactionLimit(ConpherenceThreadQuery::TRANSACTION_LIMIT)
->executeOne();
} else {
// TODO - should be pulling more data than this to build the
// icon bar, etc, kind of always
$latest_participant = id(new ConpherenceParticipantQuery())
->withParticipantPHIDs(array($user->getPHID()))
->setLimit(1)
->execute();
} else if ($latest_participant) {
$participant = head($latest_participant);
$conpherence = id(new ConpherenceThreadQuery())
->setViewer($user)
@ -45,6 +57,7 @@ final class ConpherenceColumnViewController extends
$durable_column = id(new ConpherenceDurableColumnView())
->setUser($user)
->setSelectedConpherence($conpherence)
->setConpherences($latest_conpherences)
->setStyle(null);
$response = array(

View file

@ -129,7 +129,36 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
}
private function buildIconBar() {
return null;
$icons = array();
$selected_conpherence = $this->getSelectedConpherence();
$conpherences = $this->getConpherences();
foreach ($conpherences as $conpherence) {
$classes = array('conpherence-durable-column-thread-icon');
if ($selected_conpherence->getID() == $conpherence->getID()) {
$classes[] = 'selected';
}
$data = $conpherence->getDisplayData($this->getUser());
$image = $data['image'];
$icons[] =
javelin_tag(
'a',
array(
'href' => '/conpherence/columnview/',
'class' => implode(' ', $classes),
'sigil' => 'conpherence-durable-column-thread-icon',
'meta' => array(
'threadID' => $conpherence->getID(),
),
),
phutil_tag(
'span',
array(
'style' => 'background-image: url('.$image.')',
),
''));
}
return $icons;
}
private function buildHeader() {

View file

@ -55,10 +55,36 @@
.conpherence-durable-column-icon-bar {
height: 34px;
padding: 5px 16px;
padding: 5px 12px;
border-bottom: 1px solid {$thinblueborder};
}
.conpherence-durable-column-icon-bar .conpherence-durable-column-thread-icon {
float: left;
display: block;
width: 30px;
height: 30px;
margin: 0px 8px 0px 0px;
border: 2px solid transparent;
border-radius: 3px;
}
.conpherence-durable-column-icon-bar
.conpherence-durable-column-thread-icon.selected {
border-color: {$blueborder};
}
.conpherence-durable-column-icon-bar
.conpherence-durable-column-thread-icon span {
position: relative;
display: block;
width: 26px;
height: 26px;
top: 2px;
left: 2px;
background-size: 26px 26px;
}
.conpherence-durable-column-body {
position: absolute;
top: 44px;

View file

@ -141,6 +141,15 @@ JX.behavior('durable-column', function() {
}
});
JX.Stratcom.listen(
'click',
'conpherence-durable-column-thread-icon',
function (e) {
e.kill();
var data = e.getNodeData('conpherence-durable-column-thread-icon');
threadManager.loadThreadByID(data.threadID);
});
function _getColumnBodyNode() {
var column = JX.$('conpherence-durable-column');
return JX.DOM.find(