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
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
Unknown Object (File)
Nov 6 2024, 6:02 AM
Subscribers

Details

Summary

Ref T9007

Test Plan

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

Diff Detail

Repository
rP Phabricator
Branch
badgesquality
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 11357
Build 14136: Run Core Tests
Build 14135: arc lint + arc unit

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
15–17

Weird indent

20–24

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
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.