Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14009671
D9358.id22314.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
23 KB
Referenced Files
None
Subscribers
None
D9358.id22314.diff
View Options
diff --git a/src/applications/audit/application/PhabricatorApplicationAudit.php b/src/applications/audit/application/PhabricatorApplicationAudit.php
--- a/src/applications/audit/application/PhabricatorApplicationAudit.php
+++ b/src/applications/audit/application/PhabricatorApplicationAudit.php
@@ -14,6 +14,10 @@
return pht('Browse and Audit Commits');
}
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return true;
+ }
+
public function getHelpURI() {
return PhabricatorEnv::getDoclink('Audit User Guide');
}
@@ -34,10 +38,6 @@
);
}
- public function getApplicationGroup() {
- return self::GROUP_CORE;
- }
-
public function getApplicationOrder() {
return 0.130;
}
diff --git a/src/applications/auth/application/PhabricatorApplicationAuth.php b/src/applications/auth/application/PhabricatorApplicationAuth.php
--- a/src/applications/auth/application/PhabricatorApplicationAuth.php
+++ b/src/applications/auth/application/PhabricatorApplicationAuth.php
@@ -14,8 +14,12 @@
return 'authentication';
}
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return $viewer->getIsAdmin();
+ }
+
public function getShortDescription() {
- return pht('Configure Login and Registration');
+ return pht('Login/Registration');
}
public function getHelpURI() {
diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php
--- a/src/applications/base/PhabricatorApplication.php
+++ b/src/applications/base/PhabricatorApplication.php
@@ -16,11 +16,6 @@
const GROUP_ADMIN = 'admin';
const GROUP_DEVELOPER = 'developer';
- const TILE_INVISIBLE = 'invisible';
- const TILE_HIDE = 'hide';
- const TILE_SHOW = 'show';
- const TILE_FULL = 'full';
-
public static function getApplicationGroups() {
return array(
self::GROUP_CORE => pht('Core Applications'),
@@ -30,20 +25,10 @@
);
}
- public static function getTileDisplayName($constant) {
- $names = array(
- self::TILE_INVISIBLE => pht('Invisible'),
- self::TILE_HIDE => pht('Hidden'),
- self::TILE_SHOW => pht('Show Small Tile'),
- self::TILE_FULL => pht('Show Large Tile'),
- );
- return idx($names, $constant);
- }
-
-
/* -( Application Information )-------------------------------------------- */
+
public function getName() {
return substr(get_class($this), strlen('PhabricatorApplication'));
}
@@ -68,21 +53,63 @@
return empty($uninstalled[get_class($this)]);
}
+
public function isBeta() {
return false;
}
+
/**
- * Return true if this application should not appear in application lists in
- * the UI. Primarily intended for unit test applications or other
+ * Return `true` if this application should never appear in application lists
+ * in the UI. Primarily intended for unit test applications or other
* pseudo-applications.
*
+ * Few applications should be unlisted. For most applications, use
+ * @{method:isLaunchable} to hide them from main launch views instead.
+ *
* @return bool True to remove application from UI lists.
*/
public function isUnlisted() {
return false;
}
+
+ /**
+ * Return `true` if this application is a normal application with a base
+ * URI and a web interface.
+ *
+ * Launchable applications can be pinned to the home page, and show up in the
+ * "Launcher" view of the Applications application. Making an application
+ * unlauncahble prevents pinning and hides it from this view.
+ *
+ * Usually, an application should be marked unlaunchable if:
+ *
+ * - it is available on every page anyway (like search); or
+ * - it does not have a web interface (like subscriptions); or
+ * - it is still pre-release and being intentionally buried.
+ *
+ * To hide applications more completely, use @{method:isUnlisted}.
+ *
+ * @return bool True if the application is launchable.
+ */
+ public function isLaunchable() {
+ return true;
+ }
+
+
+ /**
+ * Return `true` if this application should be pinned by default.
+ *
+ * Users who have not yet set preferences see a default list of applications.
+ *
+ * @param PhabricatorUser User viewing the pinned application list.
+ * @return bool True if this application should be pinned by default.
+ */
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return false;
+ }
+
+
/**
* Returns true if an application is first-party (developed by Phacility)
* and false otherwise.
@@ -113,7 +140,7 @@
}
public function getTypeaheadURI() {
- return $this->getBaseURI();
+ return $this->isLaunchable() ? $this->getBaseURI() : null;
}
public function getBaseURI() {
@@ -132,10 +159,6 @@
return 'application';
}
- public function shouldAppearInLaunchView() {
- return true;
- }
-
public function getApplicationOrder() {
return PHP_INT_MAX;
}
@@ -160,25 +183,6 @@
return array();
}
- public function getDefaultTileDisplay(PhabricatorUser $user) {
- switch ($this->getApplicationGroup()) {
- case self::GROUP_CORE:
- return self::TILE_FULL;
- case self::GROUP_UTILITIES:
- case self::GROUP_DEVELOPER:
- return self::TILE_HIDE;
- case self::GROUP_ADMIN:
- if ($user->getIsAdmin()) {
- return self::TILE_SHOW;
- } else {
- return self::TILE_INVISIBLE;
- }
- break;
- default:
- return self::TILE_SHOW;
- }
- }
-
public function getRemarkupRules() {
return array();
}
diff --git a/src/applications/base/controller/__tests__/PhabricatorApplicationTest.php b/src/applications/base/controller/__tests__/PhabricatorApplicationTest.php
--- a/src/applications/base/controller/__tests__/PhabricatorApplicationTest.php
+++ b/src/applications/base/controller/__tests__/PhabricatorApplicationTest.php
@@ -8,6 +8,10 @@
return true;
}
+ public function isLaunchable() {
+ return false;
+ }
+
public function reset() {
$this->policies = array();
}
@@ -21,10 +25,6 @@
return idx($this->policies, $capability, parent::getPolicy($capability));
}
- public function shouldAppearInLaunchView() {
- return false;
- }
-
public function canUninstall() {
return false;
}
diff --git a/src/applications/conduit/application/PhabricatorApplicationConduit.php b/src/applications/conduit/application/PhabricatorApplicationConduit.php
--- a/src/applications/conduit/application/PhabricatorApplicationConduit.php
+++ b/src/applications/conduit/application/PhabricatorApplicationConduit.php
@@ -19,7 +19,7 @@
}
public function getShortDescription() {
- return pht('Phabricator Developer API Console');
+ return pht('Developer API');
}
public function getTitleGlyph() {
diff --git a/src/applications/config/application/PhabricatorApplicationConfig.php b/src/applications/config/application/PhabricatorApplicationConfig.php
--- a/src/applications/config/application/PhabricatorApplicationConfig.php
+++ b/src/applications/config/application/PhabricatorApplicationConfig.php
@@ -10,6 +10,10 @@
return 'setup';
}
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return $viewer->getIsAdmin();
+ }
+
public function getTitleGlyph() {
return "\xE2\x98\xBA";
}
diff --git a/src/applications/dashboard/application/PhabricatorApplicationDashboard.php b/src/applications/dashboard/application/PhabricatorApplicationDashboard.php
--- a/src/applications/dashboard/application/PhabricatorApplicationDashboard.php
+++ b/src/applications/dashboard/application/PhabricatorApplicationDashboard.php
@@ -48,7 +48,13 @@
);
}
- public function shouldAppearInLaunchView() {
+ public function isBeta() {
+ return true;
+ }
+
+ public function isLaunchable() {
+ // TODO: This is just concealing the application from launch views for
+ // now since it's not really beta yet.
return false;
}
diff --git a/src/applications/differential/application/PhabricatorApplicationDifferential.php b/src/applications/differential/application/PhabricatorApplicationDifferential.php
--- a/src/applications/differential/application/PhabricatorApplicationDifferential.php
+++ b/src/applications/differential/application/PhabricatorApplicationDifferential.php
@@ -14,6 +14,10 @@
return 'differential';
}
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return true;
+ }
+
public function getHelpURI() {
return PhabricatorEnv::getDoclink('Differential User Guide');
}
@@ -74,10 +78,6 @@
);
}
- public function getApplicationGroup() {
- return self::GROUP_CORE;
- }
-
public function getApplicationOrder() {
return 0.100;
}
diff --git a/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php b/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php
--- a/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php
+++ b/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php
@@ -14,6 +14,10 @@
return 'diffusion';
}
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return true;
+ }
+
public function getHelpURI() {
return PhabricatorEnv::getDoclink('Diffusion User Guide');
}
@@ -116,10 +120,6 @@
);
}
- public function getApplicationGroup() {
- return self::GROUP_CORE;
- }
-
public function getApplicationOrder() {
return 0.120;
}
diff --git a/src/applications/doorkeeper/application/PhabricatorApplicationDoorkeeper.php b/src/applications/doorkeeper/application/PhabricatorApplicationDoorkeeper.php
--- a/src/applications/doorkeeper/application/PhabricatorApplicationDoorkeeper.php
+++ b/src/applications/doorkeeper/application/PhabricatorApplicationDoorkeeper.php
@@ -6,7 +6,7 @@
return false;
}
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/flag/application/PhabricatorApplicationFlags.php b/src/applications/flag/application/PhabricatorApplicationFlags.php
--- a/src/applications/flag/application/PhabricatorApplicationFlags.php
+++ b/src/applications/flag/application/PhabricatorApplicationFlags.php
@@ -3,7 +3,7 @@
final class PhabricatorApplicationFlags extends PhabricatorApplication {
public function getShortDescription() {
- return pht('Personal Bookmarks and Reminders');
+ return pht('Personal Bookmarks');
}
public function getBaseURI() {
diff --git a/src/applications/harbormaster/application/PhabricatorApplicationHarbormaster.php b/src/applications/harbormaster/application/PhabricatorApplicationHarbormaster.php
--- a/src/applications/harbormaster/application/PhabricatorApplicationHarbormaster.php
+++ b/src/applications/harbormaster/application/PhabricatorApplicationHarbormaster.php
@@ -7,7 +7,7 @@
}
public function getShortDescription() {
- return pht('Builds and Continuous Integration');
+ return pht('Build/CI');
}
public function getIconName() {
diff --git a/src/applications/home/application/PhabricatorApplicationHome.php b/src/applications/home/application/PhabricatorApplicationHome.php
--- a/src/applications/home/application/PhabricatorApplicationHome.php
+++ b/src/applications/home/application/PhabricatorApplicationHome.php
@@ -23,7 +23,7 @@
);
}
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/home/controller/PhabricatorHomeController.php b/src/applications/home/controller/PhabricatorHomeController.php
--- a/src/applications/home/controller/PhabricatorHomeController.php
+++ b/src/applications/home/controller/PhabricatorHomeController.php
@@ -28,14 +28,6 @@
->withLaunchable(true)
->execute();
- foreach ($applications as $key => $application) {
- $invisible = PhabricatorApplication::TILE_INVISIBLE;
- if ($application->getDefaultTileDisplay($user) == $invisible) {
- // Remove invisible applications (e.g., admin apps for non-admins).
- unset($applications[$key]);
- }
- }
-
$pinned = $user->loadPreferences()->getPinnedApplications(
$applications,
$user);
diff --git a/src/applications/maniphest/application/PhabricatorApplicationManiphest.php b/src/applications/maniphest/application/PhabricatorApplicationManiphest.php
--- a/src/applications/maniphest/application/PhabricatorApplicationManiphest.php
+++ b/src/applications/maniphest/application/PhabricatorApplicationManiphest.php
@@ -14,8 +14,8 @@
return 'maniphest';
}
- public function getApplicationGroup() {
- return self::GROUP_CORE;
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return true;
}
public function getApplicationOrder() {
diff --git a/src/applications/meta/application/PhabricatorApplicationApplications.php b/src/applications/meta/application/PhabricatorApplicationApplications.php
--- a/src/applications/meta/application/PhabricatorApplicationApplications.php
+++ b/src/applications/meta/application/PhabricatorApplicationApplications.php
@@ -6,6 +6,12 @@
return false;
}
+ public function isLaunchable() {
+ // This application is launchable in the traditional sense, but showing it
+ // on the application launch list is confusing.
+ return false;
+ }
+
public function getBaseURI() {
return '/applications/';
}
diff --git a/src/applications/meta/query/PhabricatorAppSearchEngine.php b/src/applications/meta/query/PhabricatorAppSearchEngine.php
--- a/src/applications/meta/query/PhabricatorAppSearchEngine.php
+++ b/src/applications/meta/query/PhabricatorAppSearchEngine.php
@@ -226,13 +226,17 @@
}
if (!$application->isInstalled()) {
- $item->addIcon('delete', pht('Uninstalled'));
+ $item->addIcon('fa-times', pht('Uninstalled'));
}
if ($application->isBeta()) {
$item->addIcon('fa-star-half-o grey', pht('Beta'));
}
+ if (!$application->isFirstParty()) {
+ $item->addIcon('fa-puzzle-piece', pht('Extension'));
+ }
+
$list->addItem($item);
}
diff --git a/src/applications/meta/query/PhabricatorApplicationQuery.php b/src/applications/meta/query/PhabricatorApplicationQuery.php
--- a/src/applications/meta/query/PhabricatorApplicationQuery.php
+++ b/src/applications/meta/query/PhabricatorApplicationQuery.php
@@ -125,7 +125,7 @@
if ($this->launchable !== null) {
foreach ($apps as $key => $app) {
- if ($app->shouldAppearInLaunchView() != $this->launchable) {
+ if ($app->isLaunchable() != $this->launchable) {
unset($apps[$key]);
}
}
diff --git a/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php b/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php
--- a/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php
+++ b/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php
@@ -22,7 +22,7 @@
return false;
}
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/notification/application/PhabricatorApplicationNotifications.php b/src/applications/notification/application/PhabricatorApplicationNotifications.php
--- a/src/applications/notification/application/PhabricatorApplicationNotifications.php
+++ b/src/applications/notification/application/PhabricatorApplicationNotifications.php
@@ -24,7 +24,7 @@
);
}
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/nuance/application/PhabricatorApplicationNuance.php b/src/applications/nuance/application/PhabricatorApplicationNuance.php
--- a/src/applications/nuance/application/PhabricatorApplicationNuance.php
+++ b/src/applications/nuance/application/PhabricatorApplicationNuance.php
@@ -14,7 +14,7 @@
return true;
}
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
// try to hide this even more for now
return false;
}
diff --git a/src/applications/owners/application/PhabricatorApplicationOwners.php b/src/applications/owners/application/PhabricatorApplicationOwners.php
--- a/src/applications/owners/application/PhabricatorApplicationOwners.php
+++ b/src/applications/owners/application/PhabricatorApplicationOwners.php
@@ -11,7 +11,7 @@
}
public function getShortDescription() {
- return pht('Track Ownership of Source Code');
+ return pht('Own Source Code');
}
public function getTitleGlyph() {
diff --git a/src/applications/passphrase/application/PhabricatorApplicationPassphrase.php b/src/applications/passphrase/application/PhabricatorApplicationPassphrase.php
--- a/src/applications/passphrase/application/PhabricatorApplicationPassphrase.php
+++ b/src/applications/passphrase/application/PhabricatorApplicationPassphrase.php
@@ -7,7 +7,7 @@
}
public function getShortDescription() {
- return pht('Store Passwords and Credentials');
+ return pht('Credential Store');
}
public function getIconName() {
diff --git a/src/applications/people/application/PhabricatorApplicationPeople.php b/src/applications/people/application/PhabricatorApplicationPeople.php
--- a/src/applications/people/application/PhabricatorApplicationPeople.php
+++ b/src/applications/people/application/PhabricatorApplicationPeople.php
@@ -18,6 +18,10 @@
return 'people';
}
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return $viewer->getIsAdmin();
+ }
+
public function getFlavorText() {
return pht('Sort of a social utility.');
}
diff --git a/src/applications/phriction/application/PhabricatorApplicationPhriction.php b/src/applications/phriction/application/PhabricatorApplicationPhriction.php
--- a/src/applications/phriction/application/PhabricatorApplicationPhriction.php
+++ b/src/applications/phriction/application/PhabricatorApplicationPhriction.php
@@ -14,6 +14,10 @@
return 'phriction';
}
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return true;
+ }
+
public function getHelpURI() {
return PhabricatorEnv::getDoclink('Phriction User Guide');
}
diff --git a/src/applications/policy/application/PhabricatorApplicationPolicy.php b/src/applications/policy/application/PhabricatorApplicationPolicy.php
--- a/src/applications/policy/application/PhabricatorApplicationPolicy.php
+++ b/src/applications/policy/application/PhabricatorApplicationPolicy.php
@@ -2,7 +2,7 @@
final class PhabricatorApplicationPolicy extends PhabricatorApplication {
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/project/application/PhabricatorApplicationProject.php b/src/applications/project/application/PhabricatorApplicationProject.php
--- a/src/applications/project/application/PhabricatorApplicationProject.php
+++ b/src/applications/project/application/PhabricatorApplicationProject.php
@@ -7,7 +7,11 @@
}
public function getShortDescription() {
- return pht('Create Groups, Tags, and Projects');
+ return pht('Get Organized');
+ }
+
+ public function isPinnedByDefault(PhabricatorUser $viewer) {
+ return true;
}
public function getBaseURI() {
diff --git a/src/applications/search/application/PhabricatorApplicationSearch.php b/src/applications/search/application/PhabricatorApplicationSearch.php
--- a/src/applications/search/application/PhabricatorApplicationSearch.php
+++ b/src/applications/search/application/PhabricatorApplicationSearch.php
@@ -22,7 +22,7 @@
return 'search';
}
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/settings/application/PhabricatorApplicationSettings.php b/src/applications/settings/application/PhabricatorApplicationSettings.php
--- a/src/applications/settings/application/PhabricatorApplicationSettings.php
+++ b/src/applications/settings/application/PhabricatorApplicationSettings.php
@@ -18,7 +18,7 @@
return false;
}
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/settings/storage/PhabricatorUserPreferences.php b/src/applications/settings/storage/PhabricatorUserPreferences.php
--- a/src/applications/settings/storage/PhabricatorUserPreferences.php
+++ b/src/applications/settings/storage/PhabricatorUserPreferences.php
@@ -66,16 +66,19 @@
$pref_tiles = PhabricatorUserPreferences::PREFERENCE_APP_TILES;
$tiles = $this->getPreference($pref_tiles, array());
+ $full_tile = 'full';
$large = array();
foreach ($apps as $app) {
- $tile = $app->getDefaultTileDisplay($viewer);
+ $show = $app->isPinnedByDefault($viewer);
+ // TODO: This is legacy stuff, clean it up eventually. This approximately
+ // retains the old "tiles" preference.
if (isset($tiles[get_class($app)])) {
- $tile = $tiles[get_class($app)];
+ $show = ($tiles[get_class($app)] == $full_tile);
}
- if ($tile == PhabricatorApplication::TILE_FULL) {
+ if ($show) {
$large[] = get_class($app);
}
}
diff --git a/src/applications/subscriptions/application/PhabricatorApplicationSubscriptions.php b/src/applications/subscriptions/application/PhabricatorApplicationSubscriptions.php
--- a/src/applications/subscriptions/application/PhabricatorApplicationSubscriptions.php
+++ b/src/applications/subscriptions/application/PhabricatorApplicationSubscriptions.php
@@ -2,7 +2,7 @@
final class PhabricatorApplicationSubscriptions extends PhabricatorApplication {
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/transactions/application/PhabricatorApplicationTransactions.php b/src/applications/transactions/application/PhabricatorApplicationTransactions.php
--- a/src/applications/transactions/application/PhabricatorApplicationTransactions.php
+++ b/src/applications/transactions/application/PhabricatorApplicationTransactions.php
@@ -2,7 +2,7 @@
final class PhabricatorApplicationTransactions extends PhabricatorApplication {
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/typeahead/application/PhabricatorApplicationTypeahead.php b/src/applications/typeahead/application/PhabricatorApplicationTypeahead.php
--- a/src/applications/typeahead/application/PhabricatorApplicationTypeahead.php
+++ b/src/applications/typeahead/application/PhabricatorApplicationTypeahead.php
@@ -13,7 +13,7 @@
);
}
- public function shouldAppearInLaunchView() {
+ public function isLaunchable() {
return false;
}
diff --git a/src/applications/uiexample/application/PhabricatorApplicationUIExamples.php b/src/applications/uiexample/application/PhabricatorApplicationUIExamples.php
--- a/src/applications/uiexample/application/PhabricatorApplicationUIExamples.php
+++ b/src/applications/uiexample/application/PhabricatorApplicationUIExamples.php
@@ -7,7 +7,7 @@
}
public function getShortDescription() {
- return pht('Phabricator Developer UI Examples');
+ return pht('Developer UI Examples');
}
public function getIconName() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 31, 10:43 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6745082
Default Alt Text
D9358.id22314.diff (23 KB)
Attached To
Mode
D9358: (Redesign) Clean up older "Tile" code
Attached
Detach File
Event Timeline
Log In to Comment