1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-23 05:01:13 +01:00
phorge-phorge/src/applications/badges/controller
epriestley 6c43d1d52c Remove "willRenderTimeline()" from ApplicationTransactionInterface
Summary:
Depends on D19914. Ref T11351. Some of the Phoilo rabbit holes go very deep.

`PhabricatorApplicationTransactionInterface` currently requires you to implement `willRenderTimeline()`. Almost every object just implements this as `return $timeline`; only Pholio, Diffusion, and Differential specialize it. In all cases, they are specializing it mostly to render inline comments.

The actual implementations are a bit of a weird mess and the way the data is threaded through the call stack is weird and not very modern.

Try to clean this up:

  - Stop requiring `willRenderTimeline()` to be implemented.
  - Stop requiring `getApplicationTransactionViewObject()` to be implemented (only the three above, plus Legalpad, implement this, and Legalpad's implementation is a no-op). These two methods are inherently pretty coupled for almost any reasonable thing you might want to do with the timeline.
  - Simplify the handling of "renderdata" and call it "View Data". This is additional information about the current view of the transaction timeline that is required to render it correctly. This is only used in Differential, to decide if we can link an inline comment to an anchor on the same page or should link it to another page. We could perhaps do this on the client instead, but having this data doesn't seem inherently bad to me.
  - If objects want to customize timeline rendering, they now implement `PhabricatorTimelineInterface` and provide a `TimelineEngine` which gets a nice formal stack.

This leaves a lot of empty `willRenderTimeline()` implementations hanging around. I'll remove these in the next change, it's just going to be deleting a couple dozen copies of an identical empty method implementation.

Test Plan:
  - Viewed audits, revisions, and mocks with inline comments.
  - Used "Show Older" to page a revision back in history (this is relevant for "View Data").
  - Grepped for symbols: willRenderTimeline, getApplicationTransactionViewObject, Legalpad classes.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T11351

Differential Revision: https://secure.phabricator.com/D19918
2018-12-20 14:55:07 -08:00
..
PhabricatorBadgesArchiveController.php Modular Transactions for Badges 2017-02-23 14:22:52 -08:00
PhabricatorBadgesAwardController.php Remove needRecipients and needAwards from Badges 2017-03-03 08:41:58 -08:00
PhabricatorBadgesCommentController.php Remove "willRenderTimeline()" from ApplicationTransactionInterface 2018-12-20 14:55:07 -08:00
PhabricatorBadgesController.php Modernize Slowvote, fix Badges mobile menu 2015-11-30 12:58:11 -08:00
PhabricatorBadgesEditController.php Converting badge recipients from Edge to BadgeAward table 2016-03-26 14:03:48 -07:00
PhabricatorBadgesEditRecipientsController.php Remove needRecipients and needAwards from Badges 2017-03-03 08:41:58 -08:00
PhabricatorBadgesListController.php Clean up EditEngine implementation on Badges 2016-03-31 17:33:35 -07:00
PhabricatorBadgesProfileController.php Build Badges View page into more of a profile 2017-02-15 11:32:23 -08:00
PhabricatorBadgesRecipientsController.php Remove needRecipients and needAwards from Badges 2017-03-03 08:41:58 -08:00
PhabricatorBadgesRemoveRecipientsController.php Remove needRecipients and needAwards from Badges 2017-03-03 08:41:58 -08:00
PhabricatorBadgesViewController.php Miscellanous badge fixes 2017-02-24 15:51:26 -08:00