Conpherence - get lots of rooms stuff hooked up nicely

Summary:
Ref T7566. This does a big chunk of what's left

 - Main view
  - "Rooms" sub header
    - 5 Rooms shown at a time, with room you're looking at in the top on page load
      - e.g. viewing /conpherence/x/ the room x is at top always
      - solves corner case of when you have yet to "join" the room
    - "See More" link takes you to application search for rooms you have participated in
    - if no rooms, there is a "Create Room" and "Find Rooms" links.
  - "Messages" sub header
    - same as before
  - policy icons showing up in the menu
 - Durable column view - still just the latest N, no changes really there
 - Transactions - special cased rendering to try to say room vs thread as appropos
 - Bug fix - we weren't recording the initial participants transaction post D12177 / D12163. This fixes that.

Should probably test pagination, and if you want to show more than 5 rooms of have it behave more like messages (where you can wind up in the middle of a paginated list) that will be more work. Also, if lots of messages / rooms (100 is the limit) we might not display rooms if we're supposed to. Yay whale usage! :D

Test Plan: made a new room - success. made a new message - success.  viewed a room from /conpherenece/room/ i wasn't a participant in and noted it showed up at the top of the five rooms. clicked around rooms and stuff loaded nicely.

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7566

Differential Revision: https://secure.phabricator.com/D12178
This commit is contained in:
Bob Trahan
2015-03-26 16:37:32 -07:00
parent 9005ce4e9f
commit 39fa190c15
4 changed files with 220 additions and 49 deletions

View File

@@ -6,20 +6,6 @@ final class ConpherenceListController extends ConpherenceController {
const UNSELECTED_MODE = 'unselected';
const PAGING_MODE = 'paging';
private $conpherenceID;
public function setConpherenceID($conpherence_id) {
$this->conpherenceID = $conpherence_id;
return $this;
}
public function getConpherenceID() {
return $this->conpherenceID;
}
public function willProcessRequest(array $data) {
$this->setConpherenceID(idx($data, 'id'));
}
/**
* Three main modes of operation...
*
@@ -44,8 +30,8 @@ final class ConpherenceListController extends ConpherenceController {
return $mode;
}
public function processRequest() {
$request = $this->getRequest();
public function handleRequest(AphrontRequest $request) {
$user = $request->getUser();
$title = pht('Conpherence');
$conpherence = null;
@@ -58,7 +44,7 @@ final class ConpherenceListController extends ConpherenceController {
$mode = $this->determineMode();
switch ($mode) {
case self::SELECTED_MODE:
$conpherence_id = $this->getConpherenceID();
$conpherence_id = $request->getURIData('id');
$conpherence = id(new ConpherenceThreadQuery())
->setViewer($user)
->withIDs(array($conpherence_id))
@@ -70,12 +56,7 @@ final class ConpherenceListController extends ConpherenceController {
$title = $conpherence->getTitle();
}
$cursor = $conpherence->getParticipantIfExists($user->getPHID());
if ($cursor) {
$data = $this->loadParticipationWithMidCursor($cursor);
$all_participation = $data['all_participation'];
$scroll_up_participant = $data['scroll_up_participant'];
$scroll_down_participant = $data['scroll_down_participant'];
} else {
if (!$cursor || $conpherence->getIsRoom()) {
$data = $this->loadDefaultParticipation($too_many);
$all_participation = $data['all_participation'];
$scroll_down_participant = $data['scroll_down_participant'];
@@ -85,6 +66,12 @@ final class ConpherenceListController extends ConpherenceController {
$all_participation =
array($conpherence->getPHID() => $menu_participation) +
$all_participation;
} else {
$data = $this->loadParticipationWithMidCursor($cursor);
$all_participation = $data['all_participation'];
$scroll_up_participant = $data['scroll_up_participant'];
$scroll_down_participant = $data['scroll_down_participant'];
}
break;
case self::PAGING_MODE: