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

Remove repository shortcuts

Summary:
Repositories currently have a no-UI "shortcut" feature which is only used by Facebook (and I'm not sure it's even used). As implemented, this feature is policy-oblivious and kind of nonsensical. Throw it away.

I'm open to reimplementing this, but I want to see some level of interest in it before I do. The new implementation would add shortcuts to each repository, similar to how mirrors work. My original plan was to follow this up with such an implementation (it's half-implemented in my sandbox), but as I worked through it I'm not sure it's really valuable.

Test Plan: Browsed repository list, grep.

Reviewers: btrahan

Reviewed By: btrahan

CC: FacebookPOC, aran

Differential Revision: https://secure.phabricator.com/D7862
This commit is contained in:
epriestley 2014-01-02 11:59:27 -08:00
parent 8c114394e3
commit 09341be10f
5 changed files with 5 additions and 48 deletions

View file

@ -0,0 +1 @@
DROP TABLE {$NAMESPACE}_repository.repository_shortcut;

View file

@ -1835,7 +1835,6 @@ phutil_register_library_map(array(
'PhabricatorRepositoryPushLogSearchEngine' => 'applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php', 'PhabricatorRepositoryPushLogSearchEngine' => 'applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php',
'PhabricatorRepositoryQuery' => 'applications/repository/query/PhabricatorRepositoryQuery.php', 'PhabricatorRepositoryQuery' => 'applications/repository/query/PhabricatorRepositoryQuery.php',
'PhabricatorRepositorySearchEngine' => 'applications/repository/query/PhabricatorRepositorySearchEngine.php', 'PhabricatorRepositorySearchEngine' => 'applications/repository/query/PhabricatorRepositorySearchEngine.php',
'PhabricatorRepositoryShortcut' => 'applications/repository/storage/PhabricatorRepositoryShortcut.php',
'PhabricatorRepositoryStatusMessage' => 'applications/repository/storage/PhabricatorRepositoryStatusMessage.php', 'PhabricatorRepositoryStatusMessage' => 'applications/repository/storage/PhabricatorRepositoryStatusMessage.php',
'PhabricatorRepositorySvnCommitChangeParserWorker' => 'applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php', 'PhabricatorRepositorySvnCommitChangeParserWorker' => 'applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php',
'PhabricatorRepositorySvnCommitMessageParserWorker' => 'applications/repository/worker/commitmessageparser/PhabricatorRepositorySvnCommitMessageParserWorker.php', 'PhabricatorRepositorySvnCommitMessageParserWorker' => 'applications/repository/worker/commitmessageparser/PhabricatorRepositorySvnCommitMessageParserWorker.php',
@ -4459,7 +4458,6 @@ phutil_register_library_map(array(
'PhabricatorRepositoryPushLogSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorRepositoryPushLogSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorRepositoryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorRepositoryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorRepositorySearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorRepositorySearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorRepositoryShortcut' => 'PhabricatorRepositoryDAO',
'PhabricatorRepositoryStatusMessage' => 'PhabricatorRepositoryDAO', 'PhabricatorRepositoryStatusMessage' => 'PhabricatorRepositoryDAO',
'PhabricatorRepositorySvnCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker', 'PhabricatorRepositorySvnCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker',
'PhabricatorRepositorySvnCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker', 'PhabricatorRepositorySvnCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker',

View file

@ -17,7 +17,6 @@ final class DiffusionRepositoryListController extends DiffusionController
$request = $this->getRequest(); $request = $this->getRequest();
$controller = id(new PhabricatorApplicationSearchController($request)) $controller = id(new PhabricatorApplicationSearchController($request))
->setQueryKey($this->queryKey) ->setQueryKey($this->queryKey)
->setPreface($this->buildShortcuts())
->setSearchEngine(new PhabricatorRepositorySearchEngine()) ->setSearchEngine(new PhabricatorRepositorySearchEngine())
->setNavigation($this->buildSideNavView()); ->setNavigation($this->buildSideNavView());
@ -115,33 +114,4 @@ final class DiffusionRepositoryListController extends DiffusionController
return $crumbs; return $crumbs;
} }
private function buildShortcuts() {
$shortcuts = id(new PhabricatorRepositoryShortcut())->loadAll();
if ($shortcuts) {
$shortcuts = msort($shortcuts, 'getSequence');
$rows = array();
foreach ($shortcuts as $shortcut) {
$rows[] = array(
$shortcut->getName(),
$shortcut->getHref(),
$shortcut->getDescription(),
);
}
$list = new PHUIObjectItemListView();
foreach ($rows as $row) {
$item = id(new PHUIObjectItemView())
->setHeader($row[0])
->setHref($row[1])
->setSubhead(($row[2] ? $row[2] : pht('No Description')));
$list->addItem($item);
}
$shortcut_panel = array($list, phutil_tag('hr'));
} else {
$shortcut_panel = null;
}
return $shortcut_panel;
}
} }

View file

@ -1,16 +0,0 @@
<?php
final class PhabricatorRepositoryShortcut extends PhabricatorRepositoryDAO {
protected $name;
protected $href;
protected $description;
protected $sequence;
public function getConfiguration() {
return array(
self::CONFIG_TIMESTAMPS => false,
) + parent::getConfiguration();
}
}

View file

@ -1856,6 +1856,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
'type' => 'sql', 'type' => 'sql',
'name' => $this->getPatchPath('20131227.heraldobject.sql'), 'name' => $this->getPatchPath('20131227.heraldobject.sql'),
), ),
'20131231.dropshortcut.sql' => array(
'type' => 'sql',
'name' => $this->getPatchPath('20131231.dropshortcut.sql'),
),
); );
} }
} }