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

New NUX states for Conpherence

Summary: Roughly, if user isn't in any rooms, search for joinable ones. If no results, show big NUX banner.

Test Plan: Left all rooms, got fallback, joined room, left room. Create new instance, see new NUX. Set instance to public, visit Conpherence with and without public rooms.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16563
This commit is contained in:
Chad Little 2016-09-16 14:56:58 -07:00
parent 1ea6fe9387
commit 28201bf2b5
5 changed files with 73 additions and 54 deletions

View file

@ -7,7 +7,7 @@
*/ */
return array( return array(
'names' => array( 'names' => array(
'conpherence.pkg.css' => '1e8e5a40', 'conpherence.pkg.css' => '80a3fcb3',
'conpherence.pkg.js' => '89b4837e', 'conpherence.pkg.js' => '89b4837e',
'core.pkg.css' => '476e9330', 'core.pkg.css' => '476e9330',
'core.pkg.js' => '1d376fa9', 'core.pkg.js' => '1d376fa9',
@ -48,8 +48,8 @@ return array(
'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a',
'rsrc/css/application/conpherence/durable-column.css' => '194ac487', 'rsrc/css/application/conpherence/durable-column.css' => '194ac487',
'rsrc/css/application/conpherence/header-pane.css' => '517de9fe', 'rsrc/css/application/conpherence/header-pane.css' => '517de9fe',
'rsrc/css/application/conpherence/menu.css' => '8344d122', 'rsrc/css/application/conpherence/menu.css' => '78c7b811',
'rsrc/css/application/conpherence/message-pane.css' => 'c075e8fe', 'rsrc/css/application/conpherence/message-pane.css' => '8d13ac4d',
'rsrc/css/application/conpherence/notification.css' => '6cdcc253', 'rsrc/css/application/conpherence/notification.css' => '6cdcc253',
'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56', 'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56',
'rsrc/css/application/conpherence/transaction.css' => '46253e19', 'rsrc/css/application/conpherence/transaction.css' => '46253e19',
@ -620,8 +620,8 @@ return array(
'config-page-css' => '8798e14f', 'config-page-css' => '8798e14f',
'conpherence-durable-column-view' => '194ac487', 'conpherence-durable-column-view' => '194ac487',
'conpherence-header-pane-css' => '517de9fe', 'conpherence-header-pane-css' => '517de9fe',
'conpherence-menu-css' => '8344d122', 'conpherence-menu-css' => '78c7b811',
'conpherence-message-pane-css' => 'c075e8fe', 'conpherence-message-pane-css' => '8d13ac4d',
'conpherence-notification-css' => '6cdcc253', 'conpherence-notification-css' => '6cdcc253',
'conpherence-participant-pane-css' => '7bba0b56', 'conpherence-participant-pane-css' => '7bba0b56',
'conpherence-thread-manager' => '01774ab2', 'conpherence-thread-manager' => '01774ab2',

View file

@ -154,7 +154,7 @@ final class ConpherenceViewController extends
$button_text = pht('Send'); $button_text = pht('Send');
} else if ($user->isLoggedIn()) { } else if ($user->isLoggedIn()) {
$action = ConpherenceUpdateActions::JOIN_ROOM; $action = ConpherenceUpdateActions::JOIN_ROOM;
$button_text = pht('Join'); $button_text = pht('Join Room');
} else { } else {
// user not logged in so give them a login button. // user not logged in so give them a login button.
$login_href = id(new PhutilURI('/auth/start/')) $login_href = id(new PhutilURI('/auth/start/'))

View file

@ -72,6 +72,7 @@ final class ConpherenceLayoutView extends AphrontView {
$selected_thread_id = null; $selected_thread_id = null;
$selected_thread_phid = null; $selected_thread_phid = null;
$can_edit_selected = null; $can_edit_selected = null;
$nux = null;
if ($this->thread) { if ($this->thread) {
$selected_id = $this->thread->getPHID().'-nav-item'; $selected_id = $this->thread->getPHID().'-nav-item';
$selected_thread_id = $this->thread->getID(); $selected_thread_id = $this->thread->getID();
@ -80,6 +81,8 @@ final class ConpherenceLayoutView extends AphrontView {
$this->getUser(), $this->getUser(),
$this->thread, $this->thread,
PhabricatorPolicyCapability::CAN_EDIT); PhabricatorPolicyCapability::CAN_EDIT);
} else {
$nux = $this->buildNUXView();
} }
$this->initBehavior('conpherence-menu', $this->initBehavior('conpherence-menu',
array( array(
@ -146,29 +149,7 @@ final class ConpherenceLayoutView extends AphrontView {
'sigil' => 'conpherence-no-threads', 'sigil' => 'conpherence-no-threads',
'style' => 'display: none;', 'style' => 'display: none;',
), ),
array( $nux),
phutil_tag(
'div',
array(
'class' => 'text',
),
pht('You are not in any rooms yet.')),
javelin_tag(
'a',
array(
'href' => '/conpherence/search/',
'class' => 'button grey mlr',
),
pht('Join a Room')),
javelin_tag(
'a',
array(
'href' => '/conpherence/new/',
'class' => 'button grey',
'sigil' => 'workflow',
),
pht('Create a Room')),
)),
javelin_tag( javelin_tag(
'div', 'div',
array( array(
@ -224,4 +205,55 @@ final class ConpherenceLayoutView extends AphrontView {
)); ));
} }
private function buildNUXView() {
$viewer = $this->getViewer();
$engine = new ConpherenceThreadSearchEngine();
$engine->setViewer($viewer);
$saved = $engine->buildSavedQueryFromBuiltin('all');
$query = $engine->buildQueryFromSavedQuery($saved);
$pager = $engine->newPagerForSavedQuery($saved);
$pager->setPageSize(10);
$results = $engine->executeQuery($query, $pager);
$view = $engine->renderResults($results, $saved);
$create_button = id(new PHUIButtonView())
->setTag('a')
->setText(pht('New Room'))
->setHref('/conpherence/new/')
->setWorkflow(true)
->setColor(PHUIButtonView::GREEN);
if ($results) {
$create_button->setIcon('fa-comments');
$header = id(new PHUIHeaderView())
->setHeader(pht('Joinable Rooms'))
->addActionLink($create_button);
$box = id(new PHUIObjectBoxView())
->setHeader($header)
->setObjectList($view->getObjectList());
if ($viewer->isLoggedIn()) {
$info = id(new PHUIInfoView())
->appendChild(pht('You have not joined any rooms yet.'))
->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
$box->setInfoView($info);
}
return $box;
} else {
$view = id(new PHUIBigInfoView())
->setIcon('fa-comments')
->setTitle(pht('Welcome to Conpherence'))
->setDescription(
pht('Conpherence lets you create public or private rooms to '.
'communicate with others.'))
->addAction($create_button);
return $view;
}
}
} }

View file

@ -11,27 +11,6 @@
background: #fff; background: #fff;
} }
.conpherence-layout .conpherence-no-threads {
text-align: center;
position: fixed;
left: 240px;
right: 240px;
top: 76px;
bottom: 0px;
min-width: 300px;
width: auto;
}
.device .conpherence-layout .conpherence-no-threads {
left: 0;
right: 0;
width: 100%;
}
.conpherence-layout .conpherence-no-threads .text {
margin: 0px 0px 16px 0px;
}
.conpherence-menu-pane { .conpherence-menu-pane {
width: 100%; width: 100%;
position: absolute; position: absolute;

View file

@ -24,12 +24,20 @@
width: 100%; width: 100%;
} }
.conpherence-layout .conpherence-no-threads { .conpherence-layout .conpherence-content-pane .conpherence-no-threads {
text-align: center; top: 44px;
right: 0;
background: #fff;
z-index: 26;
} }
.conpherence-layout .conpherence-no-threads .text { .conpherence-layout .phui-big-info-view {
margin: 16px 0px 16px 0px; margin: 16px;
}
.conpherence-layout .conpherence-no-threads .phui-box-border {
border: none;
margin: 0;
} }
.conpherence-show-more-messages { .conpherence-show-more-messages {