mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +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:
parent
972788b8b5
commit
389e4d1b1f
4 changed files with 30 additions and 5 deletions
|
@ -109,6 +109,8 @@ final class PhabricatorProjectEditEngine
|
||||||
PhabricatorTransactions::TYPE_VIEW_POLICY,
|
PhabricatorTransactions::TYPE_VIEW_POLICY,
|
||||||
PhabricatorTransactions::TYPE_EDIT_POLICY,
|
PhabricatorTransactions::TYPE_EDIT_POLICY,
|
||||||
PhabricatorTransactions::TYPE_JOIN_POLICY,
|
PhabricatorTransactions::TYPE_JOIN_POLICY,
|
||||||
|
PhabricatorProjectTransaction::TYPE_ICON,
|
||||||
|
PhabricatorProjectTransaction::TYPE_COLOR,
|
||||||
);
|
);
|
||||||
$unavailable = array_fuse($unavailable);
|
$unavailable = array_fuse($unavailable);
|
||||||
|
|
||||||
|
|
|
@ -42,11 +42,17 @@ final class PhabricatorProjectProjectPHIDType extends PhabricatorPHIDType {
|
||||||
$slug = $project->getPrimarySlug();
|
$slug = $project->getPrimarySlug();
|
||||||
|
|
||||||
$handle->setName($name);
|
$handle->setName($name);
|
||||||
|
|
||||||
|
if (strlen($slug)) {
|
||||||
$handle->setObjectName('#'.$slug);
|
$handle->setObjectName('#'.$slug);
|
||||||
$handle->setURI("/tag/{$slug}/");
|
$handle->setURI("/tag/{$slug}/");
|
||||||
|
} else {
|
||||||
|
$handle->setURI("/project/view/{$id}/");
|
||||||
|
}
|
||||||
|
|
||||||
$handle->setImageURI($project->getProfileImageURI());
|
$handle->setImageURI($project->getProfileImageURI());
|
||||||
$handle->setIcon($project->getIcon());
|
$handle->setIcon($project->getDisplayIcon());
|
||||||
$handle->setTagColor($project->getColor());
|
$handle->setTagColor($project->getDisplayColor());
|
||||||
|
|
||||||
if ($project->isArchived()) {
|
if ($project->isArchived()) {
|
||||||
$handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
|
$handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
|
||||||
|
|
|
@ -13,7 +13,8 @@ final class PhabricatorProjectSearchEngine
|
||||||
|
|
||||||
public function newQuery() {
|
public function newQuery() {
|
||||||
return id(new PhabricatorProjectQuery())
|
return id(new PhabricatorProjectQuery())
|
||||||
->needImages(true);
|
->needImages(true)
|
||||||
|
->withIsMilestone(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildCustomSearchFields() {
|
protected function buildCustomSearchFields() {
|
||||||
|
|
|
@ -484,6 +484,22 @@ final class PhabricatorProject extends PhabricatorProjectDAO
|
||||||
return $number;
|
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 )----------------------------------- */
|
/* -( PhabricatorSubscribableInterface )----------------------------------- */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue