Page MenuHomePhabricator

Build a Badges page for Profiles
ClosedPublic

Authored by chad on Feb 24 2017, 8:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 6:55 AM
Unknown Object (File)
Mon, Apr 8, 1:23 AM
Unknown Object (File)
Thu, Apr 4, 1:48 PM
Unknown Object (File)
Mar 19 2024, 6:02 PM
Unknown Object (File)
Mar 19 2024, 6:02 PM
Unknown Object (File)
Mar 19 2024, 6:02 PM
Unknown Object (File)
Mar 19 2024, 6:02 PM
Unknown Object (File)
Mar 11 2024, 6:15 PM
Subscribers

Details

Summary

Ref T12270. Moves badges into their own page and menu item. Capable of displaying hundreds of useful tokens of appreciation and dedication.

Test Plan

Test blank state, mobile, awards badges.

pasted_file (1×2 px, 411 KB)

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

good catto

pat pat pat

src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php
44–55

This was pre-existing, but this is pretty expensive ("Load every badge the user can view and edit") and won't scale particularly well -- maybe just always show the button? I'd guess users can mostly figure it out.

This revision is now accepted and ready to land.Feb 24 2017, 9:07 PM
This revision was automatically updated to reflect the committed changes.
src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php
44–55

Maybe add a can_award capability?

I left it in for now, but will make a note to follow up with something better

It's at least now on a separate page vs. every profile.

There's no way to make "does any object exist which the user has X permission" on efficient in the general case. If an install has like 5,000 badges that query is going to take like 30 seconds to run no matter what.

You could do "limit 1" to make it less bad but the way "limit 1" works right now will actually make it way way worse.

Yeah. Not a big deal since it'll be a while before any install has enough badges for it to matter.

Not a big deal since it'll be a while before any install has enough badges for it to matter.

partycat