Remove the application menu
Summary: Toss this completely as per discussion elsewhere. Basically it doesn't feel as useful as we imagined it would, and breadcrumbs from T1960 will replace the primary useful part (navigating up). There's some more cleanup to do but I'll hit that in the next few diffs. Closes T1828 as wontfix. Test Plan: Viewed app + local, app-without-local interfaces. Saw no app menus. Reviewers: chad Reviewed By: chad CC: aran, vrana Maniphest Tasks: T1828, T1960 Differential Revision: https://secure.phabricator.com/D4033
This commit is contained in:
@@ -159,13 +159,8 @@ abstract class PhabricatorController extends AphrontController {
|
||||
$view = $nav;
|
||||
}
|
||||
|
||||
if ($application) {
|
||||
$view->setCurrentApplication($application);
|
||||
}
|
||||
|
||||
$view->setUser($this->getRequest()->getUser());
|
||||
$view->setFlexNav(true);
|
||||
$view->setShowApplicationMenu(true);
|
||||
|
||||
$page->appendChild($view);
|
||||
|
||||
|
||||
@@ -26,9 +26,7 @@ final class AphrontSideNavFilterView extends AphrontView {
|
||||
private $selectedFilter = false;
|
||||
private $flexNav;
|
||||
private $flexible;
|
||||
private $showApplicationMenu;
|
||||
private $user;
|
||||
private $currentApplication;
|
||||
private $active;
|
||||
|
||||
public function setActive($active) {
|
||||
@@ -36,21 +34,11 @@ final class AphrontSideNavFilterView extends AphrontView {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCurrentApplication(PhabricatorApplication $current) {
|
||||
$this->currentApplication = $current;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUser(PhabricatorUser $user) {
|
||||
$this->user = $user;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setShowApplicationMenu($show_application_menu) {
|
||||
$this->showApplicationMenu = $show_application_menu;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFlexNav($flex_nav) {
|
||||
$this->flexNav = $flex_nav;
|
||||
return $this;
|
||||
@@ -144,14 +132,10 @@ final class AphrontSideNavFilterView extends AphrontView {
|
||||
$view = new AphrontSideNavView();
|
||||
$view->setFlexNav($this->flexNav);
|
||||
$view->setFlexible($this->flexible);
|
||||
$view->setShowApplicationMenu($this->showApplicationMenu);
|
||||
$view->setActive($this->active);
|
||||
if ($this->user) {
|
||||
$view->setUser($this->user);
|
||||
}
|
||||
if ($this->currentApplication) {
|
||||
$view->setCurrentApplication($this->currentApplication);
|
||||
}
|
||||
foreach ($this->items as $item) {
|
||||
list($type, $key, $name) = $item;
|
||||
switch ($type) {
|
||||
|
||||
@@ -5,9 +5,7 @@ final class AphrontSideNavView extends AphrontView {
|
||||
private $items = array();
|
||||
private $flexNav;
|
||||
private $isFlexible;
|
||||
private $showApplicationMenu;
|
||||
private $user;
|
||||
private $currentApplication;
|
||||
private $active;
|
||||
|
||||
public function setUser(PhabricatorUser $user) {
|
||||
@@ -15,16 +13,6 @@ final class AphrontSideNavView extends AphrontView {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setShowApplicationMenu($show_application_menu) {
|
||||
$this->showApplicationMenu = $show_application_menu;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCurrentApplication(PhabricatorApplication $current) {
|
||||
$this->currentApplication = $current;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addNavItem($item) {
|
||||
$this->items[] = $item;
|
||||
return $this;
|
||||
@@ -57,7 +45,6 @@ final class AphrontSideNavView extends AphrontView {
|
||||
$nav_classes = array();
|
||||
$nav_classes[] = 'phabricator-nav';
|
||||
|
||||
$app_id = celerity_generate_unique_node_id();
|
||||
$nav_id = null;
|
||||
$drag_id = null;
|
||||
$content_id = celerity_generate_unique_node_id();
|
||||
@@ -65,16 +52,6 @@ final class AphrontSideNavView extends AphrontView {
|
||||
$local_menu = null;
|
||||
$main_id = celerity_generate_unique_node_id();
|
||||
|
||||
$apps = $this->renderApplications();
|
||||
|
||||
$app_menu = phutil_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phabricator-nav-col phabricator-nav-app',
|
||||
'id' => $app_id,
|
||||
),
|
||||
$apps->render());
|
||||
|
||||
if ($this->isFlexible) {
|
||||
$drag_id = celerity_generate_unique_node_id();
|
||||
$flex_bar = phutil_render_tag(
|
||||
@@ -105,7 +82,6 @@ final class AphrontSideNavView extends AphrontView {
|
||||
'phabricator-nav',
|
||||
array(
|
||||
'mainID' => $main_id,
|
||||
'appID' => $app_id,
|
||||
'localID' => $local_id,
|
||||
'dragID' => $drag_id,
|
||||
'contentID' => $content_id,
|
||||
@@ -127,14 +103,6 @@ final class AphrontSideNavView extends AphrontView {
|
||||
'<a href="#" class="nav-button nav-button-e nav-button-content '.
|
||||
'nav-button-selected" id="tablet-menu2"></a>'.
|
||||
'</div>'.
|
||||
'<div class="phabricator-nav-head-phone">'.
|
||||
'<a href="#" class="nav-button nav-button-w nav-button-apps" '.
|
||||
'id="phone-menu1"></button>'.
|
||||
'<a href="#" class="nav-button nav-button-menu" '.
|
||||
'id="phone-menu2"></button>'.
|
||||
'<a href="#" class="nav-button nav-button-e nav-button-content '.
|
||||
'nav-button-selected" id="phone-menu3"></button>'.
|
||||
'</div>'.
|
||||
'</div>';
|
||||
|
||||
return $header_part.phutil_render_tag(
|
||||
@@ -143,7 +111,6 @@ final class AphrontSideNavView extends AphrontView {
|
||||
'class' => implode(' ', $nav_classes),
|
||||
'id' => $main_id,
|
||||
),
|
||||
$app_menu.
|
||||
$local_menu.
|
||||
$flex_bar.
|
||||
phutil_render_tag(
|
||||
@@ -171,91 +138,4 @@ final class AphrontSideNavView extends AphrontView {
|
||||
}
|
||||
}
|
||||
|
||||
private function renderApplications() {
|
||||
$core = array();
|
||||
$current = $this->currentApplication;
|
||||
|
||||
$meta = null;
|
||||
|
||||
$group_core = PhabricatorApplication::GROUP_CORE;
|
||||
|
||||
$applications = PhabricatorApplication::getAllInstalledApplications();
|
||||
foreach ($applications as $application) {
|
||||
if ($application instanceof PhabricatorApplicationApplications) {
|
||||
$meta = $application;
|
||||
continue;
|
||||
}
|
||||
if ($application->getApplicationGroup() != $group_core) {
|
||||
continue;
|
||||
}
|
||||
if ($application->getApplicationOrder() !== null) {
|
||||
$core[] = $application;
|
||||
}
|
||||
}
|
||||
|
||||
$core = msort($core, 'getApplicationOrder');
|
||||
if ($meta) {
|
||||
$core[] = $meta;
|
||||
}
|
||||
$core = mpull($core, null, 'getPHID');
|
||||
|
||||
if ($current && empty($core[$current->getPHID()])) {
|
||||
array_unshift($core, $current);
|
||||
}
|
||||
|
||||
Javelin::initBehavior('phabricator-tooltips', array());
|
||||
require_celerity_resource('aphront-tooltip-css');
|
||||
|
||||
$apps = array();
|
||||
foreach ($core as $phid => $application) {
|
||||
$classes = array();
|
||||
$classes[] = 'phabricator-nav-app-item';
|
||||
|
||||
if ($current && $phid == $current->getPHID()) {
|
||||
$selected = true;
|
||||
} else {
|
||||
$selected = false;
|
||||
}
|
||||
|
||||
$iclasses = array();
|
||||
$iclasses[] = 'phabricator-nav-app-item-icon';
|
||||
$style = null;
|
||||
if ($application->getIconURI()) {
|
||||
$style = 'background-image: url('.$application->getIconURI().'); '.
|
||||
'background-size: 30px auto;';
|
||||
} else {
|
||||
$iclasses[] = 'autosprite';
|
||||
$sprite = $application->getAutospriteName();
|
||||
if ($selected) {
|
||||
$sprite .= '-selected';
|
||||
}
|
||||
$iclasses[] = 'app-'.$sprite;
|
||||
}
|
||||
|
||||
$icon = phutil_render_tag(
|
||||
'span',
|
||||
array(
|
||||
'class' => implode(' ', $iclasses),
|
||||
'style' => $style,
|
||||
),
|
||||
'');
|
||||
|
||||
$apps[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'class' => implode(' ', $classes),
|
||||
'href' => $application->getBaseURI(),
|
||||
'sigil' => 'has-tooltip',
|
||||
'meta' => array(
|
||||
'tip' => $application->getName(),
|
||||
'align' => 'E',
|
||||
),
|
||||
),
|
||||
$icon.
|
||||
phutil_escape_html($application->getName()));
|
||||
}
|
||||
|
||||
return id(new AphrontNullView())->appendChild($apps);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user