Ref T4863. Add project tags to workboard cards.
Details
- Reviewers
joshuaspence epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T4863: Allow Workboard Cards to be customized for display
- Commits
- Restricted Diffusion Commit
rP080d838c693b: Add project tags to workboard cards
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
This is inefficient because it does fetches per-card. If you load a board with a large number of cards that have projects, I expect you'll see roughly one query per unique project.
The simplest fix is probably to let PHUIHandleTagListView take a PhabricatorHandleList instead of only array $handles (it's generally sufficient to just remove the array typehint).
You can't unset() a handle list, so the new logic would look like:
$project_phids = array_fuse($task->getProjectPHIDs()); unset($project_phids[$this->project->getPHID()]); $handle_list = $viewer->loadHandles($project_phids); ...
That should bulk-fetch all the handles at render time in a single query.
src/applications/project/view/ProjectBoardTaskCard.php | ||
---|---|---|
87 | Specifically, this will issue a query. |
I have this roughly working, but get a 500 whenever I edit a task. I think I need to attach Projects somewhere, but can't trace the query.
6 phabricator applications/maniphest/storage/ManiphestTask.php : 157 PhabricatorLiskDAO::assertAttached() 5 phabricator applications/project/view/ProjectBoardTaskCard.php : 86 ManiphestTask::getProjectPHIDs() 4 phabricator applications/project/controller/PhabricatorProjectMoveController.php : 158 ProjectBoardTaskCard::getItem() 3 phabricator aphront/configuration/AphrontApplicationConfiguration.php : 237 PhabricatorProjectMoveController::handleRequest() 2 phabricator aphront/configuration/AphrontApplicationConfiguration.php : 149 AphrontApplicationConfiguration::processRequest() 1 /Users/familyroom/Sites/phabricator/webroot/index.php : 17 AphrontApplicationConfiguration::runHTTPRequest()
Ok, I think this requires slight modification to EditEngine and not positive how to proceed. But I annotated the issue.
src/applications/phid/view/PHUIHandleTagListView.php | ||
---|---|---|
42 | could this go up a level to AphrontTagView? |
src/applications/maniphest/editor/ManiphestEditEngine.php | ||
---|---|---|
335–337 | I think the fix is just: ->setProject($column->getProject()) Basically, we can sort of cheat here since we have the $column, and each $column is associated with a project, so we can figure out which project the user must be looking at by figuring out which project the column belongs to. | |
src/applications/phid/view/PHUIHandleTagListView.php | ||
42 | Yeah, I think that's reasonable. |
src/applications/project/controller/PhabricatorProjectMoveController.php | ||
---|---|---|
29 | This change seemed correct to me, but unclear why ObjectQuery was used to begin with? |
src/applications/project/controller/PhabricatorProjectMoveController.php | ||
---|---|---|
29 | The code currently tries to be generic when possible to make possibly putting other types of objects (mocks, events, whatever) on workboards some day easier, but it's fine to just hard-code this to tasks for now. |
Surprisingly not terrible and somewhat useful with bugs and features. "Personal" projects (companies) might get old though.