Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15418001
D15200.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D15200.id.diff
View Options
diff --git a/src/applications/project/profilepanel/PhabricatorProjectSubprojectsProfilePanel.php b/src/applications/project/profilepanel/PhabricatorProjectSubprojectsProfilePanel.php
--- a/src/applications/project/profilepanel/PhabricatorProjectSubprojectsProfilePanel.php
+++ b/src/applications/project/profilepanel/PhabricatorProjectSubprojectsProfilePanel.php
@@ -13,6 +13,14 @@
return pht('Subprojects');
}
+ public function shouldEnableForObject($object) {
+ if ($object->isMilestone()) {
+ return false;
+ }
+
+ return true;
+ }
+
public function getDisplayName(
PhabricatorProfilePanelConfiguration $config) {
$name = $config->getPanelProperty('name');
diff --git a/src/applications/search/engine/PhabricatorProfilePanelEngine.php b/src/applications/search/engine/PhabricatorProfilePanelEngine.php
--- a/src/applications/search/engine/PhabricatorProfilePanelEngine.php
+++ b/src/applications/search/engine/PhabricatorProfilePanelEngine.php
@@ -239,6 +239,10 @@
// Merge the stored panels into the builtin panels. If a builtin panel has
// a stored version, replace the defaults with the stored changes.
foreach ($stored_panels as $stored_panel) {
+ if (!$stored_panel->shouldEnableForObject($object)) {
+ continue;
+ }
+
$builtin_key = $stored_panel->getBuiltinKey();
if ($builtin_key !== null) {
// If this builtin actually exists, replace the builtin with the
@@ -341,6 +345,10 @@
->attachProfileObject($object)
->setPanelOrder($order);
+ if (!$builtin->shouldEnableForObject($object)) {
+ continue;
+ }
+
$map[$builtin_key] = $builtin;
$order++;
diff --git a/src/applications/search/profilepanel/PhabricatorProfilePanel.php b/src/applications/search/profilepanel/PhabricatorProfilePanel.php
--- a/src/applications/search/profilepanel/PhabricatorProfilePanel.php
+++ b/src/applications/search/profilepanel/PhabricatorProfilePanel.php
@@ -30,6 +30,10 @@
return false;
}
+ public function shouldEnableForObject($object) {
+ return true;
+ }
+
public function canHidePanel(
PhabricatorProfilePanelConfiguration $config) {
return true;
diff --git a/src/applications/search/storage/PhabricatorProfilePanelConfiguration.php b/src/applications/search/storage/PhabricatorProfilePanelConfiguration.php
--- a/src/applications/search/storage/PhabricatorProfilePanelConfiguration.php
+++ b/src/applications/search/storage/PhabricatorProfilePanelConfiguration.php
@@ -109,6 +109,10 @@
return $this->getPanel()->canHidePanel($this);
}
+ public function shouldEnableForObject($object) {
+ return $this->getPanel()->shouldEnableForObject($object);
+ }
+
public function getSortKey() {
$order = $this->getPanelOrder();
if ($order === null) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 8:03 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7383524
Default Alt Text
D15200.id.diff (2 KB)
Attached To
Mode
D15200: Disable "Subprojects" menu item for milestone projects
Attached
Detach File
Event Timeline
Log In to Comment