From 196d19be255e240e54d03ef04be468513e6a771a Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Thu, 2 Mar 2023 17:57:53 +0530 Subject: [PATCH 1/6] remove rainloop entry --- appinfo/info.xml | 2 +- lib/Util.php | 16 +--------------- package.json | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 64b1033..f948d7d 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Murena dashboard Murena Cloud Dashboard - 1.4.0 + 1.4.1 agpl Murena EcloudDashboard diff --git a/lib/Util.php b/lib/Util.php index 13839c0..5306c1f 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -28,7 +28,7 @@ class Util { /** @var IUserSession */ private $userSession; - private const DEFAULT_ORDER = array("/apps/files/", "/apps/rainloop/", "/apps/contacts/", "/apps/calendar/", "/apps/notes/", "/apps/tasks/", "/apps/photos/"); + private const DEFAULT_ORDER = array("/apps/files/", "/apps/snappymail/", "/apps/contacts/", "/apps/calendar/", "/apps/notes/", "/apps/tasks/", "/apps/photos/"); public function __construct( IConfig $config, INavigationManager $navigationManager, @@ -87,16 +87,6 @@ class Util { } else { $order = json_decode($order_raw); } - - $isBeta = $this->isBetaUser(); - // Replace rainloop entry with snappymail at same position - if ($isBeta && $this->appManager->isEnabledForUser("snappymail")) { - if (array_keys($order, '/apps/snappymail/')) { - unset($order['/apps/rainloop/']); - } else { - $order[array_search('/apps/rainloop/', $order)] = '/apps/snappymail/'; - } - } return $order; } public function getAppEntries() { @@ -110,10 +100,6 @@ class Util { $betaGroupName = $this->config->getSystemValue("beta_group_name"); $isBeta = $this->isBetaUser(); foreach ($entries as &$entry) { - // skip rainloop entry if snappymail is enabled - if ($entry["id"] === "rainloop" && $isBeta && $this->appManager->isEnabledForUser("snappymail")) { - continue; - } if (strpos($entry["id"], "external_index") !== 0) { $entry["style"] = ""; $entry["target"] = ""; diff --git a/package.json b/package.json index 411b665..be185e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ecloud-dashboard", - "version": "1.0.1", + "version": "1.4.0", "private": true, "description": "Place this app in **nextcloud/custom_apps/**", "main": "js/main.js", -- GitLab From 17682ee9798741ab11e078aa3e430085b24f4b8a Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Thu, 2 Mar 2023 18:36:39 +0530 Subject: [PATCH 2/6] fix version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be185e8..059c6cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ecloud-dashboard", - "version": "1.4.0", + "version": "1.4.1", "private": true, "description": "Place this app in **nextcloud/custom_apps/**", "main": "js/main.js", -- GitLab From 874cb1ee2bb7925c8f6354fd6465a65018e302d1 Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Thu, 2 Mar 2023 18:59:25 +0530 Subject: [PATCH 3/6] replace rainloop --- lib/Util.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 5306c1f..92d9bac 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -83,11 +83,14 @@ class Util { $order_raw = !$order_raw ? $this->config->getUserValue($this->userId, 'apporder', 'order') : $order_raw; // If order raw is still empty, return empty array if (!$order_raw) { - $order = self::DEFAULT_ORDER; - } else { - $order = json_decode($order_raw); + return self::DEFAULT_ORDER; + } + + if (str_contains("/apps/rainloop/", $order_raw)) { + str_replace("/apps/rainloop/", "/apps/snappymail/", $order_raw); } - return $order; + + return json_decode($order_raw); } public function getAppEntries() { $entries = array_values($this->navigationManager->getAll()); -- GitLab From 879be6f616e8bc47ac2acf612663b4bee811e553 Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Thu, 2 Mar 2023 19:02:33 +0530 Subject: [PATCH 4/6] lint fix --- lib/Util.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 92d9bac..49cbf3d 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -84,10 +84,10 @@ class Util { // If order raw is still empty, return empty array if (!$order_raw) { return self::DEFAULT_ORDER; - } + } if (str_contains("/apps/rainloop/", $order_raw)) { - str_replace("/apps/rainloop/", "/apps/snappymail/", $order_raw); + $order_raw = str_replace("/apps/rainloop/", "/apps/snappymail/", $order_raw); } return json_decode($order_raw); -- GitLab From c8b2abfbbc9d22d7410c74d0d3a4391945e222a7 Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Thu, 2 Mar 2023 23:55:48 +0530 Subject: [PATCH 5/6] change default order --- lib/Util.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 49cbf3d..8fb2cb5 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -85,11 +85,6 @@ class Util { if (!$order_raw) { return self::DEFAULT_ORDER; } - - if (str_contains("/apps/rainloop/", $order_raw)) { - $order_raw = str_replace("/apps/rainloop/", "/apps/snappymail/", $order_raw); - } - return json_decode($order_raw); } public function getAppEntries() { -- GitLab From addf7f713a66fce32db826520282daec13901198 Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Fri, 3 Mar 2023 13:41:55 +0530 Subject: [PATCH 6/6] declare variable --- lib/Controller/PageController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index e5156df..c81441f 100755 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -20,6 +20,8 @@ class PageController extends Controller { /** @var IUserSession */ private $userSession; + private $util; + public function __construct($appName, IRequest $request, IInitialState $initialState, IConfig $config, IUserSession $userSession, Util $util) { $this->initialState = $initialState; $this->config = $config; -- GitLab