@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Diffusion: Display associated project tags on repository main page

Summary:
In Diffusion repositories, project tags associated with the repository are only shown on the "Manage > Edit Basic Information" page. (?)

Also display them in the repositories main page, alongside the existing tags (Status, Visibility).

Note that a project tag does not line-wrap, so a long project name can move the "Pattern Search" field out of the viewport on smaller screen widths due to T16287 and `.phui-tag-view {white-space: nowrap;}`.

Closes T15526

Test Plan:
1. Create a Diffusion repository; create some project tags
2. Go to http://phorge.localhost/diffusion/36/manage/ and select "Edit Basic Information"
3. Under "Tags", add several project tags, and "Save Changes"
4. Go to http://phorge.localhost/diffusion/36/ and see the project tags displayed next to the "Active/Disabled" and "Public/All Users/Custom Policy" tags.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15526

Differential Revision: https://we.phorge.it/D26735

+16
+15
src/applications/diffusion/controller/DiffusionRepositoryController.php
··· 312 312 } 313 313 } 314 314 315 + // Display associated projects as tags in repository browsing header 316 + $project_phids = $repository->getProjectPHIDs(); 317 + if ($project_phids) { 318 + $handles = id(new PhabricatorHandleQuery()) 319 + ->setViewer($viewer) 320 + ->withPHIDs($project_phids) 321 + ->execute(); 322 + $project_handles = array_select_keys( 323 + $handles, 324 + $project_phids); 325 + foreach ($project_handles as $handle) { 326 + $header->addTag($handle->renderTag()); 327 + } 328 + } 329 + 315 330 return $header; 316 331 } 317 332
+1
src/applications/diffusion/request/DiffusionRequest.php
··· 150 150 ->setViewer($viewer) 151 151 ->withIdentifiers(array($identifier)) 152 152 ->needProfileImage(true) 153 + ->needProjectPHIDs(true) 153 154 ->needURIs(true); 154 155 155 156 if ($need_edit) {