Commit 2868a69f authored by epriestley's avatar epriestley
Browse files

Remove all setObjectURI() from ActionListViews

Summary:
Ref T10004. After D14804, we get this behavior by default and no longer need to set it explicitly.

(If some endpoint did eventually need to set it explicitly, it could just change what it passes to `setHref()`, but I believe we currently have no such endpoints and do not foresee ever having any.)

Test Plan:
  - As a logged out user, clicked various links in Differential, Maniphest, Files, etc., always got redirected to a sensible place after login.
  - Grepped for `setObjectURI()`, `getObjectURI()` (there are a few remaining callsites, but to a different method with the same name in Doorkeeper).

Reviewers: chad

Reviewed By: chad

Subscribers: hach-que

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14805
parent e869e7df
......@@ -152,7 +152,6 @@ final class PhabricatorCalendarEventViewController
$is_attending = $event->getIsUserAttending($viewer->getPHID());
$actions = id(new PhabricatorActionListView())
->setObjectURI($this->getApplicationURI('event/'.$id.'/'))
->setUser($viewer)
->setObject($event);
......
......@@ -99,7 +99,6 @@ final class PhabricatorDashboardManageController
$id = $dashboard->getID();
$actions = id(new PhabricatorActionListView())
->setObjectURI($this->getApplicationURI('view/'.$dashboard->getID().'/'))
->setObject($dashboard)
->setUser($viewer);
......
......@@ -84,7 +84,6 @@ final class PhabricatorDashboardPanelViewController
$id = $panel->getID();
$actions = id(new PhabricatorActionListView())
->setObjectURI('/'.$panel->getMonogram())
->setObject($panel)
->setUser($viewer);
......
......@@ -63,8 +63,7 @@ final class DifferentialRevisionDetailView extends AphrontView {
$actions = id(new PhabricatorActionListView())
->setUser($user)
->setObject($revision)
->setObjectURI($this->getURI());
->setObject($revision);
foreach ($this->getActions() as $action) {
$actions->addAction($action);
}
......
......@@ -903,8 +903,7 @@ final class DiffusionCommitController extends DiffusionController {
$actions = id(new PhabricatorActionListView())
->setUser($user)
->setObject($commit)
->setObjectURI($request->getRequestURI());
->setObject($commit);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$user,
......
......@@ -480,13 +480,11 @@ final class DiffusionRepositoryController extends DiffusionController {
private function buildActionList(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser();
$view_uri = $this->getApplicationURI($repository->getCallsign().'/');
$edit_uri = $this->getApplicationURI($repository->getCallsign().'/edit/');
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($repository)
->setObjectURI($view_uri);
->setObject($repository);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
......
......@@ -224,7 +224,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -327,7 +326,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -364,7 +362,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -419,7 +416,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -469,7 +465,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -509,7 +504,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -551,7 +545,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -592,7 +585,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -640,7 +632,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getViewer();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -678,7 +669,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getViewer();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......@@ -732,7 +722,6 @@ final class DiffusionRepositoryEditMainController
$user = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($user);
$edit = id(new PhabricatorActionView())
......@@ -1240,7 +1229,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$mirror_actions = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$new_mirror_uri = $this->getRepositoryControllerURI(
......@@ -1319,7 +1307,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer);
$edit = id(new PhabricatorActionView())
......
......@@ -125,8 +125,7 @@ final class DivinerBookController extends DivinerController {
$action_view = id(new PhabricatorActionListView())
->setUser($user)
->setObject($book)
->setObjectURI($this->getRequest()->getRequestURI());
->setObject($book);
$action_view->addAction(
id(new PhabricatorActionView())
......
......@@ -67,7 +67,6 @@ final class DrydockAuthorizationViewController
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($authorization);
$can_edit = PhabricatorPolicyFilter::hasCapability(
......
......@@ -86,7 +86,6 @@ final class DrydockBlueprintViewController extends DrydockBlueprintController {
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($blueprint);
$edit_uri = $this->getApplicationURI("blueprint/edit/{$id}/");
......
......@@ -66,7 +66,6 @@ final class DrydockLeaseViewController extends DrydockLeaseController {
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($lease);
$id = $lease->getID();
......
......@@ -68,7 +68,6 @@ final class DrydockRepositoryOperationViewController
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($operation);
return $view;
......
......@@ -74,7 +74,6 @@ final class DrydockResourceViewController extends DrydockResourceController {
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($resource);
$can_release = $resource->canRelease();
......
......@@ -120,7 +120,6 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($file);
$can_download = !$file->getIsPartial();
......
......@@ -445,8 +445,7 @@ final class HarbormasterBuildViewController
$list = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($build)
->setObjectURI("/build/{$id}");
->setObject($build);
$can_restart = $build->canRestartBuild();
$can_pause = $build->canPauseBuild();
......
......@@ -74,8 +74,7 @@ final class HarbormasterBuildableViewController
$list = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($buildable)
->setObjectURI($buildable->getMonogram());
->setObject($buildable);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
......
......@@ -221,8 +221,7 @@ final class HarbormasterPlanViewController extends HarbormasterPlanController {
$list = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($plan)
->setObjectURI($this->getApplicationURI("plan/{$id}/"));
->setObject($plan);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
......
......@@ -67,8 +67,7 @@ final class HeraldRuleViewController extends HeraldController {
$view = id(new PhabricatorActionListView())
->setUser($viewer)
->setObject($rule)
->setObjectURI('/'.$rule->getMonogram());
->setObject($rule);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
......
......@@ -98,7 +98,6 @@ final class LegalpadDocumentManageController extends LegalpadController {
$actions = id(new PhabricatorActionListView())
->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($document);
$can_edit = PhabricatorPolicyFilter::hasCapability(
......
......@@ -104,7 +104,6 @@ final class PhabricatorMacroViewController
$view = id(new PhabricatorActionListView())
->setUser($request->getUser())
->setObject($macro)
->setObjectURI($request->getRequestURI())
->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Macro'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment