1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42: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_handles = array_select_keys($this->handles, $project_phids);
if ($project_handles) {
$card->setProjectHandles($project_handles);
$card
->setHideArchivedProjects(true)
->setProjectHandles($project_handles);
}
$cover_phid = $object->getCoverImageThumbnailPHID();

View file

@ -8,6 +8,7 @@ final class ProjectBoardTaskCard extends Phobject {
private $owner;
private $canEdit;
private $coverImageFile;
private $hideArchivedProjects;
public function setViewer(PhabricatorUser $viewer) {
$this->viewer = $viewer;
@ -35,6 +36,15 @@ final class ProjectBoardTaskCard extends Phobject {
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) {
$this->task = $task;
return $this;
@ -126,10 +136,12 @@ final class ProjectBoardTaskCard extends Phobject {
$project_handles = $this->getProjectHandles();
// Remove any archived projects from the list.
if ($project_handles) {
foreach ($project_handles as $key => $handle) {
if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) {
unset($project_handles[$key]);
if ($this->hideArchivedProjects) {
if ($project_handles) {
foreach ($project_handles as $key => $handle) {
if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) {
unset($project_handles[$key]);
}
}
}
}