From eea093bec816ab748ed7caddb606255d37a51b03 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 1 Apr 2019 08:34:34 -0700 Subject: [PATCH] Combine the "View", "Arrange", and "Manage" modes of Dashboards into a single mode Summary: Depends on D20361. Ref T13272. Currently, Dashboards have three separate modes: view, arrange, manage. With the advent of Portals, I think we can simplify this, and make the dashboard view a combined view/edit/manage page. To view it in a cleaner standalone way, you can add it to a portal/home/project. I'll also improve the "Install" workflow. Test Plan: Viewed a dashboard page, clicked through all the actions, grepped for affected URIs. {F6327027} Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13272 Differential Revision: https://secure.phabricator.com/D20362 --- src/__phutil_library_map__.php | 12 +-- .../PhabricatorDashboardApplication.php | 2 - .../PhabricatorDashboardArrangeController.php | 79 ------------------- .../PhabricatorDashboardProfileController.php | 46 +---------- ...orDashboardQueryPanelInstallController.php | 2 +- .../PhabricatorDashboardViewController.php | 68 ---------------- .../PhabricatorDashboardArchiveController.php | 2 +- .../PhabricatorDashboardEditController.php | 11 +-- .../PhabricatorDashboardInstallController.php | 3 +- .../PhabricatorDashboardViewController.php} | 70 ++++++---------- .../PhabricatorDashboardSearchEngine.php | 9 +-- .../storage/PhabricatorDashboard.php | 7 +- .../PhabricatorDashboardProfileMenuItem.php | 2 +- 13 files changed, 43 insertions(+), 270 deletions(-) delete mode 100644 src/applications/dashboard/controller/PhabricatorDashboardArrangeController.php delete mode 100644 src/applications/dashboard/controller/PhabricatorDashboardViewController.php rename src/applications/dashboard/controller/{ => dashboard}/PhabricatorDashboardArchiveController.php (96%) rename src/applications/dashboard/controller/{ => dashboard}/PhabricatorDashboardEditController.php (97%) rename src/applications/dashboard/controller/{ => dashboard}/PhabricatorDashboardInstallController.php (97%) rename src/applications/dashboard/controller/{PhabricatorDashboardManageController.php => dashboard/PhabricatorDashboardViewController.php} (62%) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 7c144dbb61..5c2d13d0d5 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2905,21 +2905,19 @@ phutil_register_library_map(array( 'PhabricatorDashboard' => 'applications/dashboard/storage/PhabricatorDashboard.php', 'PhabricatorDashboardAddPanelController' => 'applications/dashboard/controller/PhabricatorDashboardAddPanelController.php', 'PhabricatorDashboardApplication' => 'applications/dashboard/application/PhabricatorDashboardApplication.php', - 'PhabricatorDashboardArchiveController' => 'applications/dashboard/controller/PhabricatorDashboardArchiveController.php', - 'PhabricatorDashboardArrangeController' => 'applications/dashboard/controller/PhabricatorDashboardArrangeController.php', + 'PhabricatorDashboardArchiveController' => 'applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php', 'PhabricatorDashboardConsoleController' => 'applications/dashboard/controller/PhabricatorDashboardConsoleController.php', 'PhabricatorDashboardController' => 'applications/dashboard/controller/PhabricatorDashboardController.php', 'PhabricatorDashboardDAO' => 'applications/dashboard/storage/PhabricatorDashboardDAO.php', 'PhabricatorDashboardDashboardHasPanelEdgeType' => 'applications/dashboard/edge/PhabricatorDashboardDashboardHasPanelEdgeType.php', 'PhabricatorDashboardDashboardPHIDType' => 'applications/dashboard/phid/PhabricatorDashboardDashboardPHIDType.php', 'PhabricatorDashboardDatasource' => 'applications/dashboard/typeahead/PhabricatorDashboardDatasource.php', - 'PhabricatorDashboardEditController' => 'applications/dashboard/controller/PhabricatorDashboardEditController.php', + 'PhabricatorDashboardEditController' => 'applications/dashboard/controller/dashboard/PhabricatorDashboardEditController.php', 'PhabricatorDashboardIconSet' => 'applications/dashboard/icon/PhabricatorDashboardIconSet.php', 'PhabricatorDashboardInstall' => 'applications/dashboard/storage/PhabricatorDashboardInstall.php', - 'PhabricatorDashboardInstallController' => 'applications/dashboard/controller/PhabricatorDashboardInstallController.php', + 'PhabricatorDashboardInstallController' => 'applications/dashboard/controller/dashboard/PhabricatorDashboardInstallController.php', 'PhabricatorDashboardLayoutConfig' => 'applications/dashboard/layoutconfig/PhabricatorDashboardLayoutConfig.php', 'PhabricatorDashboardListController' => 'applications/dashboard/controller/PhabricatorDashboardListController.php', - 'PhabricatorDashboardManageController' => 'applications/dashboard/controller/PhabricatorDashboardManageController.php', 'PhabricatorDashboardMovePanelController' => 'applications/dashboard/controller/PhabricatorDashboardMovePanelController.php', 'PhabricatorDashboardNgrams' => 'applications/dashboard/storage/PhabricatorDashboardNgrams.php', 'PhabricatorDashboardPanel' => 'applications/dashboard/storage/PhabricatorDashboardPanel.php', @@ -2981,7 +2979,7 @@ phutil_register_library_map(array( 'PhabricatorDashboardTransaction' => 'applications/dashboard/storage/PhabricatorDashboardTransaction.php', 'PhabricatorDashboardTransactionEditor' => 'applications/dashboard/editor/PhabricatorDashboardTransactionEditor.php', 'PhabricatorDashboardTransactionQuery' => 'applications/dashboard/query/PhabricatorDashboardTransactionQuery.php', - 'PhabricatorDashboardViewController' => 'applications/dashboard/controller/PhabricatorDashboardViewController.php', + 'PhabricatorDashboardViewController' => 'applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php', 'PhabricatorDataCacheSpec' => 'applications/cache/spec/PhabricatorDataCacheSpec.php', 'PhabricatorDataNotAttachedException' => 'infrastructure/storage/lisk/PhabricatorDataNotAttachedException.php', 'PhabricatorDatabaseRef' => 'infrastructure/cluster/PhabricatorDatabaseRef.php', @@ -8868,7 +8866,6 @@ phutil_register_library_map(array( 'PhabricatorDashboardAddPanelController' => 'PhabricatorDashboardController', 'PhabricatorDashboardApplication' => 'PhabricatorApplication', 'PhabricatorDashboardArchiveController' => 'PhabricatorDashboardController', - 'PhabricatorDashboardArrangeController' => 'PhabricatorDashboardProfileController', 'PhabricatorDashboardConsoleController' => 'PhabricatorDashboardController', 'PhabricatorDashboardController' => 'PhabricatorController', 'PhabricatorDashboardDAO' => 'PhabricatorLiskDAO', @@ -8881,7 +8878,6 @@ phutil_register_library_map(array( 'PhabricatorDashboardInstallController' => 'PhabricatorDashboardController', 'PhabricatorDashboardLayoutConfig' => 'Phobject', 'PhabricatorDashboardListController' => 'PhabricatorDashboardController', - 'PhabricatorDashboardManageController' => 'PhabricatorDashboardProfileController', 'PhabricatorDashboardMovePanelController' => 'PhabricatorDashboardController', 'PhabricatorDashboardNgrams' => 'PhabricatorSearchNgrams', 'PhabricatorDashboardPanel' => array( diff --git a/src/applications/dashboard/application/PhabricatorDashboardApplication.php b/src/applications/dashboard/application/PhabricatorDashboardApplication.php index 081367effa..1a594e1302 100644 --- a/src/applications/dashboard/application/PhabricatorDashboardApplication.php +++ b/src/applications/dashboard/application/PhabricatorDashboardApplication.php @@ -41,8 +41,6 @@ final class PhabricatorDashboardApplication extends PhabricatorApplication { => 'PhabricatorDashboardListController', 'view/(?P\d+)/' => 'PhabricatorDashboardViewController', 'archive/(?P\d+)/' => 'PhabricatorDashboardArchiveController', - 'manage/(?P\d+)/' => 'PhabricatorDashboardManageController', - 'arrange/(?P\d+)/' => 'PhabricatorDashboardArrangeController', 'create/' => 'PhabricatorDashboardEditController', 'edit/(?:(?P\d+)/)?' => 'PhabricatorDashboardEditController', 'install/(?:(?P\d+)/)?' => 'PhabricatorDashboardInstallController', diff --git a/src/applications/dashboard/controller/PhabricatorDashboardArrangeController.php b/src/applications/dashboard/controller/PhabricatorDashboardArrangeController.php deleted file mode 100644 index 1ef482b7f4..0000000000 --- a/src/applications/dashboard/controller/PhabricatorDashboardArrangeController.php +++ /dev/null @@ -1,79 +0,0 @@ -getViewer(); - $id = $request->getURIData('id'); - - $dashboard = id(new PhabricatorDashboardQuery()) - ->setViewer($viewer) - ->withIDs(array($id)) - ->needPanels(true) - ->executeOne(); - if (!$dashboard) { - return new Aphront404Response(); - } - $this->setDashboard($dashboard); - - $can_edit = PhabricatorPolicyFilter::hasCapability( - $viewer, - $dashboard, - PhabricatorPolicyCapability::CAN_EDIT); - - $title = $dashboard->getName(); - $crumbs = $this->buildApplicationCrumbs(); - $crumbs->addTextCrumb(pht('Arrange')); - $header = $this->buildHeaderView(); - - $info_view = null; - if (!$can_edit) { - $no_edit = pht( - 'You do not have permission to edit this dashboard.'); - - $info_view = id(new PHUIInfoView()) - ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) - ->setErrors(array($no_edit)); - } - - $rendered_dashboard = id(new PhabricatorDashboardRenderingEngine()) - ->setViewer($viewer) - ->setDashboard($dashboard) - ->setArrangeMode($can_edit) - ->renderDashboard(); - - $dashboard_box = id(new PHUIBoxView()) - ->addClass('dashboard-preview-box') - ->appendChild($rendered_dashboard); - - $install_button = id(new PHUIButtonView()) - ->setTag('a') - ->setText('Install Dashboard') - ->setIcon('fa-plus') - ->setWorkflow(true) - ->setHref($this->getApplicationURI("/install/{$id}/")); - $header->addActionLink($install_button); - - $view = id(new PHUITwoColumnView()) - ->setHeader($header) - ->setFooter(array( - $info_view, - $dashboard_box, - )); - - $navigation = $this->buildSideNavView('arrange'); - - return $this->newPage() - ->setTitle($title) - ->setCrumbs($crumbs) - ->setNavigation($navigation) - ->appendChild($view); - - } - -} diff --git a/src/applications/dashboard/controller/PhabricatorDashboardProfileController.php b/src/applications/dashboard/controller/PhabricatorDashboardProfileController.php index adc85efdf3..ec441658c2 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardProfileController.php +++ b/src/applications/dashboard/controller/PhabricatorDashboardProfileController.php @@ -14,10 +14,6 @@ abstract class PhabricatorDashboardProfileController return $this->dashboard; } - public function buildApplicationMenu() { - return $this->buildSideNavView()->getMenu(); - } - protected function buildHeaderView() { $viewer = $this->getViewer(); $dashboard = $this->getDashboard(); @@ -49,50 +45,10 @@ abstract class PhabricatorDashboardProfileController $dashboard = $this->getDashboard(); if ($dashboard) { - $id = $dashboard->getID(); - $dashboard_uri = $this->getApplicationURI("/view/{$id}/"); - $crumbs->addTextCrumb($dashboard->getName(), $dashboard_uri); + $crumbs->addTextCrumb($dashboard->getName(), $dashboard->getURI()); } return $crumbs; } - protected function buildSideNavView($filter = null) { - $viewer = $this->getViewer(); - $dashboard = $this->getDashboard(); - $id = $dashboard->getID(); - - $can_edit = PhabricatorPolicyFilter::hasCapability( - $viewer, - $dashboard, - PhabricatorPolicyCapability::CAN_EDIT); - - $nav = id(new AphrontSideNavFilterView()) - ->setBaseURI(new PhutilURI($this->getApplicationURI())); - - $nav->addLabel(pht('Dashboard')); - - $nav->addFilter( - 'view', - pht('View Dashboard'), - $this->getApplicationURI("/view/{$id}/"), - 'fa-dashboard'); - - $nav->addFilter( - 'arrange', - pht('Arrange Panels'), - $this->getApplicationURI("/arrange/{$id}/"), - 'fa-columns'); - - $nav->addFilter( - 'manage', - pht('Manage Dashboard'), - $this->getApplicationURI("/manage/{$id}/"), - 'fa-gears'); - - $nav->selectFilter($filter); - - return $nav; - } - } diff --git a/src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php b/src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php index 77068531a9..3ed0c20d70 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php +++ b/src/applications/dashboard/controller/PhabricatorDashboardQueryPanelInstallController.php @@ -75,7 +75,7 @@ final class PhabricatorDashboardQueryPanelInstallController } if (!$errors) { - $redirect_uri = "/dashboard/arrange/{$v_dashboard}/"; + $redirect_uri = "/dashboard/view/{$v_dashboard}/"; $panel_type = id(new PhabricatorDashboardQueryPanelType()) ->getPanelTypeKey(); diff --git a/src/applications/dashboard/controller/PhabricatorDashboardViewController.php b/src/applications/dashboard/controller/PhabricatorDashboardViewController.php deleted file mode 100644 index 41441f09f4..0000000000 --- a/src/applications/dashboard/controller/PhabricatorDashboardViewController.php +++ /dev/null @@ -1,68 +0,0 @@ -getViewer(); - $id = $request->getURIData('id'); - - $dashboard = id(new PhabricatorDashboardQuery()) - ->setViewer($viewer) - ->withIDs(array($id)) - ->needPanels(true) - ->executeOne(); - if (!$dashboard) { - return new Aphront404Response(); - } - $this->setDashboard($dashboard); - - $dashboard_uri = $this->getApplicationURI("view/{$id}/"); - $title = $dashboard->getName(); - $crumbs = $this->buildApplicationCrumbs(); - $crumbs->addTextCrumb(pht('View')); - - if ($dashboard->getPanelPHIDs()) { - $rendered_dashboard = id(new PhabricatorDashboardRenderingEngine()) - ->setViewer($viewer) - ->setDashboard($dashboard) - ->renderDashboard(); - $content = id(new PHUIBoxView()) - ->addClass('dashboard-preview-box') - ->appendChild($rendered_dashboard); - } else { - $content = id(new PHUIInfoView()) - ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) - ->appendChild(pht('This dashboard has no panels yet.')); - } - - $navigation = $this->buildSideNavView('view'); - $header = $this->buildHeaderView(); - - $install_button = id(new PHUIButtonView()) - ->setTag('a') - ->setText('Install Dashboard') - ->setIcon('fa-plus') - ->setColor(PHUIButtonView::GREEN) - ->setWorkflow(true) - ->setHref($this->getApplicationURI("/install/{$id}/")); - $header->addActionLink($install_button); - - $view = id(new PHUITwoColumnView()) - ->setHeader($header) - ->setFooter(array( - $content, - )); - - return $this->newPage() - ->setTitle($title) - ->setCrumbs($crumbs) - ->setNavigation($navigation) - ->appendChild($view); - } - -} diff --git a/src/applications/dashboard/controller/PhabricatorDashboardArchiveController.php b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php similarity index 96% rename from src/applications/dashboard/controller/PhabricatorDashboardArchiveController.php rename to src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php index 709e03fdf0..6e933a7e07 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardArchiveController.php +++ b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardArchiveController.php @@ -20,7 +20,7 @@ final class PhabricatorDashboardArchiveController return new Aphront404Response(); } - $view_uri = $this->getApplicationURI('manage/'.$dashboard->getID().'/'); + $view_uri = $dashboard->getURI(); if ($request->isFormPost()) { if ($dashboard->isArchived()) { diff --git a/src/applications/dashboard/controller/PhabricatorDashboardEditController.php b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardEditController.php similarity index 97% rename from src/applications/dashboard/controller/PhabricatorDashboardEditController.php rename to src/applications/dashboard/controller/dashboard/PhabricatorDashboardEditController.php index 6b3a96d80c..09e92e7590 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardEditController.php +++ b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardEditController.php @@ -55,8 +55,7 @@ final class PhabricatorDashboardEditController $crumbs->addTextCrumb(pht('Create Dashboard')); } else { - $id = $dashboard->getID(); - $cancel_uri = $this->getApplicationURI('manage/'.$id.'/'); + $cancel_uri = $dashboard->getURI(); $title = pht('Edit Dashboard: %s', $dashboard->getName()); $header_icon = 'fa-pencil'; @@ -117,9 +116,7 @@ final class PhabricatorDashboardEditController ->setContentSourceFromRequest($request) ->applyTransactions($dashboard, $xactions); - $uri = $this->getApplicationURI('arrange/'.$dashboard->getID().'/'); - - return id(new AphrontRedirectResponse())->setURI($uri); + return id(new AphrontRedirectResponse())->setURI($dashboard->getURI()); } catch (PhabricatorApplicationTransactionValidationException $ex) { $validation_exception = $ex; @@ -346,10 +343,8 @@ final class PhabricatorDashboardEditController ->setContentSourceFromRequest($request) ->applyTransactions($dashboard, $xactions); - $manage_uri = $this->getApplicationURI('arrange/'.$dashboard->getID().'/'); - return id(new AphrontRedirectResponse()) - ->setURI($manage_uri); + ->setURI($dashboard->getURI()); } private function newPanel( diff --git a/src/applications/dashboard/controller/PhabricatorDashboardInstallController.php b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardInstallController.php similarity index 97% rename from src/applications/dashboard/controller/PhabricatorDashboardInstallController.php rename to src/applications/dashboard/controller/dashboard/PhabricatorDashboardInstallController.php index 145c6f530e..5cc3e69541 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardInstallController.php +++ b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardInstallController.php @@ -15,8 +15,7 @@ final class PhabricatorDashboardInstallController return new Aphront404Response(); } - $cancel_uri = $this->getApplicationURI( - 'view/'.$dashboard->getID().'/'); + $cancel_uri = $dashboard->getURI(); $home_app = new PhabricatorHomeApplication(); diff --git a/src/applications/dashboard/controller/PhabricatorDashboardManageController.php b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php similarity index 62% rename from src/applications/dashboard/controller/PhabricatorDashboardManageController.php rename to src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php index 39a7e46841..d7dda43894 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardManageController.php +++ b/src/applications/dashboard/controller/dashboard/PhabricatorDashboardViewController.php @@ -1,6 +1,6 @@ getViewer(); $id = $request->getURIData('id'); - // TODO: This UI should drop a lot of capabilities if the user can't - // edit the dashboard, but we should still let them in for "Install" and - // "View History". - $dashboard = id(new PhabricatorDashboardQuery()) ->setViewer($viewer) ->withIDs(array($id)) @@ -31,44 +27,38 @@ final class PhabricatorDashboardManageController PhabricatorPolicyCapability::CAN_EDIT); $title = $dashboard->getName(); - $crumbs = $this->buildApplicationCrumbs(); - $crumbs->addTextCrumb(pht('Manage')); - $header = $this->buildHeaderView(); + $curtain = $this->buildCurtainView($dashboard); - $properties = $this->buildPropertyView($dashboard); $timeline = $this->buildTransactionTimeline( $dashboard, new PhabricatorDashboardTransactionQuery()); $timeline->setShouldTerminate(true); - $info_view = null; - if (!$can_edit) { - $no_edit = pht( - 'You do not have permission to edit this dashboard.'); + $rendered_dashboard = id(new PhabricatorDashboardRenderingEngine()) + ->setViewer($viewer) + ->setDashboard($dashboard) + ->setArrangeMode($can_edit) + ->renderDashboard(); - $info_view = id(new PHUIInfoView()) - ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) - ->setErrors(array($no_edit)); - } + $dashboard_box = id(new PHUIBoxView()) + ->addClass('dashboard-preview-box') + ->appendChild($rendered_dashboard); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setCurtain($curtain) - ->setMainColumn(array( - $info_view, - $properties, - $timeline, - )); - - $navigation = $this->buildSideNavView('manage'); + ->setMainColumn( + array( + $dashboard_box, + $timeline, + )); return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) - ->setNavigation($navigation) ->appendChild($view); } @@ -91,6 +81,13 @@ final class PhabricatorDashboardManageController ->setHref($this->getApplicationURI("edit/{$id}/")) ->setDisabled(!$can_edit)); + $curtain->addAction( + id(new PhabricatorActionView()) + ->setName(pht('Install Dashboard')) + ->setIcon('fa-wrench') + ->setHref($this->getApplicationURI("/install/{$id}/")) + ->setWorkflow(true)); + if ($dashboard->isArchived()) { $curtain->addAction( id(new PhabricatorActionView()) @@ -112,28 +109,5 @@ final class PhabricatorDashboardManageController return $curtain; } - private function buildPropertyView(PhabricatorDashboard $dashboard) { - $viewer = $this->getViewer(); - - $properties = id(new PHUIPropertyListView()) - ->setUser($viewer); - - $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( - $viewer, - $dashboard); - - $properties->addProperty( - pht('Editable By'), - $descriptions[PhabricatorPolicyCapability::CAN_EDIT]); - - $properties->addProperty( - pht('Panels'), - $viewer->renderHandleList($dashboard->getPanelPHIDs())); - - return id(new PHUIObjectBoxView()) - ->setHeaderText(pht('Details')) - ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) - ->addPropertyList($properties); - } } diff --git a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php index a05d1c4121..545d77da29 100644 --- a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php +++ b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php @@ -123,15 +123,14 @@ final class PhabricatorDashboardSearchEngine $handles = $viewer->loadHandles($phids); $list = id(new PHUIObjectItemListView()) - ->setUser($viewer); + ->setViewer($viewer); foreach ($dashboards as $dashboard) { - $id = $dashboard->getID(); - $item = id(new PHUIObjectItemView()) - ->setUser($viewer) + ->setViewer($viewer) + ->setObjectName($dashboard->getObjectName()) ->setHeader($dashboard->getName()) - ->setHref($this->getApplicationURI("view/{$id}/")) + ->setHref($dashboard->getURI()) ->setObject($dashboard); $bg_color = 'bg-dark'; diff --git a/src/applications/dashboard/storage/PhabricatorDashboard.php b/src/applications/dashboard/storage/PhabricatorDashboard.php index 53bc2f857d..09df91e684 100644 --- a/src/applications/dashboard/storage/PhabricatorDashboard.php +++ b/src/applications/dashboard/storage/PhabricatorDashboard.php @@ -118,10 +118,13 @@ final class PhabricatorDashboard extends PhabricatorDashboardDAO return ($this->getStatus() == self::STATUS_ARCHIVED); } - public function getViewURI() { - return '/dashboard/view/'.$this->getID().'/'; + public function getURI() { + return urisprintf('/dashboard/view/%d/', $this->getID()); } + public function getObjectName() { + return pht('Dashboard %d', $this->getID()); + } /* -( PhabricatorApplicationTransactionInterface )------------------------- */ diff --git a/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php index af913778ee..54c72281bf 100644 --- a/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php +++ b/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php @@ -153,7 +153,7 @@ final class PhabricatorDashboardProfileMenuItem $icon = $dashboard->getIcon(); $name = $this->getDisplayName($config); $is_disabled = false; - $action_uri = '/dashboard/arrange/'.$dashboard->getID().'/'; + $action_uri = $dashboard->getURI(); } } else { $icon = 'fa-ban';