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
F14317732: D15551.diff
Wed, Dec 18, 8:19 AM
Unknown Object (File)
Sat, Dec 7, 11:25 AM
Unknown Object (File)
Sun, Nov 24, 2:28 PM
Unknown Object (File)
Thu, Nov 21, 7:38 PM
Unknown Object (File)
Nov 17 2024, 5:28 PM
Unknown Object (File)
Nov 16 2024, 2:59 PM
Unknown Object (File)
Nov 14 2024, 9:55 AM
Unknown Object (File)
Nov 9 2024, 7:40 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.