Page MenuHomePhabricator

Converting badge quality property from color to an integer representation for later sorting purposes
ClosedPublic

Authored by lpriestley on Mar 31 2016, 12:11 AM.
Tags
None
Referenced Files
F13283223: D15551.diff
Sun, Jun 2, 1:23 PM
F13269067: D15551.diff
Wed, May 29, 5:45 AM
F13252314: D15551.diff
Sat, May 25, 1:16 AM
F13241541: D15551.diff
Wed, May 22, 10:07 PM
F13236094: D15551.id37494.diff
Tue, May 21, 8:02 AM
F13235278: D15551.id37493.diff
Tue, May 21, 4:33 AM
F13235277: D15551.id37492.diff
Tue, May 21, 4:33 AM
F13178469: D15551.diff
Wed, May 8, 8:26 PM
Subscribers

Details

Summary

Ref T9007

Test Plan

Create badges, update quality, search by quality without change of functionality.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lpriestley retitled this revision from to Converting badge quality property from color to an integer representation for later sorting purposes.
lpriestley updated this object.
lpriestley edited the test plan for this revision. (Show Details)
lpriestley added a reviewer: epriestley.
epriestley edited edge metadata.

Some minor inline stuff but this looks broadly correct to me.

src/applications/badges/constants/PhabricatorBadgesQuality.php
16–18

Weird indent

21–25

Can this just be return $quality? Do we need this at all? I don't think anything calls it, and it can just be deleted.

src/applications/badges/editor/PhabricatorBadgesEditEngine.php
90–91

I think this should just be $object->getQuality() -- the map will be a map from 100 => "Uncommon" but the "value" of a select control is the key (100), not the string ("Uncommon").

I would expect this to cause a bug here:

  • Set a badge to a quality like "Legendary".
  • Save it.
  • Click "Edit Badge".
  • The <select /> dropdown is now set to the wrong value (not "Legendary").
src/applications/badges/storage/PhabricatorBadgesBadge.php
27–28

Probably move this to PhabricatorBadgesQuality?

This revision is now accepted and ready to land.Mar 31 2016, 12:20 AM
lpriestley marked 4 inline comments as done.
lpriestley edited edge metadata.

Moving things around

This revision was automatically updated to reflect the committed changes.