2011-01-24 22:18:41 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class DifferentialController extends PhabricatorController {
|
|
|
|
|
Use ApplicationSearch in Differential
Summary:
Ref T603. Ref T2625. Fixes T3241. Depends on D5451. Depends on D6346.
@wez, this changes the Differential revision list UI substantially and may generate a lot of bikeshedding / who-moved-my-cheese churn. See T3417 for context, for example. The motivations for this change are:
- The list now works on devices, like phones and tablets. This is a requirement to make the rest of Differential work on devices.
- Although ApplicationSearch intentionally presents a simpler interface initially and some options which were one click away before aren't now, it is much more powerful than the search it replaces and allows users to build, save, share, fork, edit, and customize a much wider range of queries. Users who used the old filters frequently can use Advanced Search -> Save Custom Query to create new versions of them, and of any other query. "Edit Queries.." allows users to remove and reorder queries, including builtin queries. Basically, there are like three things which have gone from "1-click" to "a few clicks", and ten trillion things which have gone from "hard/impossible" to "relatively easy".
The local screenshots look a bit iffy, but I think a lot of this is the fakenesss of my test data. If they still feel iffy in production we can tweak them until they feel good, like we did for Maniphest.
Test Plan:
{F48477}
{F48478}
Reviewers: btrahan, chad, wez
Reviewed By: btrahan
CC: aran, s
Maniphest Tasks: T603, T2625, T3241
Differential Revision: https://secure.phabricator.com/D6347
2013-07-03 15:11:07 +02:00
|
|
|
public function buildSideNavView($for_app = false) {
|
|
|
|
$viewer = $this->getRequest()->getUser();
|
2013-04-15 15:52:28 +02:00
|
|
|
|
Use ApplicationSearch in Differential
Summary:
Ref T603. Ref T2625. Fixes T3241. Depends on D5451. Depends on D6346.
@wez, this changes the Differential revision list UI substantially and may generate a lot of bikeshedding / who-moved-my-cheese churn. See T3417 for context, for example. The motivations for this change are:
- The list now works on devices, like phones and tablets. This is a requirement to make the rest of Differential work on devices.
- Although ApplicationSearch intentionally presents a simpler interface initially and some options which were one click away before aren't now, it is much more powerful than the search it replaces and allows users to build, save, share, fork, edit, and customize a much wider range of queries. Users who used the old filters frequently can use Advanced Search -> Save Custom Query to create new versions of them, and of any other query. "Edit Queries.." allows users to remove and reorder queries, including builtin queries. Basically, there are like three things which have gone from "1-click" to "a few clicks", and ten trillion things which have gone from "hard/impossible" to "relatively easy".
The local screenshots look a bit iffy, but I think a lot of this is the fakenesss of my test data. If they still feel iffy in production we can tweak them until they feel good, like we did for Maniphest.
Test Plan:
{F48477}
{F48478}
Reviewers: btrahan, chad, wez
Reviewed By: btrahan
CC: aran, s
Maniphest Tasks: T603, T2625, T3241
Differential Revision: https://secure.phabricator.com/D6347
2013-07-03 15:11:07 +02:00
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
2013-04-15 15:52:28 +02:00
|
|
|
|
Use ApplicationSearch in Differential
Summary:
Ref T603. Ref T2625. Fixes T3241. Depends on D5451. Depends on D6346.
@wez, this changes the Differential revision list UI substantially and may generate a lot of bikeshedding / who-moved-my-cheese churn. See T3417 for context, for example. The motivations for this change are:
- The list now works on devices, like phones and tablets. This is a requirement to make the rest of Differential work on devices.
- Although ApplicationSearch intentionally presents a simpler interface initially and some options which were one click away before aren't now, it is much more powerful than the search it replaces and allows users to build, save, share, fork, edit, and customize a much wider range of queries. Users who used the old filters frequently can use Advanced Search -> Save Custom Query to create new versions of them, and of any other query. "Edit Queries.." allows users to remove and reorder queries, including builtin queries. Basically, there are like three things which have gone from "1-click" to "a few clicks", and ten trillion things which have gone from "hard/impossible" to "relatively easy".
The local screenshots look a bit iffy, but I think a lot of this is the fakenesss of my test data. If they still feel iffy in production we can tweak them until they feel good, like we did for Maniphest.
Test Plan:
{F48477}
{F48478}
Reviewers: btrahan, chad, wez
Reviewed By: btrahan
CC: aran, s
Maniphest Tasks: T603, T2625, T3241
Differential Revision: https://secure.phabricator.com/D6347
2013-07-03 15:11:07 +02:00
|
|
|
id(new DifferentialRevisionSearchEngine())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->addNavigationItems($nav->getMenu());
|
2013-04-15 15:52:28 +02:00
|
|
|
|
Use ApplicationSearch in Differential
Summary:
Ref T603. Ref T2625. Fixes T3241. Depends on D5451. Depends on D6346.
@wez, this changes the Differential revision list UI substantially and may generate a lot of bikeshedding / who-moved-my-cheese churn. See T3417 for context, for example. The motivations for this change are:
- The list now works on devices, like phones and tablets. This is a requirement to make the rest of Differential work on devices.
- Although ApplicationSearch intentionally presents a simpler interface initially and some options which were one click away before aren't now, it is much more powerful than the search it replaces and allows users to build, save, share, fork, edit, and customize a much wider range of queries. Users who used the old filters frequently can use Advanced Search -> Save Custom Query to create new versions of them, and of any other query. "Edit Queries.." allows users to remove and reorder queries, including builtin queries. Basically, there are like three things which have gone from "1-click" to "a few clicks", and ten trillion things which have gone from "hard/impossible" to "relatively easy".
The local screenshots look a bit iffy, but I think a lot of this is the fakenesss of my test data. If they still feel iffy in production we can tweak them until they feel good, like we did for Maniphest.
Test Plan:
{F48477}
{F48478}
Reviewers: btrahan, chad, wez
Reviewed By: btrahan
CC: aran, s
Maniphest Tasks: T603, T2625, T3241
Differential Revision: https://secure.phabricator.com/D6347
2013-07-03 15:11:07 +02:00
|
|
|
$nav->selectFilter(null);
|
2013-04-15 15:52:28 +02:00
|
|
|
|
Use ApplicationSearch in Differential
Summary:
Ref T603. Ref T2625. Fixes T3241. Depends on D5451. Depends on D6346.
@wez, this changes the Differential revision list UI substantially and may generate a lot of bikeshedding / who-moved-my-cheese churn. See T3417 for context, for example. The motivations for this change are:
- The list now works on devices, like phones and tablets. This is a requirement to make the rest of Differential work on devices.
- Although ApplicationSearch intentionally presents a simpler interface initially and some options which were one click away before aren't now, it is much more powerful than the search it replaces and allows users to build, save, share, fork, edit, and customize a much wider range of queries. Users who used the old filters frequently can use Advanced Search -> Save Custom Query to create new versions of them, and of any other query. "Edit Queries.." allows users to remove and reorder queries, including builtin queries. Basically, there are like three things which have gone from "1-click" to "a few clicks", and ten trillion things which have gone from "hard/impossible" to "relatively easy".
The local screenshots look a bit iffy, but I think a lot of this is the fakenesss of my test data. If they still feel iffy in production we can tweak them until they feel good, like we did for Maniphest.
Test Plan:
{F48477}
{F48478}
Reviewers: btrahan, chad, wez
Reviewed By: btrahan
CC: aran, s
Maniphest Tasks: T603, T2625, T3241
Differential Revision: https://secure.phabricator.com/D6347
2013-07-03 15:11:07 +02:00
|
|
|
return $nav;
|
2013-04-15 15:52:28 +02:00
|
|
|
}
|
|
|
|
|
2015-01-15 21:41:26 +01:00
|
|
|
public function buildApplicationMenu() {
|
Use ApplicationSearch in Differential
Summary:
Ref T603. Ref T2625. Fixes T3241. Depends on D5451. Depends on D6346.
@wez, this changes the Differential revision list UI substantially and may generate a lot of bikeshedding / who-moved-my-cheese churn. See T3417 for context, for example. The motivations for this change are:
- The list now works on devices, like phones and tablets. This is a requirement to make the rest of Differential work on devices.
- Although ApplicationSearch intentionally presents a simpler interface initially and some options which were one click away before aren't now, it is much more powerful than the search it replaces and allows users to build, save, share, fork, edit, and customize a much wider range of queries. Users who used the old filters frequently can use Advanced Search -> Save Custom Query to create new versions of them, and of any other query. "Edit Queries.." allows users to remove and reorder queries, including builtin queries. Basically, there are like three things which have gone from "1-click" to "a few clicks", and ten trillion things which have gone from "hard/impossible" to "relatively easy".
The local screenshots look a bit iffy, but I think a lot of this is the fakenesss of my test data. If they still feel iffy in production we can tweak them until they feel good, like we did for Maniphest.
Test Plan:
{F48477}
{F48478}
Reviewers: btrahan, chad, wez
Reviewed By: btrahan
CC: aran, s
Maniphest Tasks: T603, T2625, T3241
Differential Revision: https://secure.phabricator.com/D6347
2013-07-03 15:11:07 +02:00
|
|
|
return $this->buildSideNavView(true)->getMenu();
|
2013-04-15 15:52:28 +02:00
|
|
|
}
|
|
|
|
|
2015-08-15 21:57:20 +02:00
|
|
|
protected function buildTableOfContents(
|
|
|
|
array $changesets,
|
|
|
|
array $visible_changesets,
|
|
|
|
array $coverage) {
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
|
|
|
|
$toc_view = id(new PHUIDiffTableOfContentsListView())
|
|
|
|
->setUser($viewer);
|
|
|
|
|
2015-08-17 19:14:22 +02:00
|
|
|
$have_owners = PhabricatorApplication::isClassInstalledForViewer(
|
|
|
|
'PhabricatorOwnersApplication',
|
|
|
|
$viewer);
|
|
|
|
if ($have_owners) {
|
|
|
|
$repository_phid = null;
|
|
|
|
if ($changesets) {
|
|
|
|
$changeset = head($changesets);
|
|
|
|
$diff = $changeset->getDiff();
|
|
|
|
$repository_phid = $diff->getRepositoryPHID();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$repository_phid) {
|
|
|
|
$have_owners = false;
|
|
|
|
} else {
|
|
|
|
if ($viewer->getPHID()) {
|
|
|
|
$packages = id(new PhabricatorOwnersPackageQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withAuthorityPHIDs(array($viewer->getPHID()))
|
|
|
|
->execute();
|
|
|
|
$toc_view->setAuthorityPackages($packages);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: For Subversion, we should adjust these paths to be relative to
|
|
|
|
// the repository root where possible.
|
|
|
|
$paths = mpull($changesets, 'getFilename');
|
|
|
|
|
|
|
|
$control_query = id(new PhabricatorOwnersPackageQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withControl($repository_phid, $paths);
|
|
|
|
$control_query->execute();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-15 21:57:20 +02:00
|
|
|
foreach ($changesets as $changeset_id => $changeset) {
|
|
|
|
$is_visible = isset($visible_changesets[$changeset_id]);
|
|
|
|
$anchor = $changeset->getAnchorName();
|
|
|
|
|
|
|
|
$filename = $changeset->getFilename();
|
|
|
|
$coverage_id = 'differential-mcoverage-'.md5($filename);
|
|
|
|
|
|
|
|
$item = id(new PHUIDiffTableOfContentsItemView())
|
|
|
|
->setChangeset($changeset)
|
|
|
|
->setIsVisible($is_visible)
|
|
|
|
->setAnchor($anchor)
|
|
|
|
->setCoverage(idx($coverage, $filename))
|
|
|
|
->setCoverageID($coverage_id);
|
|
|
|
|
2015-08-17 19:14:22 +02:00
|
|
|
if ($have_owners) {
|
|
|
|
$package = $control_query->getControllingPackageForPath(
|
|
|
|
$repository_phid,
|
|
|
|
$changeset->getFilename());
|
|
|
|
if ($package) {
|
|
|
|
$item->setPackage($package);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-15 21:57:20 +02:00
|
|
|
$toc_view->addItem($item);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $toc_view;
|
|
|
|
}
|
|
|
|
|
2011-01-24 22:18:41 +01:00
|
|
|
}
|