From 5e2b3677157889104a7e540d7772a04f13164037 Mon Sep 17 00:00:00 2001 From: dylsss Date: Mon, 27 Mar 2023 08:18:32 +0200 Subject: [PATCH] Workboard: improve the Create Task link to mention the Project slug Summary: This expands a specific link in a specific menu of Workboard Columns. You may never notice this difference unless you like to open links in another tab. If you go to a Workboard, and you open its context menu, and you hover your mouse on the Create Task action, you see this URL or a similar one: http://example.com/maniphest/task/edit/form/default/ After this change, you see this URL or a similar one: http://example.com/maniphest/task/edit/form/default/?tags=test You see that the PhutilURI class was used to add the Project slug to the 'tags' query param so that users can still open the URL in a new tab and have the form prefilled with the Project Tag. Closes T15147 Test Plan: - visit a Workboard - open the context menu of a Column (the pencil icon) - see that the Create Task link has the Project slug is in the URL of its prefilled form Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15147 Differential Revision: https://we.phorge.it/D25068 --- .../controller/PhabricatorProjectBoardViewController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php index 13a75c5a73..d254936c1a 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php @@ -696,7 +696,8 @@ final class PhabricatorProjectBoardViewController $column_items[] = id(new PhabricatorActionView()) ->setIcon($spec['icon']) ->setName($spec['name']) - ->setHref($spec['uri']) + ->setHref(id(new PhutilURI($spec['uri'])) + ->replaceQueryParam('tags', $project->getPrimarySlug())) ->setDisabled($spec['disabled']) ->addSigil('column-add-task') ->setMetadata(