Page MenuHomePhabricator

Modular Transactions for Badges
ClosedPublic

Authored by chad on Feb 23 2017, 7:47 PM.

Details

Summary

Ref T12270. This converts Badges to modular transactions for editing and awarding.

Test Plan

Add Badge, edit badge, award and revoke... Still going to test this some more but feel free to comment on anything obviously wrong?

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

chad created this revision.Feb 23 2017, 7:47 PM
epriestley accepted this revision.Feb 23 2017, 8:10 PM

Nice!

src/applications/badges/xaction/PhabricatorBadgesBadgeFlavorTransaction.php
17–23

I think you can get rid of this completely now since Badges are on EditEngine, should be handled automatically now.

src/applications/badges/xaction/PhabricatorBadgesBadgeIconTransaction.php
17–23

As above, likely obsolete.

src/applications/badges/xaction/PhabricatorBadgesBadgeQualityTransaction.php
17–23

As above, likely obsolete.

32–45

These should maaaaaybe use renderValue(...) to pick up the italic style? ModularTransactions generally uses renderValue() for titles, etc. Not sure if we want to count this sort of text as user-provided text or not.

src/applications/badges/xaction/PhabricatorBadgesBadgeStatusTransaction.php
28

Does this need a feed title?

src/applications/badges/xaction/PhabricatorBadgesBadgeTransactionType.php
7–9

Get rid of this, specific to Calendar.

This revision is now accepted and ready to land.Feb 23 2017, 8:10 PM
chad added a comment.Feb 23 2017, 8:24 PM

A lot of stuff just worked, so I'm going to re-test everything again because... it seemed too easy?

chad updated this revision to Diff 41847.Feb 23 2017, 9:37 PM
chad marked 4 inline comments as done.
  • per comments
chad added inline comments.Feb 23 2017, 10:09 PM
src/applications/badges/xaction/PhabricatorBadgesBadgeQualityTransaction.php
32–45

I couldn't get that to work? The value is a number.

epriestley added inline comments.Feb 23 2017, 10:13 PM
src/applications/badges/xaction/PhabricatorBadgesBadgeQualityTransaction.php
32–45

Oh, sorry, I mean like this? Or did that not work either?

$new = $this->getNewValue(); // Raw number, like 3.
$new = $this->getQualityLabel($new); // Now a string, like "Rare".
$new = $this->renderValue($new); // Now a fancy string, like //Rare//.
This revision was automatically updated to reflect the committed changes.