1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 10:52:41 +01:00

Hide archived projects only on workboards, not hovercards

Summary:
See PHI225. Previously, see D15335 / T10413. On workboards, we hide archived project tags since they aren't terribly useful in that context, at least most of the time. Originally, see T10349#159916 and D15297.

However, hovercards reuse this display logic, and it's inconsistent/confusing to hide them there, since the actual "Tags" elements on task pages show them. Narrow the scope of this rule.

Test Plan:
  - Viewed a hovercard for a task with an archived project tagged, saw archived project.
  - Viewed a workboard for the same task, saw only unarchived projects other than the current board tagged (this behavior is unchanged).

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18783
This commit is contained in:
epriestley 2017-11-27 14:08:40 -08:00
parent 49b57eae7d
commit 00baa3c1dd
2 changed files with 19 additions and 5 deletions

View file

@ -67,7 +67,9 @@ final class PhabricatorBoardRenderingEngine extends Phobject {
$project_phids = $object->getProjectPHIDs(); $project_phids = $object->getProjectPHIDs();
$project_handles = array_select_keys($this->handles, $project_phids); $project_handles = array_select_keys($this->handles, $project_phids);
if ($project_handles) { if ($project_handles) {
$card->setProjectHandles($project_handles); $card
->setHideArchivedProjects(true)
->setProjectHandles($project_handles);
} }
$cover_phid = $object->getCoverImageThumbnailPHID(); $cover_phid = $object->getCoverImageThumbnailPHID();

View file

@ -8,6 +8,7 @@ final class ProjectBoardTaskCard extends Phobject {
private $owner; private $owner;
private $canEdit; private $canEdit;
private $coverImageFile; private $coverImageFile;
private $hideArchivedProjects;
public function setViewer(PhabricatorUser $viewer) { public function setViewer(PhabricatorUser $viewer) {
$this->viewer = $viewer; $this->viewer = $viewer;
@ -35,6 +36,15 @@ final class ProjectBoardTaskCard extends Phobject {
return $this->coverImageFile; return $this->coverImageFile;
} }
public function setHideArchivedProjects($hide_archived_projects) {
$this->hideArchivedProjects = $hide_archived_projects;
return $this;
}
public function getHideArchivedProjects() {
return $this->hideArchivedProjects;
}
public function setTask(ManiphestTask $task) { public function setTask(ManiphestTask $task) {
$this->task = $task; $this->task = $task;
return $this; return $this;
@ -126,6 +136,7 @@ final class ProjectBoardTaskCard extends Phobject {
$project_handles = $this->getProjectHandles(); $project_handles = $this->getProjectHandles();
// Remove any archived projects from the list. // Remove any archived projects from the list.
if ($this->hideArchivedProjects) {
if ($project_handles) { if ($project_handles) {
foreach ($project_handles as $key => $handle) { foreach ($project_handles as $key => $handle) {
if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) { if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) {
@ -133,6 +144,7 @@ final class ProjectBoardTaskCard extends Phobject {
} }
} }
} }
}
if ($project_handles) { if ($project_handles) {
$project_handles = array_reverse($project_handles); $project_handles = array_reverse($project_handles);