mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +01:00
Remove dedicated "Jump Nav" navigation element
Summary: Fixes T5175. Not sure if I cleaned out everything, but this seemed like a reasonable first pass. Attempted to delete all code that belonged to Jump Nav feature only. Test Plan: Open phabricator homepage, verify Jump Nav element is gone, verify the Search bar still autocompletes and jumps to shortcuts. Reviewers: chad, epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T5175 Differential Revision: https://secure.phabricator.com/D9301
This commit is contained in:
parent
b93c2f6852
commit
607f4bfab8
4 changed files with 40 additions and 165 deletions
|
@ -7,7 +7,7 @@
|
||||||
return array(
|
return array(
|
||||||
'names' =>
|
'names' =>
|
||||||
array(
|
array(
|
||||||
'core.pkg.css' => '0d0b7e0c',
|
'core.pkg.css' => 'c404fb89',
|
||||||
'core.pkg.js' => '7db41c19',
|
'core.pkg.js' => '7db41c19',
|
||||||
'darkconsole.pkg.js' => 'ca8671ce',
|
'darkconsole.pkg.js' => 'ca8671ce',
|
||||||
'differential.pkg.css' => 'fbf57382',
|
'differential.pkg.css' => 'fbf57382',
|
||||||
|
@ -64,7 +64,6 @@ return array(
|
||||||
'rsrc/css/application/diffusion/commit-view.css' => '92d1e8f9',
|
'rsrc/css/application/diffusion/commit-view.css' => '92d1e8f9',
|
||||||
'rsrc/css/application/diffusion/diffusion-icons.css' => '384a0f7d',
|
'rsrc/css/application/diffusion/diffusion-icons.css' => '384a0f7d',
|
||||||
'rsrc/css/application/diffusion/diffusion-source.css' => '66fdf661',
|
'rsrc/css/application/diffusion/diffusion-source.css' => '66fdf661',
|
||||||
'rsrc/css/application/directory/phabricator-jump-nav.css' => 'f0c5e726',
|
|
||||||
'rsrc/css/application/feed/feed.css' => 'dd43ce00',
|
'rsrc/css/application/feed/feed.css' => 'dd43ce00',
|
||||||
'rsrc/css/application/files/global-drag-and-drop.css' => '697324ad',
|
'rsrc/css/application/files/global-drag-and-drop.css' => '697324ad',
|
||||||
'rsrc/css/application/flag/flag.css' => '5337623f',
|
'rsrc/css/application/flag/flag.css' => '5337623f',
|
||||||
|
@ -707,7 +706,6 @@ return array(
|
||||||
'phabricator-flag-css' => '5337623f',
|
'phabricator-flag-css' => '5337623f',
|
||||||
'phabricator-hovercard' => '4f344388',
|
'phabricator-hovercard' => '4f344388',
|
||||||
'phabricator-hovercard-view-css' => '46a13cf0',
|
'phabricator-hovercard-view-css' => '46a13cf0',
|
||||||
'phabricator-jump-nav' => 'f0c5e726',
|
|
||||||
'phabricator-keyboard-shortcut' => '1ae869f2',
|
'phabricator-keyboard-shortcut' => '1ae869f2',
|
||||||
'phabricator-keyboard-shortcut-manager' => 'ad7a69ca',
|
'phabricator-keyboard-shortcut-manager' => 'ad7a69ca',
|
||||||
'phabricator-main-menu-view' => '0207239c',
|
'phabricator-main-menu-view' => '0207239c',
|
||||||
|
@ -2114,46 +2112,45 @@ return array(
|
||||||
8 => 'aphront-tokenizer-control-css',
|
8 => 'aphront-tokenizer-control-css',
|
||||||
9 => 'aphront-typeahead-control-css',
|
9 => 'aphront-typeahead-control-css',
|
||||||
10 => 'aphront-list-filter-view-css',
|
10 => 'aphront-list-filter-view-css',
|
||||||
11 => 'phabricator-jump-nav',
|
11 => 'phabricator-remarkup-css',
|
||||||
12 => 'phabricator-remarkup-css',
|
12 => 'syntax-highlighting-css',
|
||||||
13 => 'syntax-highlighting-css',
|
13 => 'aphront-pager-view-css',
|
||||||
14 => 'aphront-pager-view-css',
|
14 => 'phabricator-transaction-view-css',
|
||||||
15 => 'phabricator-transaction-view-css',
|
15 => 'aphront-tooltip-css',
|
||||||
16 => 'aphront-tooltip-css',
|
16 => 'phabricator-flag-css',
|
||||||
17 => 'phabricator-flag-css',
|
17 => 'aphront-error-view-css',
|
||||||
18 => 'aphront-error-view-css',
|
18 => 'sprite-remarkup-css',
|
||||||
19 => 'sprite-remarkup-css',
|
19 => 'sprite-gradient-css',
|
||||||
20 => 'sprite-gradient-css',
|
20 => 'sprite-menu-css',
|
||||||
21 => 'sprite-menu-css',
|
21 => 'sprite-apps-large-css',
|
||||||
22 => 'sprite-apps-large-css',
|
22 => 'phabricator-main-menu-view',
|
||||||
23 => 'phabricator-main-menu-view',
|
23 => 'phabricator-notification-css',
|
||||||
24 => 'phabricator-notification-css',
|
24 => 'phabricator-notification-menu-css',
|
||||||
25 => 'phabricator-notification-menu-css',
|
25 => 'lightbox-attachment-css',
|
||||||
26 => 'lightbox-attachment-css',
|
26 => 'phui-header-view-css',
|
||||||
27 => 'phui-header-view-css',
|
27 => 'phabricator-filetree-view-css',
|
||||||
28 => 'phabricator-filetree-view-css',
|
28 => 'phabricator-nav-view-css',
|
||||||
29 => 'phabricator-nav-view-css',
|
29 => 'phabricator-side-menu-view-css',
|
||||||
30 => 'phabricator-side-menu-view-css',
|
30 => 'phabricator-crumbs-view-css',
|
||||||
31 => 'phabricator-crumbs-view-css',
|
31 => 'phui-object-item-list-view-css',
|
||||||
32 => 'phui-object-item-list-view-css',
|
32 => 'global-drag-and-drop-css',
|
||||||
33 => 'global-drag-and-drop-css',
|
33 => 'phui-spacing-css',
|
||||||
34 => 'phui-spacing-css',
|
34 => 'phui-form-css',
|
||||||
35 => 'phui-form-css',
|
35 => 'phui-icon-view-css',
|
||||||
36 => 'phui-icon-view-css',
|
36 => 'phabricator-application-launch-view-css',
|
||||||
37 => 'phabricator-application-launch-view-css',
|
37 => 'phabricator-action-list-view-css',
|
||||||
38 => 'phabricator-action-list-view-css',
|
38 => 'phui-property-list-view-css',
|
||||||
39 => 'phui-property-list-view-css',
|
39 => 'phui-tag-view-css',
|
||||||
40 => 'phui-tag-view-css',
|
40 => 'phui-list-view-css',
|
||||||
41 => 'phui-list-view-css',
|
41 => 'font-fontawesome',
|
||||||
42 => 'font-fontawesome',
|
42 => 'phui-font-icon-base-css',
|
||||||
43 => 'phui-font-icon-base-css',
|
43 => 'sprite-main-header-css',
|
||||||
44 => 'sprite-main-header-css',
|
44 => 'phui-box-css',
|
||||||
45 => 'phui-box-css',
|
45 => 'phui-object-box-css',
|
||||||
46 => 'phui-object-box-css',
|
46 => 'phui-timeline-view-css',
|
||||||
47 => 'phui-timeline-view-css',
|
47 => 'sprite-tokens-css',
|
||||||
48 => 'sprite-tokens-css',
|
48 => 'tokens-css',
|
||||||
49 => 'tokens-css',
|
49 => 'phui-status-list-view-css',
|
||||||
50 => 'phui-status-list-view-css',
|
|
||||||
),
|
),
|
||||||
'core.pkg.js' =>
|
'core.pkg.js' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -83,8 +83,6 @@ return array(
|
||||||
'aphront-typeahead-control-css',
|
'aphront-typeahead-control-css',
|
||||||
'aphront-list-filter-view-css',
|
'aphront-list-filter-view-css',
|
||||||
|
|
||||||
'phabricator-jump-nav',
|
|
||||||
|
|
||||||
'phabricator-remarkup-css',
|
'phabricator-remarkup-css',
|
||||||
'syntax-highlighting-css',
|
'syntax-highlighting-css',
|
||||||
'aphront-pager-view-css',
|
'aphront-pager-view-css',
|
||||||
|
|
|
@ -16,10 +16,6 @@ final class PhabricatorHomeMainController
|
||||||
|
|
||||||
public function processRequest() {
|
public function processRequest() {
|
||||||
$user = $this->getRequest()->getUser();
|
$user = $this->getRequest()->getUser();
|
||||||
|
|
||||||
if ($this->filter == 'jump') {
|
|
||||||
return $this->buildJumpResponse();
|
|
||||||
}
|
|
||||||
$nav = $this->buildNav();
|
$nav = $this->buildNav();
|
||||||
|
|
||||||
$dashboard = PhabricatorDashboardInstall::getDashboard(
|
$dashboard = PhabricatorDashboardInstall::getDashboard(
|
||||||
|
@ -92,8 +88,6 @@ final class PhabricatorHomeMainController
|
||||||
$welcome_panel = null;
|
$welcome_panel = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$jump_panel = $this->buildJumpPanel();
|
|
||||||
|
|
||||||
if ($has_differential) {
|
if ($has_differential) {
|
||||||
$revision_panel = $this->buildRevisionPanel();
|
$revision_panel = $this->buildRevisionPanel();
|
||||||
} else {
|
} else {
|
||||||
|
@ -101,7 +95,6 @@ final class PhabricatorHomeMainController
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = array(
|
$content = array(
|
||||||
$jump_panel,
|
|
||||||
$welcome_panel,
|
$welcome_panel,
|
||||||
$unbreak_panel,
|
$unbreak_panel,
|
||||||
$triage_panel,
|
$triage_panel,
|
||||||
|
@ -118,27 +111,6 @@ final class PhabricatorHomeMainController
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildJumpResponse() {
|
|
||||||
$request = $this->getRequest();
|
|
||||||
$jump = $request->getStr('jump');
|
|
||||||
|
|
||||||
$response = PhabricatorJumpNavHandler::getJumpResponse(
|
|
||||||
$request->getUser(),
|
|
||||||
$jump);
|
|
||||||
|
|
||||||
if ($response) {
|
|
||||||
return $response;
|
|
||||||
} else if ($request->isFormPost()) {
|
|
||||||
$uri = new PhutilURI('/search/');
|
|
||||||
$uri->setQueryParam('query', $jump);
|
|
||||||
$uri->setQueryParam('search:primary', 'true');
|
|
||||||
|
|
||||||
return id(new AphrontRedirectResponse())->setURI((string)$uri);
|
|
||||||
} else {
|
|
||||||
return id(new AphrontRedirectResponse())->setURI('/');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function buildUnbreakNowPanel() {
|
private function buildUnbreakNowPanel() {
|
||||||
$unbreak_now = PhabricatorEnv::getEnvConfig(
|
$unbreak_now = PhabricatorEnv::getEnvConfig(
|
||||||
'maniphest.priorities.unbreak-now');
|
'maniphest.priorities.unbreak-now');
|
||||||
|
@ -330,73 +302,6 @@ final class PhabricatorHomeMainController
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildJumpPanel($query=null) {
|
|
||||||
$request = $this->getRequest();
|
|
||||||
$user = $request->getUser();
|
|
||||||
|
|
||||||
$uniq_id = celerity_generate_unique_node_id();
|
|
||||||
|
|
||||||
Javelin::initBehavior(
|
|
||||||
'phabricator-autofocus',
|
|
||||||
array(
|
|
||||||
'id' => $uniq_id,
|
|
||||||
));
|
|
||||||
|
|
||||||
require_celerity_resource('phabricator-jump-nav');
|
|
||||||
|
|
||||||
$doc_href = PhabricatorEnv::getDocLink('Jump Nav User Guide');
|
|
||||||
$doc_link = phutil_tag(
|
|
||||||
'a',
|
|
||||||
array(
|
|
||||||
'href' => $doc_href,
|
|
||||||
),
|
|
||||||
'Jump Nav User Guide');
|
|
||||||
|
|
||||||
$jump_input = phutil_tag(
|
|
||||||
'input',
|
|
||||||
array(
|
|
||||||
'type' => 'text',
|
|
||||||
'class' => 'phabricator-jump-nav',
|
|
||||||
'name' => 'jump',
|
|
||||||
'id' => $uniq_id,
|
|
||||||
'value' => $query,
|
|
||||||
));
|
|
||||||
$jump_caption = phutil_tag(
|
|
||||||
'p',
|
|
||||||
array(
|
|
||||||
'class' => 'phabricator-jump-nav-caption',
|
|
||||||
),
|
|
||||||
hsprintf(
|
|
||||||
'Enter the name of an object like <tt>D123</tt> to quickly jump to '.
|
|
||||||
'it. See %s or type <tt>help</tt>.',
|
|
||||||
$doc_link));
|
|
||||||
|
|
||||||
$form = phabricator_form(
|
|
||||||
$user,
|
|
||||||
array(
|
|
||||||
'action' => '/jump/',
|
|
||||||
'method' => 'POST',
|
|
||||||
'class' => 'phabricator-jump-nav-form',
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
$jump_input,
|
|
||||||
$jump_caption,
|
|
||||||
));
|
|
||||||
|
|
||||||
$panel = new AphrontPanelView();
|
|
||||||
$panel->setNoBackground();
|
|
||||||
// $panel->appendChild();
|
|
||||||
|
|
||||||
$list_filter = new AphrontListFilterView();
|
|
||||||
$list_filter->appendChild($form);
|
|
||||||
|
|
||||||
$container = phutil_tag('div',
|
|
||||||
array('class' => 'phabricator-jump-nav-container'),
|
|
||||||
$list_filter);
|
|
||||||
|
|
||||||
return $container;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function renderSectionHeader($title, $href) {
|
private function renderSectionHeader($title, $href) {
|
||||||
$header = phutil_tag(
|
$header = phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
/**
|
|
||||||
* @provides phabricator-jump-nav
|
|
||||||
*/
|
|
||||||
|
|
||||||
.phabricator-jump-nav-form {
|
|
||||||
text-align: center;
|
|
||||||
padding: 0px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
input.phabricator-jump-nav[type='text'] {
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phabricator-jump-nav-caption {
|
|
||||||
margin-top: 4px;
|
|
||||||
font-size: 11px;
|
|
||||||
color: {$greytext};
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phabricator-jump-nav-container form {
|
|
||||||
padding: 12px 16px;
|
|
||||||
}
|
|
Loading…
Reference in a new issue