2011-03-08 02:25:47 +01:00
|
|
|
<?php
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
abstract class DiffusionBrowseController extends DiffusionController {
|
2013-09-19 20:57:33 +02:00
|
|
|
|
2013-09-23 21:53:41 +02:00
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
protected function renderSearchForm($collapsed) {
|
2013-04-23 20:12:02 +02:00
|
|
|
$drequest = $this->getDiffusionRequest();
|
2014-02-01 20:48:28 +01:00
|
|
|
|
|
|
|
$forms = array();
|
2013-04-23 20:12:02 +02:00
|
|
|
$form = id(new AphrontFormView())
|
|
|
|
->setUser($this->getRequest()->getUser())
|
2013-08-26 20:53:11 +02:00
|
|
|
->setMethod('GET');
|
2013-04-23 20:12:02 +02:00
|
|
|
|
|
|
|
switch ($drequest->getRepository()->getVersionControlSystem()) {
|
|
|
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
2014-02-01 20:48:28 +01:00
|
|
|
$forms[] = id(clone $form)
|
|
|
|
->appendChild(pht('Search is not available in Subversion.'));
|
2013-04-23 20:12:02 +02:00
|
|
|
break;
|
|
|
|
default:
|
2014-02-01 20:48:28 +01:00
|
|
|
$forms[] = id(clone $form)
|
2013-04-23 20:12:02 +02:00
|
|
|
->appendChild(
|
2014-02-01 20:48:28 +01:00
|
|
|
id(new AphrontFormTextWithSubmitControl())
|
|
|
|
->setLabel(pht('File Name'))
|
|
|
|
->setSubmitLabel(pht('Search File Names'))
|
|
|
|
->setName('find')
|
|
|
|
->setValue($this->getRequest()->getStr('find')));
|
|
|
|
$forms[] = id(clone $form)
|
2013-04-23 20:12:02 +02:00
|
|
|
->appendChild(
|
2014-02-01 20:48:28 +01:00
|
|
|
id(new AphrontFormTextWithSubmitControl())
|
|
|
|
->setLabel(pht('Pattern'))
|
|
|
|
->setSubmitLabel(pht('Grep File Content'))
|
|
|
|
->setName('grep')
|
|
|
|
->setValue($this->getRequest()->getStr('grep')));
|
2013-04-23 20:12:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-05-11 17:23:19 +02:00
|
|
|
$filter = new AphrontListFilterView();
|
2014-02-01 20:48:28 +01:00
|
|
|
$filter->appendChild($forms);
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
if ($collapsed) {
|
2013-09-19 20:57:33 +02:00
|
|
|
$filter->setCollapsed(
|
|
|
|
pht('Show Search'),
|
|
|
|
pht('Hide Search'),
|
2014-02-01 20:48:28 +01:00
|
|
|
pht('Search for file names or content in this directory.'),
|
2013-09-19 20:57:33 +02:00
|
|
|
'#');
|
|
|
|
}
|
|
|
|
|
2015-05-22 17:22:25 +02:00
|
|
|
$filter = id(new PHUIBoxView())
|
|
|
|
->addClass('mlt mlb')
|
|
|
|
->appendChild($filter);
|
|
|
|
|
2013-05-11 17:23:19 +02:00
|
|
|
return $filter;
|
2013-04-23 20:12:02 +02:00
|
|
|
}
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
protected function markupText($text) {
|
2012-04-24 03:36:25 +02:00
|
|
|
$engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine();
|
2013-03-04 21:33:05 +01:00
|
|
|
$engine->setConfig('viewer', $this->getRequest()->getUser());
|
2013-02-13 23:50:15 +01:00
|
|
|
$text = $engine->markupText($text);
|
2012-04-24 03:36:25 +02:00
|
|
|
|
2013-01-18 09:32:58 +01:00
|
|
|
$text = phutil_tag(
|
2012-04-24 03:36:25 +02:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'phabricator-remarkup',
|
|
|
|
),
|
|
|
|
$text);
|
|
|
|
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
protected function buildHeaderView(DiffusionRequest $drequest) {
|
2013-09-19 20:57:33 +02:00
|
|
|
$viewer = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$header = id(new PHUIHeaderView())
|
|
|
|
->setUser($viewer)
|
2013-09-23 21:55:23 +02:00
|
|
|
->setHeader($this->renderPathLinks($drequest, $mode = 'browse'))
|
2013-09-19 20:57:33 +02:00
|
|
|
->setPolicyObject($drequest->getRepository());
|
|
|
|
|
|
|
|
return $header;
|
|
|
|
}
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
protected function buildActionView(DiffusionRequest $drequest) {
|
|
|
|
$viewer = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$view = id(new PhabricatorActionListView())
|
|
|
|
->setUser($viewer);
|
|
|
|
|
|
|
|
$history_uri = $drequest->generateURI(
|
|
|
|
array(
|
|
|
|
'action' => 'history',
|
|
|
|
));
|
|
|
|
|
|
|
|
$view->addAction(
|
|
|
|
id(new PhabricatorActionView())
|
|
|
|
->setName(pht('View History'))
|
|
|
|
->setHref($history_uri)
|
2014-05-12 19:08:32 +02:00
|
|
|
->setIcon('fa-list'));
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
|
2014-05-13 22:52:48 +02:00
|
|
|
$behind_head = $drequest->getSymbolicCommit();
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
$head_uri = $drequest->generateURI(
|
|
|
|
array(
|
|
|
|
'commit' => '',
|
|
|
|
'action' => 'browse',
|
|
|
|
));
|
|
|
|
$view->addAction(
|
|
|
|
id(new PhabricatorActionView())
|
|
|
|
->setName(pht('Jump to HEAD'))
|
|
|
|
->setHref($head_uri)
|
2014-05-12 19:08:32 +02:00
|
|
|
->setIcon('fa-home')
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
->setDisabled(!$behind_head));
|
|
|
|
|
|
|
|
return $view;
|
|
|
|
}
|
|
|
|
|
2013-10-11 16:53:56 +02:00
|
|
|
protected function buildPropertyView(
|
|
|
|
DiffusionRequest $drequest,
|
|
|
|
PhabricatorActionListView $actions) {
|
|
|
|
|
2015-08-15 22:06:10 +02:00
|
|
|
$viewer = $this->getViewer();
|
2013-09-19 20:57:33 +02:00
|
|
|
|
2013-10-11 16:53:56 +02:00
|
|
|
$view = id(new PHUIPropertyListView())
|
|
|
|
->setUser($viewer)
|
|
|
|
->setActionList($actions);
|
2013-09-19 20:57:33 +02:00
|
|
|
|
2014-05-13 22:51:45 +02:00
|
|
|
$stable_commit = $drequest->getStableCommit();
|
2013-09-19 20:57:33 +02:00
|
|
|
$callsign = $drequest->getRepository()->getCallsign();
|
|
|
|
|
|
|
|
$view->addProperty(
|
|
|
|
pht('Commit'),
|
|
|
|
phutil_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => $drequest->generateURI(
|
|
|
|
array(
|
|
|
|
'action' => 'commit',
|
|
|
|
'commit' => $stable_commit,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
$drequest->getRepository()->formatCommitName($stable_commit)));
|
|
|
|
|
2014-05-13 22:52:03 +02:00
|
|
|
if ($drequest->getSymbolicType() == 'tag') {
|
2013-11-04 21:16:53 +01:00
|
|
|
$symbolic = $drequest->getSymbolicCommit();
|
|
|
|
$view->addProperty(pht('Tag'), $symbolic);
|
2013-09-19 20:57:33 +02:00
|
|
|
|
2013-11-04 21:16:53 +01:00
|
|
|
$tags = $this->callConduitWithDiffusionRequest(
|
|
|
|
'diffusion.tagsquery',
|
|
|
|
array(
|
|
|
|
'names' => array($symbolic),
|
|
|
|
'needMessages' => true,
|
|
|
|
));
|
|
|
|
$tags = DiffusionRepositoryTag::newFromConduit($tags);
|
|
|
|
|
|
|
|
$tags = mpull($tags, null, 'getName');
|
|
|
|
$tag = idx($tags, $symbolic);
|
|
|
|
|
|
|
|
if ($tag && strlen($tag->getMessage())) {
|
2015-09-19 20:29:01 +02:00
|
|
|
$view->addSectionHeader(
|
|
|
|
pht('Tag Content'), 'fa-tag');
|
2013-11-04 21:16:53 +01:00
|
|
|
$view->addTextContent($this->markupText($tag->getMessage()));
|
|
|
|
}
|
2013-09-19 20:57:33 +02:00
|
|
|
}
|
|
|
|
|
2015-08-15 22:06:10 +02:00
|
|
|
$repository = $drequest->getRepository();
|
|
|
|
|
|
|
|
$owners = 'PhabricatorOwnersApplication';
|
|
|
|
if (PhabricatorApplication::isClassInstalled($owners)) {
|
|
|
|
$package_query = id(new PhabricatorOwnersPackageQuery())
|
|
|
|
->setViewer($viewer)
|
2015-08-18 22:36:05 +02:00
|
|
|
->withStatuses(array(PhabricatorOwnersPackage::STATUS_ACTIVE))
|
2015-08-15 22:06:10 +02:00
|
|
|
->withControl(
|
|
|
|
$repository->getPHID(),
|
|
|
|
array(
|
|
|
|
$drequest->getPath(),
|
|
|
|
));
|
|
|
|
|
|
|
|
$package_query->execute();
|
|
|
|
|
|
|
|
$packages = $package_query->getControllingPackagesForPath(
|
|
|
|
$repository->getPHID(),
|
|
|
|
$drequest->getPath());
|
|
|
|
|
|
|
|
if ($packages) {
|
|
|
|
$ownership = id(new PHUIStatusListView())
|
|
|
|
->setUser($viewer);
|
|
|
|
|
|
|
|
foreach ($packages as $package) {
|
|
|
|
$icon = 'fa-list-alt';
|
|
|
|
$color = 'grey';
|
|
|
|
|
|
|
|
$item = id(new PHUIStatusItemView())
|
|
|
|
->setIcon($icon, $color)
|
|
|
|
->setTarget($viewer->renderHandle($package->getPHID()));
|
|
|
|
|
|
|
|
$ownership->addItem($item);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$ownership = phutil_tag('em', array(), pht('None'));
|
|
|
|
}
|
|
|
|
|
|
|
|
$view->addProperty(pht('Packages'), $ownership);
|
|
|
|
}
|
|
|
|
|
2013-09-19 20:57:33 +02:00
|
|
|
return $view;
|
|
|
|
}
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
protected function buildOpenRevisions() {
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$drequest = $this->getDiffusionRequest();
|
|
|
|
$repository = $drequest->getRepository();
|
|
|
|
$path = $drequest->getPath();
|
|
|
|
|
|
|
|
$path_map = id(new DiffusionPathIDQuery(array($path)))->loadPathIDs();
|
|
|
|
$path_id = idx($path_map, $path);
|
|
|
|
if (!$path_id) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-03-25 18:21:56 +01:00
|
|
|
$recent = (PhabricatorTime::getNow() - phutil_units('30 days in seconds'));
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
$revisions = id(new DifferentialRevisionQuery())
|
|
|
|
->setViewer($user)
|
|
|
|
->withPath($repository->getID(), $path_id)
|
|
|
|
->withStatus(DifferentialRevisionQuery::STATUS_OPEN)
|
2015-03-25 18:21:56 +01:00
|
|
|
->withUpdatedEpochBetween($recent, null)
|
2015-04-12 05:16:52 +02:00
|
|
|
->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED)
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
->setLimit(10)
|
|
|
|
->needRelationships(true)
|
2014-02-19 02:57:45 +01:00
|
|
|
->needFlags(true)
|
|
|
|
->needDrafts(true)
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
->execute();
|
|
|
|
|
|
|
|
if (!$revisions) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-03-25 18:21:56 +01:00
|
|
|
$header = id(new PHUIHeaderView())
|
|
|
|
->setHeader(pht('Open Revisions'))
|
|
|
|
->setSubheader(
|
|
|
|
pht('Recently updated open revisions affecting this file.'));
|
|
|
|
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
$view = id(new DifferentialRevisionListView())
|
2015-03-25 18:21:56 +01:00
|
|
|
->setHeader($header)
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
->setRevisions($revisions)
|
2014-02-19 02:57:45 +01:00
|
|
|
->setUser($user);
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
|
|
|
|
$phids = $view->getRequiredHandlePHIDs();
|
|
|
|
$handles = $this->loadViewerHandles($phids);
|
|
|
|
$view->setHandles($handles);
|
|
|
|
|
2015-02-19 17:11:17 +01:00
|
|
|
return $view;
|
Improve organization of Diffusion browse controllers
Summary:
Currently we have this:
- DiffusionController (abstract, has some random shared browse code)
- DiffusionBrowseController (concrete, Handles routing, directories, and search)
- DiffusionBrowseFileController (concrete, handles files)
Instead, do this:
- DiffusionController (no browse-related code)
- DiffusionBrowseController (abstract, shared browse code)
- DiffusionBrowseMainController (concrete, handles routing)
- DiffusionBrowseDirectoryController (concrete, handles directories)
- DiffusionBrowseFileController (concrete, handles files)
- DiffusionBrowseSearchController (concrete, handles search)
Feels a lot cleaner.
Test Plan: Looked at directories, searches, and files.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D7045
2013-09-20 01:01:34 +02:00
|
|
|
}
|
|
|
|
|
2011-03-08 02:25:47 +01:00
|
|
|
}
|