mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +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:
parent
8c114394e3
commit
09341be10f
5 changed files with 5 additions and 48 deletions
1
resources/sql/patches/20131231.dropshortcut.sql
Normal file
1
resources/sql/patches/20131231.dropshortcut.sql
Normal file
|
@ -0,0 +1 @@
|
|||
DROP TABLE {$NAMESPACE}_repository.repository_shortcut;
|
|
@ -1835,7 +1835,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorRepositoryPushLogSearchEngine' => 'applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php',
|
||||
'PhabricatorRepositoryQuery' => 'applications/repository/query/PhabricatorRepositoryQuery.php',
|
||||
'PhabricatorRepositorySearchEngine' => 'applications/repository/query/PhabricatorRepositorySearchEngine.php',
|
||||
'PhabricatorRepositoryShortcut' => 'applications/repository/storage/PhabricatorRepositoryShortcut.php',
|
||||
'PhabricatorRepositoryStatusMessage' => 'applications/repository/storage/PhabricatorRepositoryStatusMessage.php',
|
||||
'PhabricatorRepositorySvnCommitChangeParserWorker' => 'applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php',
|
||||
'PhabricatorRepositorySvnCommitMessageParserWorker' => 'applications/repository/worker/commitmessageparser/PhabricatorRepositorySvnCommitMessageParserWorker.php',
|
||||
|
@ -4459,7 +4458,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorRepositoryPushLogSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PhabricatorRepositoryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorRepositorySearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'PhabricatorRepositoryShortcut' => 'PhabricatorRepositoryDAO',
|
||||
'PhabricatorRepositoryStatusMessage' => 'PhabricatorRepositoryDAO',
|
||||
'PhabricatorRepositorySvnCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker',
|
||||
'PhabricatorRepositorySvnCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker',
|
||||
|
|
|
@ -17,7 +17,6 @@ final class DiffusionRepositoryListController extends DiffusionController
|
|||
$request = $this->getRequest();
|
||||
$controller = id(new PhabricatorApplicationSearchController($request))
|
||||
->setQueryKey($this->queryKey)
|
||||
->setPreface($this->buildShortcuts())
|
||||
->setSearchEngine(new PhabricatorRepositorySearchEngine())
|
||||
->setNavigation($this->buildSideNavView());
|
||||
|
||||
|
@ -115,33 +114,4 @@ final class DiffusionRepositoryListController extends DiffusionController
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
|
@ -1856,6 +1856,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
|
|||
'type' => 'sql',
|
||||
'name' => $this->getPatchPath('20131227.heraldobject.sql'),
|
||||
),
|
||||
'20131231.dropshortcut.sql' => array(
|
||||
'type' => 'sql',
|
||||
'name' => $this->getPatchPath('20131231.dropshortcut.sql'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue