diff --git a/src/applications/project/engine/PhabricatorProjectEditEngine.php b/src/applications/project/engine/PhabricatorProjectEditEngine.php index 9f72ad8147..389c585fce 100644 --- a/src/applications/project/engine/PhabricatorProjectEditEngine.php +++ b/src/applications/project/engine/PhabricatorProjectEditEngine.php @@ -109,6 +109,8 @@ final class PhabricatorProjectEditEngine PhabricatorTransactions::TYPE_VIEW_POLICY, PhabricatorTransactions::TYPE_EDIT_POLICY, PhabricatorTransactions::TYPE_JOIN_POLICY, + PhabricatorProjectTransaction::TYPE_ICON, + PhabricatorProjectTransaction::TYPE_COLOR, ); $unavailable = array_fuse($unavailable); diff --git a/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php b/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php index c3d9bdd3fb..eb1a59a5f5 100644 --- a/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php +++ b/src/applications/project/phid/PhabricatorProjectProjectPHIDType.php @@ -42,11 +42,17 @@ final class PhabricatorProjectProjectPHIDType extends PhabricatorPHIDType { $slug = $project->getPrimarySlug(); $handle->setName($name); - $handle->setObjectName('#'.$slug); - $handle->setURI("/tag/{$slug}/"); + + if (strlen($slug)) { + $handle->setObjectName('#'.$slug); + $handle->setURI("/tag/{$slug}/"); + } else { + $handle->setURI("/project/view/{$id}/"); + } + $handle->setImageURI($project->getProfileImageURI()); - $handle->setIcon($project->getIcon()); - $handle->setTagColor($project->getColor()); + $handle->setIcon($project->getDisplayIcon()); + $handle->setTagColor($project->getDisplayColor()); if ($project->isArchived()) { $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED); diff --git a/src/applications/project/query/PhabricatorProjectSearchEngine.php b/src/applications/project/query/PhabricatorProjectSearchEngine.php index 66933ac81a..0c3af4a8e6 100644 --- a/src/applications/project/query/PhabricatorProjectSearchEngine.php +++ b/src/applications/project/query/PhabricatorProjectSearchEngine.php @@ -13,7 +13,8 @@ final class PhabricatorProjectSearchEngine public function newQuery() { return id(new PhabricatorProjectQuery()) - ->needImages(true); + ->needImages(true) + ->withIsMilestone(false); } protected function buildCustomSearchFields() { diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php index 7e31bfa1f2..5d2aa3461e 100644 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -484,6 +484,22 @@ final class PhabricatorProject extends PhabricatorProjectDAO return $number; } + public function getDisplayIcon() { + if ($this->isMilestone()) { + return 'fa-map-marker'; + } + + return $this->getIcon(); + } + + public function getDisplayColor() { + if ($this->isMilestone()) { + return self::DEFAULT_COLOR; + } + + return $this->getColor(); + } + /* -( PhabricatorSubscribableInterface )----------------------------------- */