Page MenuHomePhabricator

Implement "Resign" action against ApplicationTransactions
ClosedPublic

Authored by epriestley on Feb 25 2014, 2:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 26, 3:45 PM
Unknown Object (File)
Tue, Dec 17, 11:14 AM
Unknown Object (File)
Mon, Dec 16, 4:15 PM
Unknown Object (File)
Tue, Dec 10, 10:19 PM
Unknown Object (File)
Mon, Dec 9, 2:42 PM
Unknown Object (File)
Wed, Dec 4, 8:37 PM
Unknown Object (File)
Tue, Dec 3, 8:38 PM
Unknown Object (File)
Tue, Dec 3, 10:39 AM
Subscribers

Details

Summary

Ref T2222. This introduces two small new concepts:

  • expandTransactions(): allows a transaction to expand into several transactions. For example, "resign" adds a "remove reviewers" transaction.
    • We have some other cases which could use this, but currently hard-code things outside of the Editor.
      • One example is that in Maniphest, closing a task implies claiming it if it is unowned.
  • setIgnoreOnNoEffect(): The whole Editor can be set to continue or stop if any transactions have no effect, but this allows the behavior to be refined at the individual transaction level. This is primarily to make the UX less confusing, so the user gets only a single relevant error instead of one for each expanded transaction.

Otherwise, this is pretty straightforward.

Test Plan

Rigged comment form to use SavePro controller, enabled resign action, then tried to resign from a bunch of stuff.

{F117743}

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I am probably missing something with my inline.

src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
873

no array_mergev or anything? the array of transactions becomes an array of arrays of transactions so i figure eg combineTransactions isn't working since it used the earlier format?

src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
868

We iterate over the array of return values here, so $expanded is the individual transactions.

We could array_mergev() this instead but this seemed easier to read when I was writing it. :P

Let me rewrite this slightly for clarity, I was confused by this too in the cold light of morning when I saw your comment.