Page MenuHomePhabricator

D12832.id30895.diff
No OneTemporary

D12832.id30895.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,7 +7,7 @@
*/
return array(
'names' => array(
- 'core.pkg.css' => '7ac320f1',
+ 'core.pkg.css' => '9990f46d',
'core.pkg.js' => 'a2f2598e',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => 'bb338e4b',
@@ -37,7 +37,7 @@
'rsrc/css/application/base/main-menu-view.css' => '663e3810',
'rsrc/css/application/base/notification-menu.css' => '3c9d8aa1',
'rsrc/css/application/base/phabricator-application-launch-view.css' => '16ca323f',
- 'rsrc/css/application/base/standard-page-view.css' => '2acd4611',
+ 'rsrc/css/application/base/standard-page-view.css' => '61e68a55',
'rsrc/css/application/chatlog/chatlog.css' => '852140ff',
'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4',
'rsrc/css/application/config/config-options.css' => '7fedf08b',
@@ -731,7 +731,7 @@
'phabricator-side-menu-view-css' => 'c1db9e9c',
'phabricator-slowvote-css' => '266df6a1',
'phabricator-source-code-view-css' => '2ceee894',
- 'phabricator-standard-page-view' => '2acd4611',
+ 'phabricator-standard-page-view' => '61e68a55',
'phabricator-textareautils' => '5c93c52c',
'phabricator-title' => 'df5e11d2',
'phabricator-tooltip' => '1d298e3a',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2143,7 +2143,6 @@
'PhabricatorOAuthServerTokenController' => 'applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php',
'PhabricatorObjectHandle' => 'applications/phid/PhabricatorObjectHandle.php',
'PhabricatorObjectHandleConstants' => 'applications/phid/handle/const/PhabricatorObjectHandleConstants.php',
- 'PhabricatorObjectHandleStatus' => 'applications/phid/handle/const/PhabricatorObjectHandleStatus.php',
'PhabricatorObjectHasAsanaSubtaskEdgeType' => 'applications/doorkeeper/edge/PhabricatorObjectHasAsanaSubtaskEdgeType.php',
'PhabricatorObjectHasAsanaTaskEdgeType' => 'applications/doorkeeper/edge/PhabricatorObjectHasAsanaTaskEdgeType.php',
'PhabricatorObjectHasContributorEdgeType' => 'applications/transactions/edges/PhabricatorObjectHasContributorEdgeType.php',
@@ -5549,7 +5548,6 @@
'PhabricatorOAuthServerTestController' => 'PhabricatorOAuthServerController',
'PhabricatorOAuthServerTokenController' => 'PhabricatorAuthController',
'PhabricatorObjectHandle' => 'PhabricatorPolicyInterface',
- 'PhabricatorObjectHandleStatus' => 'PhabricatorObjectHandleConstants',
'PhabricatorObjectHasAsanaSubtaskEdgeType' => 'PhabricatorEdgeType',
'PhabricatorObjectHasAsanaTaskEdgeType' => 'PhabricatorEdgeType',
'PhabricatorObjectHasContributorEdgeType' => 'PhabricatorEdgeType',
diff --git a/src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php b/src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php
--- a/src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php
+++ b/src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php
@@ -42,7 +42,7 @@
->setURI('/E'.$id);
if ($is_cancelled) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
}
}
diff --git a/src/applications/dashboard/phid/PhabricatorDashboardPanelPHIDType.php b/src/applications/dashboard/phid/PhabricatorDashboardPanelPHIDType.php
--- a/src/applications/dashboard/phid/PhabricatorDashboardPanelPHIDType.php
+++ b/src/applications/dashboard/phid/PhabricatorDashboardPanelPHIDType.php
@@ -36,7 +36,7 @@
$handle->setURI("/{$monogram}");
if ($panel->getIsArchived()) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
}
}
diff --git a/src/applications/differential/phid/DifferentialRevisionPHIDType.php b/src/applications/differential/phid/DifferentialRevisionPHIDType.php
--- a/src/applications/differential/phid/DifferentialRevisionPHIDType.php
+++ b/src/applications/differential/phid/DifferentialRevisionPHIDType.php
@@ -41,7 +41,7 @@
$handle->setFullName("D{$id}: {$title}");
if ($revision->isClosed()) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
}
}
diff --git a/src/applications/flag/query/PhabricatorFlagSearchEngine.php b/src/applications/flag/query/PhabricatorFlagSearchEngine.php
--- a/src/applications/flag/query/PhabricatorFlagSearchEngine.php
+++ b/src/applications/flag/query/PhabricatorFlagSearchEngine.php
@@ -152,7 +152,7 @@
->setHeader($flag->getHandle()->getFullName())
->setHref($flag->getHandle()->getURI());
- $status_open = PhabricatorObjectHandleStatus::STATUS_OPEN;
+ $status_open = PhabricatorObjectHandle::STATUS_OPEN;
if ($flag->getHandle()->getStatus() != $status_open) {
$item->setDisabled(true);
}
diff --git a/src/applications/fund/phid/FundInitiativePHIDType.php b/src/applications/fund/phid/FundInitiativePHIDType.php
--- a/src/applications/fund/phid/FundInitiativePHIDType.php
+++ b/src/applications/fund/phid/FundInitiativePHIDType.php
@@ -37,7 +37,7 @@
$name = $initiative->getName();
if ($initiative->isClosed()) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
$handle->setName($name);
diff --git a/src/applications/maniphest/phid/ManiphestTaskPHIDType.php b/src/applications/maniphest/phid/ManiphestTaskPHIDType.php
--- a/src/applications/maniphest/phid/ManiphestTaskPHIDType.php
+++ b/src/applications/maniphest/phid/ManiphestTaskPHIDType.php
@@ -39,7 +39,7 @@
$handle->setURI("/T{$id}");
if ($task->isClosed()) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
}
}
diff --git a/src/applications/passphrase/phid/PassphraseCredentialPHIDType.php b/src/applications/passphrase/phid/PassphraseCredentialPHIDType.php
--- a/src/applications/passphrase/phid/PassphraseCredentialPHIDType.php
+++ b/src/applications/passphrase/phid/PassphraseCredentialPHIDType.php
@@ -39,7 +39,7 @@
$handle->setURI("/K{$id}");
if ($credential->getIsDestroyed()) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
}
}
diff --git a/src/applications/people/phid/PhabricatorPeopleUserPHIDType.php b/src/applications/people/phid/PhabricatorPeopleUserPHIDType.php
--- a/src/applications/people/phid/PhabricatorPeopleUserPHIDType.php
+++ b/src/applications/people/phid/PhabricatorPeopleUserPHIDType.php
@@ -43,11 +43,28 @@
$handle->setURI('/p/'.$user->getUsername().'/');
$handle->setFullName($user->getFullName());
$handle->setImageURI($user->getProfileImageURI());
- $handle->setDisabled(!$user->isUserActivated());
- if ($user->hasStatus()) {
- $status = $user->getStatus();
- $handle->setStatus($status->getTextStatus());
- $handle->setTitle($status->getTerseSummary($query->getViewer()));
+
+ $availability = null;
+ if (!$user->isUserActivated()) {
+ $availability = PhabricatorObjectHandle::AVAILABILITY_DISABLED;
+ } else {
+ if ($user->hasStatus()) {
+ // NOTE: This first call returns an event; then we get the event
+ // status.
+ $status = $user->getStatus()->getStatus();
+ switch ($status) {
+ case PhabricatorCalendarEvent::STATUS_AWAY:
+ $availability = PhabricatorObjectHandle::AVAILABILITY_NONE;
+ break;
+ case PhabricatorCalendarEvent::STATUS_SPORADIC:
+ $availability = PhabricatorObjectHandle::AVAILABILITY_PARTIAL;
+ break;
+ }
+ }
+ }
+
+ if ($availability) {
+ $handle->setAvailability($availability);
}
}
}
diff --git a/src/applications/phid/PhabricatorObjectHandle.php b/src/applications/phid/PhabricatorObjectHandle.php
--- a/src/applications/phid/PhabricatorObjectHandle.php
+++ b/src/applications/phid/PhabricatorObjectHandle.php
@@ -3,6 +3,14 @@
final class PhabricatorObjectHandle
implements PhabricatorPolicyInterface {
+ const AVAILABILITY_FULL = 'full';
+ const AVAILABILITY_NONE = 'none';
+ const AVAILABILITY_PARTIAL = 'partial';
+ const AVAILABILITY_DISABLED = 'disabled';
+
+ const STATUS_OPEN = 'open';
+ const STATUS_CLOSED = 'closed';
+
private $uri;
private $phid;
private $type;
@@ -13,9 +21,9 @@
private $icon;
private $tagColor;
private $timestamp;
- private $status = PhabricatorObjectHandleStatus::STATUS_OPEN;
+ private $status = self::STATUS_OPEN;
+ private $availability = self::AVAILABILITY_FULL;
private $complete;
- private $disabled;
private $objectName;
private $policyFiltered;
@@ -129,6 +137,19 @@
return $this->name;
}
+ public function setAvailability($availability) {
+ $this->availability = $availability;
+ return $this;
+ }
+
+ public function getAvailability() {
+ return $this->availability;
+ }
+
+ public function isDisabled() {
+ return ($this->getAvailability() == self::AVAILABILITY_DISABLED);
+ }
+
public function setStatus($status) {
$this->status = $status;
return $this;
@@ -225,33 +246,6 @@
}
- /**
- * Set whether or not the underlying object is disabled. See
- * @{method:isDisabled} for an explanation of what it means to be disabled.
- *
- * @param bool True if the handle represents a disabled object.
- * @return this
- */
- public function setDisabled($disabled) {
- $this->disabled = $disabled;
- return $this;
- }
-
-
- /**
- * Determine if the handle represents an object which has been disabled --
- * for example, disabled users, archived projects, etc. These objects are
- * complete and exist, but should be excluded from some system interactions
- * (for instance, they usually should not appear in typeaheads, and should
- * not have mail/notifications delivered to or about them).
- *
- * @return bool True if the handle represents a disabled object.
- */
- public function isDisabled() {
- return $this->disabled;
- }
-
-
public function renderLink($name = null) {
if ($name === null) {
$name = $this->getLinkName();
@@ -260,14 +254,12 @@
$classes[] = 'phui-handle';
$title = $this->title;
- if ($this->status != PhabricatorObjectHandleStatus::STATUS_OPEN) {
+ if ($this->status != self::STATUS_OPEN) {
$classes[] = 'handle-status-'.$this->status;
- $title = $title ? $title : $this->status;
}
- if ($this->disabled) {
- $classes[] = 'handle-disabled';
- $title = pht('Disabled'); // Overwrite status.
+ if ($this->availability != self::AVAILABILITY_FULL) {
+ $classes[] = 'handle-availability-'.$this->availability;
}
if ($this->getType() == PhabricatorPeopleUserPHIDType::TYPECONST) {
diff --git a/src/applications/phid/handle/const/PhabricatorObjectHandleStatus.php b/src/applications/phid/handle/const/PhabricatorObjectHandleStatus.php
deleted file mode 100644
--- a/src/applications/phid/handle/const/PhabricatorObjectHandleStatus.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-
-final class PhabricatorObjectHandleStatus
- extends PhabricatorObjectHandleConstants {
-
- const STATUS_OPEN = 'open';
- const STATUS_CLOSED = 'closed';
-
-}
diff --git a/src/applications/pholio/phid/PholioMockPHIDType.php b/src/applications/pholio/phid/PholioMockPHIDType.php
--- a/src/applications/pholio/phid/PholioMockPHIDType.php
+++ b/src/applications/pholio/phid/PholioMockPHIDType.php
@@ -40,7 +40,7 @@
$handle->setFullName("M{$id}: {$name}");
if ($mock->isClosed()) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
}
}
diff --git a/src/applications/phriction/phid/PhrictionDocumentPHIDType.php b/src/applications/phriction/phid/PhrictionDocumentPHIDType.php
--- a/src/applications/phriction/phid/PhrictionDocumentPHIDType.php
+++ b/src/applications/phriction/phid/PhrictionDocumentPHIDType.php
@@ -42,7 +42,7 @@
$handle->setURI(PhrictionDocument::getSlugURI($slug));
if ($status != PhrictionDocumentStatus::STATUS_EXISTS) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
}
}
diff --git a/src/applications/project/phid/PhabricatorProjectColumnPHIDType.php b/src/applications/project/phid/PhabricatorProjectColumnPHIDType.php
--- a/src/applications/project/phid/PhabricatorProjectColumnPHIDType.php
+++ b/src/applications/project/phid/PhabricatorProjectColumnPHIDType.php
@@ -34,7 +34,10 @@
$handle->setName($column->getDisplayName());
$handle->setURI('/project/board/'.$column->getProject()->getID().'/');
- $handle->setDisabled($column->isHidden());
+
+ if ($column->isHidden()) {
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
+ }
}
}
diff --git a/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php b/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php
--- a/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php
+++ b/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php
@@ -49,7 +49,7 @@
$handle->setTagColor($project->getColor());
if ($project->isArchived()) {
- $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED);
+ $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
}
}
}
diff --git a/src/applications/search/view/PhabricatorSearchResultView.php b/src/applications/search/view/PhabricatorSearchResultView.php
--- a/src/applications/search/view/PhabricatorSearchResultView.php
+++ b/src/applications/search/view/PhabricatorSearchResultView.php
@@ -41,7 +41,7 @@
->setImageURI($handle->getImageURI())
->addAttribute($type_name);
- if ($handle->getStatus() == PhabricatorObjectHandleStatus::STATUS_CLOSED) {
+ if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) {
$item->setDisabled(true);
$item->addAttribute(pht('Closed'));
}
diff --git a/src/applications/typeahead/view/PhabricatorTypeaheadTokenView.php b/src/applications/typeahead/view/PhabricatorTypeaheadTokenView.php
--- a/src/applications/typeahead/view/PhabricatorTypeaheadTokenView.php
+++ b/src/applications/typeahead/view/PhabricatorTypeaheadTokenView.php
@@ -35,7 +35,7 @@
->setIcon($handle->getIcon());
if ($handle->isDisabled() ||
- $handle->getStatus() == PhabricatorObjectHandleStatus::STATUS_CLOSED) {
+ $handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) {
$token->setTokenType(self::TYPE_DISABLED);
} else {
$token->setColor($handle->getTagColor());
diff --git a/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php b/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
--- a/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
+++ b/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
@@ -86,7 +86,7 @@
$href = $this->getObjectHref($object, $handle, $id);
$text = $this->getObjectNamePrefix().$id;
- $status_closed = PhabricatorObjectHandleStatus::STATUS_CLOSED;
+ $status_closed = PhabricatorObjectHandle::STATUS_CLOSED;
if ($anchor) {
$href = $href.'#'.$anchor;
@@ -126,7 +126,7 @@
$name = $handle->getFullName();
$href = $handle->getURI();
- $status_closed = PhabricatorObjectHandleStatus::STATUS_CLOSED;
+ $status_closed = PhabricatorObjectHandle::STATUS_CLOSED;
$attr = array(
'phid' => $handle->getPHID(),
'closed' => ($handle->getStatus() == $status_closed),
@@ -140,7 +140,7 @@
$href,
PhabricatorObjectHandle $handle) {
- $status_closed = PhabricatorObjectHandleStatus::STATUS_CLOSED;
+ $status_closed = PhabricatorObjectHandle::STATUS_CLOSED;
$strikethrough = $handle->getStatus() == $status_closed ?
'text-decoration: line-through;' :
'text-decoration: none;';
diff --git a/webroot/rsrc/css/application/base/standard-page-view.css b/webroot/rsrc/css/application/base/standard-page-view.css
--- a/webroot/rsrc/css/application/base/standard-page-view.css
+++ b/webroot/rsrc/css/application/base/standard-page-view.css
@@ -80,23 +80,23 @@
color: #19558D;
}
-a.handle-disabled,
-a.handle-status-away,
-a.handle-status-sporadic {
+a.handle-availability-disabled,
+a.handle-availability-none,
+a.handle-availability-partial {
padding-left: 11px;
background-repeat: no-repeat;
background-position: -4px center;
}
-a.handle-status-away {
+a.handle-availability-none {
background-image: url(/rsrc/image/icon/fatcow/bullet_red.png);
}
-a.handle-status-sporadic {
+a.handle-availability-partial {
background-image: url(/rsrc/image/icon/fatcow/bullet_orange.png);
}
-a.handle-disabled {
+a.handle-availability-disabled {
background-image: url(/rsrc/image/icon/fatcow/bullet_black.png);
}

File Metadata

Mime Type
text/plain
Expires
Oct 15 2024, 5:32 PM (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6713707
Default Alt Text
D12832.id30895.diff (17 KB)

Event Timeline