-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
↔️ Define and implement strategy for persisting order of apps in top bar. (Database?) #40254
Comments
Pointers: Order is stored in info.xml for each app, in navigations/navigation/order. |
POC: diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index ac6f16190dc..31f6b74691a 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -290,6 +290,7 @@ class NavigationManager implements INavigationManager {
$apps = $this->appManager->getInstalledApps();
}
+ $user = $this->userSession->getUser();
foreach ($apps as $app) {
if (!$this->userSession->isLoggedIn() && !$this->appManager->isEnabledForUser($app, $this->userSession->getUser())) {
continue;
@@ -315,7 +316,8 @@ class NavigationManager implements INavigationManager {
}
$l = $this->l10nFac->get($app);
$id = $nav['id'] ?? $app . ($key === 0 ? '' : $key);
- $order = isset($nav['order']) ? $nav['order'] : 100;
+ $order = (int)$this->config->getUserValue($user?->getUID(), 'core', 'apporder_'.$app.'_'.$key, '0');
+ $order = $order ?: $nav['order'] ?? 100;
$type = $nav['type'];
$route = !empty($nav['route']) ? $this->urlGenerator->linkToRoute($nav['route']) : '';
$icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg'; Note: |
Note: defaultapp is already picked in |
On the format stored in the user configuration: Basically 3 possibilities:
I think all in all second option is the best one. If needed we can add occ command for this but it does not seem that important. |
@come-nc I agree that nr.2 seems best for the current scope 👍 |
subtask to #40241
The text was updated successfully, but these errors were encountered: