From df0cacab2ac355f8dcca2d24309aee4c776a043a Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 30 Nov 2022 22:47:53 +0530 Subject: [PATCH 01/11] Show icon for the Beta apps for Dashboard --- lib/Util.php | 22 +++++++++++++++++++++- src/components/AllApps.vue | 17 +++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/lib/Util.php b/lib/Util.php index 81fa01f..12cdb1e 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -96,7 +96,8 @@ class Util { $office_entries = $this->getOnlyOfficeEntries(); $entries = array_merge($entries, $office_entries); } - + $betaGroupName = $this->config->getSystemValue("beta_group_name"); + $isBeta = $this->checkIsBetaUser(); foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { $entry["style"] = ""; @@ -107,6 +108,15 @@ class Util { } $entry["iconOffsetY"] = 0; + $entry["betaClass"] = ''; + if ($isBeta) { + $enabledValue = $this->config->getAppValue($entry['id'], 'enabled', 'no'); + if ($enabledValue !== 'no' && $enabledValue !== 'yes') { + if (strpos($enabledValue, $betaGroupName)) { + $entry["betaClass"] = 'beta-app'; + } + } + } $entriesByHref[$entry["href"]] = $entry; } /* @@ -144,4 +154,14 @@ class Util { } return $this->groupManager->getUserGroupIds($user); } + + private function checkIsBetaUser() { + $user = $this->userSession->getUser(); + $usersGroups = $this->groupManager->getUserGroupIds($user); + $betaGroupName = $this->config->getSystemValue("beta_group_name"); + if (in_array($betaGroupName, $usersGroups)) { + return true; + } + return false; + } } diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index b46a7e5..dc67f91 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -40,6 +40,7 @@ @@ -51,6 +52,7 @@ @@ -305,4 +307,19 @@ export default { width:30%; height: 1.2em; } +a.item.beta-app { + position: relative; +} +.beta-app:after { + content: "BETA"; + position: absolute; + top: 0; + background-color: #007fff; + color: white; + font-size: 12px; + border-radius: 10px; + line-height: normal; + padding: 2px 10px; + font-weight: 800; +} -- GitLab From 99ef38c7829e801b3371d9d47ac741a39fc18382 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 30 Nov 2022 22:51:25 +0530 Subject: [PATCH 02/11] lint changes --- src/components/AllApps.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index dc67f91..61cffca 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -316,7 +316,7 @@ a.item.beta-app { top: 0; background-color: #007fff; color: white; - font-size: 12px; + font-size: 12px; border-radius: 10px; line-height: normal; padding: 2px 10px; -- GitLab From 3bd7396b93208ef6dee9b2fa22ee6d08789b765f Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 30 Nov 2022 22:58:45 +0530 Subject: [PATCH 03/11] util fixes --- lib/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util.php b/lib/Util.php index 12cdb1e..9b6f378 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -115,7 +115,7 @@ class Util { if (strpos($enabledValue, $betaGroupName)) { $entry["betaClass"] = 'beta-app'; } - } + } } $entriesByHref[$entry["href"]] = $entry; } -- GitLab From d97273b60af4a7558b10a4c1da1629412a3e491f Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 30 Nov 2022 23:01:32 +0530 Subject: [PATCH 04/11] added top --- src/components/AllApps.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index 61cffca..05fac8e 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -313,7 +313,7 @@ a.item.beta-app { .beta-app:after { content: "BETA"; position: absolute; - top: 0; + top: 15%; background-color: #007fff; color: white; font-size: 12px; -- GitLab From 5c38315fa8c8cdb715ba84f0b6316582915ebeaa Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 1 Dec 2022 10:47:25 +0530 Subject: [PATCH 05/11] feedback --- lib/Util.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 9b6f378..6fb854e 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -97,7 +97,7 @@ class Util { $entries = array_merge($entries, $office_entries); } $betaGroupName = $this->config->getSystemValue("beta_group_name"); - $isBeta = $this->checkIsBetaUser(); + $isBeta = $this->isBetaUser(); foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { $entry["style"] = ""; @@ -110,9 +110,9 @@ class Util { $entry["iconOffsetY"] = 0; $entry["betaClass"] = ''; if ($isBeta) { - $enabledValue = $this->config->getAppValue($entry['id'], 'enabled', 'no'); - if ($enabledValue !== 'no' && $enabledValue !== 'yes') { - if (strpos($enabledValue, $betaGroupName)) { + $appEnabledGroups = $this->config->getAppValue($entry['id'], 'enabled', 'no'); + if ($appEnabledGroups !== 'no' && $appEnabledGroups !== 'yes') { + if (strpos($appEnabledGroups, $betaGroupName)) { $entry["betaClass"] = 'beta-app'; } } @@ -136,6 +136,9 @@ class Util { unset($entriesByHref['/apps/dashboard/']); unset($entriesByHref['/apps/ecloud-dashboard/']); unset($entriesByHref['']); + if ($isBeta) { + unset($entriesByHref['/apps/rainloop/']); + } $entries = array_values($entriesByHref); return array( 'apps' => $entries ); @@ -155,7 +158,7 @@ class Util { return $this->groupManager->getUserGroupIds($user); } - private function checkIsBetaUser() { + private function isBetaUser() { $user = $this->userSession->getUser(); $usersGroups = $this->groupManager->getUserGroupIds($user); $betaGroupName = $this->config->getSystemValue("beta_group_name"); -- GitLab From dcbcb11c5d815d09938bdc786b06812b1a30f564 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 1 Dec 2022 10:49:07 +0530 Subject: [PATCH 06/11] feedback --- lib/Util.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 6fb854e..8267adf 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -162,9 +162,6 @@ class Util { $user = $this->userSession->getUser(); $usersGroups = $this->groupManager->getUserGroupIds($user); $betaGroupName = $this->config->getSystemValue("beta_group_name"); - if (in_array($betaGroupName, $usersGroups)) { - return true; - } - return false; + return in_array($betaGroupName, $usersGroups); } } -- GitLab From 721ed0a68fffdc8d17a716feadd840c2b5850625 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 1 Dec 2022 11:24:02 +0530 Subject: [PATCH 07/11] added condition of isbeta and issnapppyenabled --- lib/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util.php b/lib/Util.php index 8267adf..7c10e65 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -136,7 +136,7 @@ class Util { unset($entriesByHref['/apps/dashboard/']); unset($entriesByHref['/apps/ecloud-dashboard/']); unset($entriesByHref['']); - if ($isBeta) { + if ($isBeta && array_key_exists("/apps/snappymail/", $entriesByHref)) { unset($entriesByHref['/apps/rainloop/']); } $entries = array_values($entriesByHref); -- GitLab From 0018f17342529e240cc9682bcbe026b485cc3ba6 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 1 Dec 2022 17:09:55 +0530 Subject: [PATCH 08/11] str_contains added --- lib/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util.php b/lib/Util.php index 7c10e65..28ee937 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -112,7 +112,7 @@ class Util { if ($isBeta) { $appEnabledGroups = $this->config->getAppValue($entry['id'], 'enabled', 'no'); if ($appEnabledGroups !== 'no' && $appEnabledGroups !== 'yes') { - if (strpos($appEnabledGroups, $betaGroupName)) { + if (str_contains($appEnabledGroups, $betaGroupName)) { $entry["betaClass"] = 'beta-app'; } } -- GitLab From b47f9c3ce6e6e5bda1dc824b0d25ac421c01c33d Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 1 Dec 2022 19:46:29 +0530 Subject: [PATCH 09/11] isingroup changed --- lib/Util.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 28ee937..32a2b1f 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -159,9 +159,8 @@ class Util { } private function isBetaUser() { - $user = $this->userSession->getUser(); - $usersGroups = $this->groupManager->getUserGroupIds($user); + $uid = $this->userSession->getUser()->getUID(); $betaGroupName = $this->config->getSystemValue("beta_group_name"); - return in_array($betaGroupName, $usersGroups); + return $this->groupManager->isInGroup($uid, $betaGroupName); } } -- GitLab From a6652b4dc85cdf025138b7af6e25c2dd84177ee8 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 5 Dec 2022 23:45:57 +0530 Subject: [PATCH 10/11] added class in vue --- lib/Util.php | 12 ++++-------- src/components/AllApps.vue | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 32a2b1f..773521c 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -108,14 +108,10 @@ class Util { } $entry["iconOffsetY"] = 0; - $entry["betaClass"] = ''; - if ($isBeta) { - $appEnabledGroups = $this->config->getAppValue($entry['id'], 'enabled', 'no'); - if ($appEnabledGroups !== 'no' && $appEnabledGroups !== 'yes') { - if (str_contains($appEnabledGroups, $betaGroupName)) { - $entry["betaClass"] = 'beta-app'; - } - } + $entry["is_beta"] = ''; + $appEnabledGroups = $this->config->getAppValue($entry['id'], 'enabled', 'no'); + if ($isBeta && str_contains($appEnabledGroups, $betaGroupName)) { + $entry["is_beta"] = 'beta-app'; } $entriesByHref[$entry["href"]] = $entry; } diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index 05fac8e..cfd86c7 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -40,7 +40,7 @@ @@ -52,7 +52,7 @@ -- GitLab From c267d1fd74f40a8a571f913fdc84f48673f075d6 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 5 Dec 2022 23:50:06 +0530 Subject: [PATCH 11/11] is_beta --- lib/Util.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 773521c..bf176a1 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -108,10 +108,10 @@ class Util { } $entry["iconOffsetY"] = 0; - $entry["is_beta"] = ''; + $entry["is_beta"] = 0; $appEnabledGroups = $this->config->getAppValue($entry['id'], 'enabled', 'no'); if ($isBeta && str_contains($appEnabledGroups, $betaGroupName)) { - $entry["is_beta"] = 'beta-app'; + $entry["is_beta"] = 1; } $entriesByHref[$entry["href"]] = $entry; } -- GitLab