Page MenuHomePhorge

Add (Advanced) Custom Fields to Item List
Needs ReviewPublic

Authored by avivey on Mar 1 2024, 11:03.
Tags
None
Referenced Files
F2166503: D25548.id1734.diff
Sat, Apr 27, 03:32
F2166086: D25548.diff
Fri, Apr 26, 20:09
F2165587: List with no repo.png
Fri, Apr 26, 09:51
Unknown Object (File)
Wed, Apr 17, 18:25
Unknown Object (File)
Wed, Apr 17, 07:05
Unknown Object (File)
Sun, Apr 14, 00:26
Unknown Object (File)
Mon, Apr 8, 22:15
Unknown Object (File)
Mon, Apr 8, 01:56

Details

Summary

Allow PHP-coded Custom Fields to show things in Lists.

Also add Repository to Revision List and Flags to Maniphest lists.

Closes T15133. Ref T15512, T15750

Test Plan

Look at Repository List and Task lists that have flags.

Diff Detail

Repository
rP Phorge
Branch
customfield-list
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/search/engine/PhabricatorApplicationSearchEngine.php:1647XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 1088
Build 1088: arc lint + arc unit

Event Timeline

avivey held this revision as a draft.
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
396–412

Moving this here is a small improvement, but in reality the "$handles" array used
in this flow is inferior to just using $viewer->renderHandle(), and
should be replace with that.

Before this change, we'd actually load all the labels twice using the old, uncached mechanism.

avivey published this revision for review.Mar 1 2024, 11:39
aklapper subscribed.

IIUC this adds Flags in Differential, Maniphest, etc list views, and adds the repository in Differential list view?

Functionality wise this looks great and works as expected for me:

Screenshot from 2024-04-01 19-27-51.png (970×948 px, 98 KB)

Screenshot from 2024-04-01 19-25-22.png (526×948 px, 107 KB)

Use Results > Export Data > CSV in both Differential and Maniphest query result lists does not include a repository column (that is fine) and is still valid CSV.

Wondering if rendered flags should be links to http://phorge.localhost/flag/ but that would be a separate request anyway.

Giving a +1 on personal capacity; I don't really feel knowledgeable enough to give a +1 as O1 (yet).

(Flags only show up in Maniphest on this one; I'll add them to more apps in a layer diff)

I'm shocked to see the flag on the revisions list. Turns out it's already a thing (on master!). Did not know about it, I'll have to look for it in the code.

Thanks!

Traced the Flags in Revision back to its origin in https://secure.phabricator.com/T1557. I knew about this one - but I was 100% sure that the feature was lost when the SearchEngine classes were introduced.

I see "Unknown object" if the Diff repository is unset. Is that known?

List with no repo.png (191×478 px, 17 KB)

To reproduce, go to a Diff, and manually unset the repo.

src/applications/differential/customfield/DifferentialRepositoryField.php
72

Probably this should be wrapped in if ($this->getValue()) {