@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make it more clear that red dots next to usernames mean Calendar availability

Summary:
Ref T11809. We show a red dot next to a username to indicate that the user is away (on vacation, in a meeting, etc).

It's not very obvious what this means unless you know that's what it is: when you click the username or view a hovercard, there's no visual hint about what the red dot means. It does say "Away", but there is a lot of information and it doesn't visually connect the two.

Connect the two visually by putting a red dot next to the "Away" bit, too.

Test Plan:
Here's my version of it, this feels OK to me but could maybe be more designed:

{F1893916}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11809

Differential Revision: https://secure.phabricator.com/D16791

+56 -21
+2
src/__phutil_library_map__.php
··· 1687 1687 'PHUITimelineView' => 'view/phui/PHUITimelineView.php', 1688 1688 'PHUITwoColumnView' => 'view/phui/PHUITwoColumnView.php', 1689 1689 'PHUITypeaheadExample' => 'applications/uiexample/examples/PHUITypeaheadExample.php', 1690 + 'PHUIUserAvailabilityView' => 'applications/calendar/view/PHUIUserAvailabilityView.php', 1690 1691 'PHUIWorkboardView' => 'view/phui/PHUIWorkboardView.php', 1691 1692 'PHUIWorkpanelView' => 'view/phui/PHUIWorkpanelView.php', 1692 1693 'PassphraseAbstractKey' => 'applications/passphrase/keys/PassphraseAbstractKey.php', ··· 6461 6462 'PHUITimelineView' => 'AphrontView', 6462 6463 'PHUITwoColumnView' => 'AphrontTagView', 6463 6464 'PHUITypeaheadExample' => 'PhabricatorUIExample', 6465 + 'PHUIUserAvailabilityView' => 'AphrontTagView', 6464 6466 'PHUIWorkboardView' => 'AphrontTagView', 6465 6467 'PHUIWorkpanelView' => 'AphrontTagView', 6466 6468 'PassphraseAbstractKey' => 'Phobject',
+44
src/applications/calendar/view/PHUIUserAvailabilityView.php
··· 1 + <?php 2 + 3 + final class PHUIUserAvailabilityView 4 + extends AphrontTagView { 5 + 6 + private $user; 7 + 8 + public function setAvailableUser(PhabricatorUser $user) { 9 + $this->user = $user; 10 + return $this; 11 + } 12 + 13 + public function getAvailableUser() { 14 + return $this->user; 15 + } 16 + 17 + protected function getTagContent() { 18 + $viewer = $this->getViewer(); 19 + $user = $this->getAvailableUser(); 20 + 21 + $until = $user->getAwayUntil(); 22 + if (!$until) { 23 + return pht('Available'); 24 + } 25 + 26 + $away_tag = id(new PHUITagView()) 27 + ->setType(PHUITagView::TYPE_SHADE) 28 + ->setShade(PHUITagView::COLOR_RED) 29 + ->setName(pht('Away')) 30 + ->setDotColor(PHUITagView::COLOR_RED); 31 + 32 + $now = PhabricatorTime::getNow(); 33 + $description = pht( 34 + 'Away until %s', 35 + $viewer->formatShortDateTime($until, $now)); 36 + 37 + return array( 38 + $away_tag, 39 + ' ', 40 + $description, 41 + ); 42 + } 43 + 44 + }
+5 -2
src/applications/people/customfield/PhabricatorUserStatusField.php
··· 10 10 } 11 11 12 12 public function getFieldName() { 13 - return pht('Status'); 13 + return pht('Availability'); 14 14 } 15 15 16 16 public function getFieldDescription() { ··· 29 29 public function renderPropertyViewValue(array $handles) { 30 30 $user = $this->getObject(); 31 31 $viewer = $this->requireViewer(); 32 - return $user->getAvailabilityDescription($viewer); 32 + 33 + return id(new PHUIUserAvailabilityView()) 34 + ->setViewer($viewer) 35 + ->setAvailableUser($user); 33 36 } 34 37 35 38 }
-17
src/applications/people/storage/PhabricatorUser.php
··· 961 961 962 962 963 963 /** 964 - * Describe the user's availability. 965 - * 966 - * @param PhabricatorUser Viewing user. 967 - * @return string Human-readable description of away status. 968 - * @task availability 969 - */ 970 - public function getAvailabilityDescription(PhabricatorUser $viewer) { 971 - $until = $this->getAwayUntil(); 972 - if ($until) { 973 - return pht('Away until %s', phabricator_datetime($until, $viewer)); 974 - } else { 975 - return pht('Available'); 976 - } 977 - } 978 - 979 - 980 - /** 981 964 * Get cached availability, if present. 982 965 * 983 966 * @return wild|null Cache data, or null if no cache is available.
+5 -2
src/applications/people/view/PhabricatorUserCardView.php
··· 75 75 if (PhabricatorApplication::isClassInstalledForViewer( 76 76 'PhabricatorCalendarApplication', 77 77 $viewer)) { 78 - $availability = $user->getAvailabilityDescription($viewer); 79 - $body[] = $this->addItem(pht('Status'), $availability); 78 + $body[] = $this->addItem( 79 + pht('Availability'), 80 + id(new PHUIUserAvailabilityView()) 81 + ->setViewer($viewer) 82 + ->setAvailableUser($user)); 80 83 } 81 84 82 85 $badges = $this->buildBadges($user, $viewer);