1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Lock milestone projects to an automatic color/icon

Summary:
Ref T10010.

Currently, milestone subproject have editable icons/colors, but I don't think this is likely to be used much (the expectation is that milestones will be common and homogenous, and it doesn't make much sense to pick different icons for "Sprint 32" vs "Sprint 33", I think).

Locking the icon and color lets us simplify the form, make milestones more distinct, and potentially reuse the color later for other things (e.g., active/future/past or on time / overdue or whatever else) or just give them a special color to make them more visible.

The best argument for retaining this that I can come up with is that certain milestones may be special (e.g., Sprint 19 is a major release?), but you can just name it "Sprint 19 (v3.0!)" or something, which seems pretty good for now.

Also don't show milestones on task browse/list view.

Test Plan: {F1048532}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D14912
This commit is contained in:
epriestley 2015-12-30 03:35:51 -08:00
parent 972788b8b5
commit 389e4d1b1f
4 changed files with 30 additions and 5 deletions

View file

@ -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);

View file

@ -42,11 +42,17 @@ final class PhabricatorProjectProjectPHIDType extends PhabricatorPHIDType {
$slug = $project->getPrimarySlug();
$handle->setName($name);
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);

View file

@ -13,7 +13,8 @@ final class PhabricatorProjectSearchEngine
public function newQuery() {
return id(new PhabricatorProjectQuery())
->needImages(true);
->needImages(true)
->withIsMilestone(false);
}
protected function buildCustomSearchFields() {

View file

@ -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 )----------------------------------- */