mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 18:22:41 +01:00
Drop test for awardable badges on "Badges" tab of user profiles to avoid overheating
Summary: Fixes T13370. We currently show an "Award Badge" button conditionally, based on whether the viewer can award any badges or not. The query to test this may overheat and this pattern isn't consistent with other UI anyway. Stop doing this test. Test Plan: - Created 12 badges. - As a user who could not edit any of the badges, viewed the "Badges" section of a user profile. Maniphest Tasks: T13370 Differential Revision: https://secure.phabricator.com/D20702
This commit is contained in:
parent
937edcdc58
commit
46d9065bf1
1 changed files with 5 additions and 20 deletions
|
@ -34,20 +34,6 @@ final class PhabricatorPeopleProfileBadgesController
|
||||||
$user,
|
$user,
|
||||||
PhabricatorPeopleProfileMenuEngine::ITEM_BADGES);
|
PhabricatorPeopleProfileMenuEngine::ITEM_BADGES);
|
||||||
|
|
||||||
// Best option?
|
|
||||||
$badges = id(new PhabricatorBadgesQuery())
|
|
||||||
->setViewer($viewer)
|
|
||||||
->withStatuses(array(
|
|
||||||
PhabricatorBadgesBadge::STATUS_ACTIVE,
|
|
||||||
))
|
|
||||||
->requireCapabilities(
|
|
||||||
array(
|
|
||||||
PhabricatorPolicyCapability::CAN_VIEW,
|
|
||||||
PhabricatorPolicyCapability::CAN_EDIT,
|
|
||||||
))
|
|
||||||
->setLimit(1)
|
|
||||||
->execute();
|
|
||||||
|
|
||||||
$button = id(new PHUIButtonView())
|
$button = id(new PHUIButtonView())
|
||||||
->setTag('a')
|
->setTag('a')
|
||||||
->setIcon('fa-plus')
|
->setIcon('fa-plus')
|
||||||
|
@ -55,16 +41,15 @@ final class PhabricatorPeopleProfileBadgesController
|
||||||
->setWorkflow(true)
|
->setWorkflow(true)
|
||||||
->setHref('/badges/award/'.$user->getID().'/');
|
->setHref('/badges/award/'.$user->getID().'/');
|
||||||
|
|
||||||
if ($badges) {
|
|
||||||
$header->addActionLink($button);
|
$header->addActionLink($button);
|
||||||
}
|
|
||||||
|
|
||||||
$view = id(new PHUITwoColumnView())
|
$view = id(new PHUITwoColumnView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
->addClass('project-view-home')
|
->addClass('project-view-home')
|
||||||
->addClass('project-view-people-home')
|
->addClass('project-view-people-home')
|
||||||
->setFooter(array(
|
->setFooter(
|
||||||
$this->buildBadgesView($user)
|
array(
|
||||||
|
$badges,
|
||||||
));
|
));
|
||||||
|
|
||||||
return $this->newPage()
|
return $this->newPage()
|
||||||
|
|
Loading…
Reference in a new issue