HomePhorge

Workboard: improve the Create Task link to mention the Project slug
Concern Raised5e2b36771578

Description

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

Details

Event Timeline

dadalha raised a concern with this commit.Mar 28 2023, 22:11
dadalha subscribed.
dadalha added inline comments.
/src/applications/project/controller/PhabricatorProjectBoardViewController.php
700

This change breaks workboards for Milestones within Projects.
Steps:

  1. Create an empty Project
  2. Create an empty Milestone inside
  3. Create the Milestone's workboard

Attempting to visit the Milestone's workboard directly results in the following exception:

phorge_docker-phorge-1   | NOTICE: PHP message: [2023-03-28 14:51:41] EXCEPTION: (InvalidArgumentException) Value provided to "replaceQueryParam()" for key "tags" is NULL. Use "removeQueryParam()" to remove a query parameter. at [<arcanist>/src/parser/PhutilURI.php:341]
phorge_docker-phorge-1   | NOTICE: PHP message: arcanist(head=master, ref.master=08dfffd5caf7), phorge(head=master, ref.master=5eac69b79dbb)
phorge_docker-phorge-1   | NOTICE: PHP message:   #0 <#2> PhutilURI::replaceQueryParam(string, NULL) called at [<phorge>/src/applications/project/controller/PhabricatorProjectBoardViewController.php:700]
phorge_docker-phorge-1   | NOTICE: PHP message:   #1 <#2> PhabricatorProjectBoardViewController::buildColumnMenu(PhabricatorProject, PhabricatorProjectColumn) called at [<phorge>/src/applications/project/controller/PhabricatorProjectBoardViewController.php:181]
phorge_docker-phorge-1   | NOTICE: PHP message:   #2 <#2> PhabricatorProjectBoardViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
phorge_docker-phorge-1   | NOTICE: PHP message:   #3 phlog(InvalidArgumentException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
phorge_docker-phorge-1   | NOTICE: PHP message:   #4 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, InvalidArgumentException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
phorge_docker-phorge-1   | NOTICE: PHP message:   #5 AphrontApplicationConfiguration::handleThrowable(InvalidArgumentException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
phorge_docker-phorge-1   | NOTICE: PHP message:   #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
phorge_docker-phorge-1   | NOTICE: PHP message:   #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Not that visiting the Project's workboard, if it exists, works fine. You can even see the Sprint workboard in there.
Notably, the "Create task" for both the Project's workboard and the Milestone show exactly the same ?tags=project-slug at this point.

This commit now has outstanding concerns.Mar 28 2023, 22:11

Thank you so much.

I will try this asap.

/src/applications/project/controller/PhabricatorProjectBoardViewController.php
700

Thank you so much. The proposed fix is here:

D25103: Workboard: fix regression caused by tags= prefiller