问题
I am trying to display the value of a custom field, already configured in Phabricator, on the task tile view in the Backlog workboard page.
I've been going through the documentation, and have found two suggestions for how to approach this - create a new library and import it with the 'load-libraries' option in the admin GUI. Or, create a php class in the src/extensions folder.
However, all the classes I want to extend are marked as 'final', so now I don't know how to customise e.g. ProjectBoardTaskCard::getItem() so that it fetches the additional property(ies) from the defined custom fields.
回答1:
OK, this is possible!
We wanted a custom field 'points' to display (as in Agile story points) on each of the tiles in the workboard view, not just the task details page.
I downloaded this and extracted it along side phabricator (so I had /path/to/phabricator and /path/to/Sprint directories)
Then I edited the phabricator/conf/local/local.json
...
"load-libraries": [
"Sprint/src"
]
...
Whilst we had a custom field defined in our config, this plugin provided it's own Points field, making ours redundant.
after cleaning up the config, and running arc liberate src/ in the Sprint folder for good measure (it has a composer file but we didn't need use it) then it just became a simple matter of updating the properties of the projects to get this working.
(you can see what the points on task boards look like at https://phab08.wmflabs.org/tag/sprint/ - and the burndown chart that comes with at https://phabricator.wikimedia.org/sprint/view/938/ if you signup for an account)
You need to enable the checkbox for isSprint in the project, save, then edit the project again to enable a start / end date for the sprint. Then your story points, burndown charts, list of sprint projects etc will begin to work
Even if you don't want 'sprint', this code has figured out how to pull the custom fields and display it in the workboards, as per the original problem, so I expect it would make a great starting point for someone!
The code available at https://github.com/wikimedia/phabricator-extensions-Sprint
来源:https://stackoverflow.com/questions/28482015/how-to-modify-values-show-in-phabricator-task-tile-in-backlog-workflow-mode