From 99ea15d4c81c4049559a738b93e7bb9a689695b8 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 13 Jan 2023 10:55:43 +0530 Subject: [PATCH 01/17] list all beta features in experimental --- css/style.css | 16 +++++++++++++++- l10n/de.js | 3 ++- l10n/de.json | 3 ++- l10n/en.js | 3 ++- l10n/en.json | 3 ++- l10n/es.js | 3 ++- l10n/es.json | 3 ++- l10n/fr.js | 3 ++- l10n/fr.json | 3 ++- l10n/it.js | 3 ++- l10n/it.json | 3 ++- lib/Settings/BetaUserSetting.php | 19 +++++++++++++++++-- templates/beta_user_setting.php | 18 ++++++++++++++++++ 13 files changed, 70 insertions(+), 13 deletions(-) diff --git a/css/style.css b/css/style.css index 81c48263..09f0b98d 100644 --- a/css/style.css +++ b/css/style.css @@ -49,4 +49,18 @@ .color-red { color: red; -} \ No newline at end of file +} + +ul.beta-apps { + list-style: none; + margin-left: 0; + padding-left: 1em; +} + +ul.beta-apps > li:before { + display: inline-block; + content: '-'; + width: 1em; + margin-left: -1em; +} + diff --git a/l10n/de.js b/l10n/de.js index 42d4d045..17cc4feb 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -32,6 +32,7 @@ OC.L10N.register( "Submit": "Einreichen", "Experimental": "Experimentelle", "Title is mandatory.": "Der Titel ist obligatorisch.", - "Description is mandatory.": "Die Beschreibung ist obligatorisch." + "Description is mandatory.": "Die Beschreibung ist obligatorisch.", + "Here is the list of currently available beta features:": "Hier ist die Liste der derzeit verfügbaren Beta-Funktionen:" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index 878e48f3..a0cf4e19 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -31,7 +31,8 @@ "Submit": "Einreichen", "Experimental": "Experimentelle", "Title is mandatory.": "Der Titel ist obligatorisch.", - "Description is mandatory.": "Die Beschreibung ist obligatorisch." + "Description is mandatory.": "Die Beschreibung ist obligatorisch.", + "Here is the list of currently available beta features:": "Hier ist die Liste der derzeit verfügbaren Beta-Funktionen:" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/en.js b/l10n/en.js index 396618d6..323d5a0d 100644 --- a/l10n/en.js +++ b/l10n/en.js @@ -32,6 +32,7 @@ OC.L10N.register( "Submit": "Submit", "Experimental": "Experimental", "Title is mandatory.": "Title is mandatory.", - "Description is mandatory.": "Description is mandatory." + "Description is mandatory.": "Description is mandatory.", + "Here is the list of currently available beta features:": "Here is the list of currently available beta features:" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en.json b/l10n/en.json index f07952bb..f4232e51 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -31,7 +31,8 @@ "Submit": "Submit", "Experimental": "Experimental", "Title is mandatory.": "Title is mandatory.", - "Description is mandatory.": "Description is mandatory." + "Description is mandatory.": "Description is mandatory.", + "Here is the list of currently available beta features:": "Here is the list of currently available beta features:" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/es.js b/l10n/es.js index d5187361..56a8a041 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -33,6 +33,7 @@ OC.L10N.register( "Submit": "Envíe", "Experimental": "Experimento", "Title is mandatory.": "El título es obligatorio.", - "Description is mandatory.": "La descripción es obligatoria." + "Description is mandatory.": "La descripción es obligatoria.", + "Here is the list of currently available beta features:": "Esta es la lista de funciones de la versión beta disponibles actualmente:" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index 68254b13..4db89166 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -31,7 +31,8 @@ "Submit": "Envíe", "Experimental": "Experimento", "Title is mandatory.": "El título es obligatorio.", - "Description is mandatory.": "La descripción es obligatoria." + "Description is mandatory.": "La descripción es obligatoria.", + "Here is the list of currently available beta features:": "Esta es la lista de funciones de la versión beta disponibles actualmente:" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/fr.js b/l10n/fr.js index ba3d7a76..6cbd0393 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -32,6 +32,7 @@ OC.L10N.register( "Submit": "Soumettre", "Experimental": "Expérimental", "Title is mandatory.": "Le titre est obligatoire.", - "Description is mandatory.": "La description est obligatoire." + "Description is mandatory.": "La description est obligatoire.", + "Here is the list of currently available beta features:": "Voici la liste des fonctionnalités de la version bêta actuellement disponibles :" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index 1a674afb..a91d2a2d 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -31,7 +31,8 @@ "Submit": "Soumettre", "Experimental": "Expérimental", "Title is mandatory.": "Le titre est obligatoire.", - "Description is mandatory.": "La description est obligatoire." + "Description is mandatory.": "La description est obligatoire.", + "Here is the list of currently available beta features:": "Voici la liste des fonctionnalités de la version bêta actuellement disponibles :" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/it.js b/l10n/it.js index dda11d0d..8a53507a 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -32,6 +32,7 @@ OC.L10N.register( "Submit": "Invia", "Experimental": "Sperimentale", "Title is mandatory.": "Il titolo è obbligatorio.", - "Description is mandatory.": "La descrizione è obbligatoria." + "Description is mandatory.": "La descrizione è obbligatoria.", + "Here is the list of currently available beta features:": "Ecco l'elenco delle funzioni beta attualmente disponibili:" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/it.json b/l10n/it.json index d92b0e36..257703bc 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -31,7 +31,8 @@ "Submit": "Invia", "Experimental": "Sperimentale", "Title is mandatory.": "Il titolo è obbligatorio.", - "Description is mandatory.": "La descrizione è obbligatoria." + "Description is mandatory.": "La descrizione è obbligatoria.", + "Here is the list of currently available beta features:": "Ecco l'elenco delle funzioni beta attualmente disponibili:" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index cbb37c65..149ae1a2 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -10,6 +10,7 @@ use OCP\IUserSession; use OCP\Settings\ISettings; use OCP\Util; use OCP\IConfig; +use OCP\App\IAppManager; class BetaUserSetting implements ISettings { /** @var IUserSession */ @@ -23,18 +24,22 @@ class BetaUserSetting implements ISettings { private $appName; + private $appManager; + public function __construct( $appName, IUserSession $userSession, IGroupManager $groupManager, Util $util, - IConfig $config + IConfig $config, + IAppManager $appManager ) { $this->userSession = $userSession; $this->groupManager = $groupManager; $this->appName = $appName; $this->config = $config; $this->util = $util; + $this->appManager = $appManager; } public function getForm(): TemplateResponse { @@ -46,7 +51,17 @@ class BetaUserSetting implements ISettings { $isBeta = $this->groupManager->isInGroup($uid, $betaGroupName); } $this->util->addScript($this->appName, $this->appName . '-beta-user-setting'); - $parameters = ['isBeta' => $isBeta, 'groupExists' => $groupExists]; + $group = $this->groupManager->get($betaGroupName); + $betaGroupApps = $this->appManager->getEnabledAppsForGroup($group); + $betaApps = []; + foreach ($betaGroupApps as $app) { + $appEnabledGroups = $this->config->getAppValue($app, 'enabled', 'no'); + if (str_contains($appEnabledGroups, $betaGroupName)) { + $info = $this->appManager->getAppInfo($app); + $betaApps[] = $info['name']; + } + } + $parameters = ['isBeta' => $isBeta, 'groupExists' => $groupExists, 'betaApps' => $betaApps]; return new TemplateResponse($this->appName, 'beta_user_setting', $parameters, ''); } diff --git a/templates/beta_user_setting.php b/templates/beta_user_setting.php index 6fdb6b78..9892ee2b 100644 --- a/templates/beta_user_setting.php +++ b/templates/beta_user_setting.php @@ -11,6 +11,14 @@ style('ecloud-accounts', 'style');

t('Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.')); ?>

+
+

t('Here is the list of currently available beta features:')) ?>

+ +

@@ -42,6 +50,16 @@ style('ecloud-accounts', 'style');

+ +
+

t('Here is the list of currently available beta features:')) ?>

+ +
+

t('Beta program is not available at the moment.')); ?>

-- GitLab From 9e16ecdab2203343ff05281608570c0f857a3844 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 13 Jan 2023 11:10:20 +0530 Subject: [PATCH 02/17] added two different templates --- lib/Settings/BetaUserSetting.php | 6 ++- templates/become_beta_user.php | 28 +++++++++++++ templates/beta_user_setting.php | 68 -------------------------------- templates/opt_out_beta_user.php | 49 +++++++++++++++++++++++ 4 files changed, 82 insertions(+), 69 deletions(-) create mode 100644 templates/become_beta_user.php delete mode 100644 templates/beta_user_setting.php create mode 100644 templates/opt_out_beta_user.php diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index 149ae1a2..fb00d4c2 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -62,7 +62,11 @@ class BetaUserSetting implements ISettings { } } $parameters = ['isBeta' => $isBeta, 'groupExists' => $groupExists, 'betaApps' => $betaApps]; - return new TemplateResponse($this->appName, 'beta_user_setting', $parameters, ''); + if($isBeta){ + return new TemplateResponse($this->appName, 'opt_out_beta_user', $parameters, ''); + }else{ + return new TemplateResponse($this->appName, 'become_beta_user', $parameters, ''); + } } public function getSection(): ?string { diff --git a/templates/become_beta_user.php b/templates/become_beta_user.php new file mode 100644 index 00000000..7f4f1c28 --- /dev/null +++ b/templates/become_beta_user.php @@ -0,0 +1,28 @@ + + +
+
+
+

t('Do you want to become a beta user?')); ?>

+

t('You want to experiment new features ahead of the others and provide feedback on them before and if they\'re released? This section is made for you!')) ?>

+

t('To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.')) ?>

+
+
+ + +
+
+
+
+

t('Here is the list of currently available beta features:')) ?>

+
    + +
  • + +
+
+
+
+
diff --git a/templates/beta_user_setting.php b/templates/beta_user_setting.php deleted file mode 100644 index 9892ee2b..00000000 --- a/templates/beta_user_setting.php +++ /dev/null @@ -1,68 +0,0 @@ - - -
-
-
- - -

t('You are part of the beta users.')); ?>

-

- t('Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.')); ?> -

-
-

t('Here is the list of currently available beta features:')) ?>

-
    - -
  • - -
-
-
-

- -

-

- -

-

- -

-

- -

-

- -

-
-
-

t('Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!')) ?>

- -

t('Do you want to become a beta user?')); ?>

-

t('You want to experiment new features ahead of the others and provide feedback on them before and if they\'re released? This section is made for you!')) ?>

-

t('To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.')) ?>

- -
-
- - -
-
-
- -
-

t('Here is the list of currently available beta features:')) ?>

-
    - -
  • - -
-
- - -

t('Beta program is not available at the moment.')); ?>

- -
-
-
diff --git a/templates/opt_out_beta_user.php b/templates/opt_out_beta_user.php new file mode 100644 index 00000000..37edf8c5 --- /dev/null +++ b/templates/opt_out_beta_user.php @@ -0,0 +1,49 @@ + + +
+
+
+

t('You are part of the beta users.')); ?>

+

+ t('Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.')); ?> +

+
+

t('Here is the list of currently available beta features:')) ?>

+
    + +
  • + +
+
+
+

+ +

+

+ +

+

+ +

+

+ +

+

+ +

+
+
+

t('Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!')) ?>

+ +
+
+ + +
+
+
+
+
+
-- GitLab From 407461685255376d904fc702aa41dfdd27868db5 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 13 Jan 2023 11:15:48 +0530 Subject: [PATCH 03/17] refactoring code --- lib/Settings/BetaUserSetting.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index fb00d4c2..9c6acaac 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -44,11 +44,10 @@ class BetaUserSetting implements ISettings { public function getForm(): TemplateResponse { $uid = $this->userSession->getUser()->getUID(); - $isBeta = 0; $betaGroupName = $this->config->getSystemValue("beta_group_name"); $groupExists = $this->groupManager->groupExists($betaGroupName); - if ($groupExists) { - $isBeta = $this->groupManager->isInGroup($uid, $betaGroupName); + if (! $groupExists) { + return new TemplateResponse($this->appName, 'opt_out_beta_user', [], ''); } $this->util->addScript($this->appName, $this->appName . '-beta-user-setting'); $group = $this->groupManager->get($betaGroupName); @@ -61,11 +60,10 @@ class BetaUserSetting implements ISettings { $betaApps[] = $info['name']; } } - $parameters = ['isBeta' => $isBeta, 'groupExists' => $groupExists, 'betaApps' => $betaApps]; - if($isBeta){ - return new TemplateResponse($this->appName, 'opt_out_beta_user', $parameters, ''); - }else{ - return new TemplateResponse($this->appName, 'become_beta_user', $parameters, ''); + if ($this->groupManager->isInGroup($uid, $betaGroupName)) { + return new TemplateResponse($this->appName, 'opt_out_beta_user', ['betaApps' => $betaApps], ''); + } else { + return new TemplateResponse($this->appName, 'become_beta_user', ['betaApps' => $betaApps], ''); } } -- GitLab From 08bfae6e2c4e265d1b177741334627fa88a5f909 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 13 Jan 2023 11:17:02 +0530 Subject: [PATCH 04/17] added no_group_exists --- lib/Settings/BetaUserSetting.php | 2 +- templates/no_group_exists.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 templates/no_group_exists.php diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index 9c6acaac..5fc41872 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -47,7 +47,7 @@ class BetaUserSetting implements ISettings { $betaGroupName = $this->config->getSystemValue("beta_group_name"); $groupExists = $this->groupManager->groupExists($betaGroupName); if (! $groupExists) { - return new TemplateResponse($this->appName, 'opt_out_beta_user', [], ''); + return new TemplateResponse($this->appName, 'no_group_exists', [], ''); } $this->util->addScript($this->appName, $this->appName . '-beta-user-setting'); $group = $this->groupManager->get($betaGroupName); diff --git a/templates/no_group_exists.php b/templates/no_group_exists.php new file mode 100644 index 00000000..0b858dd1 --- /dev/null +++ b/templates/no_group_exists.php @@ -0,0 +1,11 @@ + + +
+
+
+

t('Beta program is not available at the moment.')); ?>

+
+
+
-- GitLab From a6f4f9a153192cb80d38b191eb6cdf03686f8d69 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 20 Jan 2023 00:16:15 +0530 Subject: [PATCH 05/17] removed else --- lib/Settings/BetaUserSetting.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index 5fc41872..3ce97869 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -62,9 +62,8 @@ class BetaUserSetting implements ISettings { } if ($this->groupManager->isInGroup($uid, $betaGroupName)) { return new TemplateResponse($this->appName, 'opt_out_beta_user', ['betaApps' => $betaApps], ''); - } else { - return new TemplateResponse($this->appName, 'become_beta_user', ['betaApps' => $betaApps], ''); - } + } + return new TemplateResponse($this->appName, 'become_beta_user', ['betaApps' => $betaApps], ''); } public function getSection(): ?string { -- GitLab From 04ee71415802da2cf85b3bd78b253d02fc2c778b Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 20 Jan 2023 00:19:03 +0530 Subject: [PATCH 06/17] apps to app --- templates/become_beta_user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/become_beta_user.php b/templates/become_beta_user.php index 7f4f1c28..8dde68a5 100644 --- a/templates/become_beta_user.php +++ b/templates/become_beta_user.php @@ -18,8 +18,8 @@ style('ecloud-accounts', 'style');

t('Here is the list of currently available beta features:')) ?>

    - -
  • + +
-- GitLab From 59f30958fb3926c8ec12ed9657925d87de412b5b Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 20 Jan 2023 00:19:57 +0530 Subject: [PATCH 07/17] apps to app --- templates/opt_out_beta_user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/opt_out_beta_user.php b/templates/opt_out_beta_user.php index 37edf8c5..38f6b0e2 100644 --- a/templates/opt_out_beta_user.php +++ b/templates/opt_out_beta_user.php @@ -12,8 +12,8 @@ style('ecloud-accounts', 'style');

t('Here is the list of currently available beta features:')) ?>

    - -
  • + +
-- GitLab From 027f8143259f739d837a49c1935d0a384ea97e51 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Fri, 20 Jan 2023 13:28:44 +0530 Subject: [PATCH 08/17] indent --- lib/Settings/BetaUserSetting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index 3ce97869..dbfdee82 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -62,7 +62,7 @@ class BetaUserSetting implements ISettings { } if ($this->groupManager->isInGroup($uid, $betaGroupName)) { return new TemplateResponse($this->appName, 'opt_out_beta_user', ['betaApps' => $betaApps], ''); - } + } return new TemplateResponse($this->appName, 'become_beta_user', ['betaApps' => $betaApps], ''); } -- GitLab From 5548d3837a0adeed790c90360def66e4439af4d9 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 23 Jan 2023 15:32:03 +0530 Subject: [PATCH 09/17] added condition for getSection --- lib/Settings/BetaUserSetting.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index dbfdee82..2c343f16 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -45,10 +45,6 @@ class BetaUserSetting implements ISettings { public function getForm(): TemplateResponse { $uid = $this->userSession->getUser()->getUID(); $betaGroupName = $this->config->getSystemValue("beta_group_name"); - $groupExists = $this->groupManager->groupExists($betaGroupName); - if (! $groupExists) { - return new TemplateResponse($this->appName, 'no_group_exists', [], ''); - } $this->util->addScript($this->appName, $this->appName . '-beta-user-setting'); $group = $this->groupManager->get($betaGroupName); $betaGroupApps = $this->appManager->getEnabledAppsForGroup($group); @@ -67,6 +63,11 @@ class BetaUserSetting implements ISettings { } public function getSection(): ?string { + $betaGroupName = $this->config->getSystemValue("beta_group_name"); + $groupExists = $this->groupManager->groupExists($betaGroupName); + if (! $groupExists) { + return null; + } return 'beta-user'; } -- GitLab From 123c483a91266a4693967f653527dd46a28911ae Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 23 Jan 2023 15:33:40 +0530 Subject: [PATCH 10/17] remove nogroup template --- templates/no_group_exists.php | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 templates/no_group_exists.php diff --git a/templates/no_group_exists.php b/templates/no_group_exists.php deleted file mode 100644 index 0b858dd1..00000000 --- a/templates/no_group_exists.php +++ /dev/null @@ -1,11 +0,0 @@ - - -
-
-
-

t('Beta program is not available at the moment.')); ?>

-
-
-
-- GitLab From 7661fcb97e019f76d119bb922f4326c54c388071 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 25 Jan 2023 10:51:54 +0530 Subject: [PATCH 11/17] added logger --- lib/Settings/BetaUserSetting.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index 2c343f16..3a85d1e7 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -11,6 +11,7 @@ use OCP\Settings\ISettings; use OCP\Util; use OCP\IConfig; use OCP\App\IAppManager; +use OCP\ILogger; class BetaUserSetting implements ISettings { /** @var IUserSession */ @@ -26,13 +27,17 @@ class BetaUserSetting implements ISettings { private $appManager; + /** @var ILogger */ + private $logger; + public function __construct( $appName, IUserSession $userSession, IGroupManager $groupManager, Util $util, IConfig $config, - IAppManager $appManager + IAppManager $appManager, + ILogger $logger ) { $this->userSession = $userSession; $this->groupManager = $groupManager; @@ -40,6 +45,7 @@ class BetaUserSetting implements ISettings { $this->config = $config; $this->util = $util; $this->appManager = $appManager; + $this->logger = $logger; } public function getForm(): TemplateResponse { @@ -64,8 +70,13 @@ class BetaUserSetting implements ISettings { public function getSection(): ?string { $betaGroupName = $this->config->getSystemValue("beta_group_name"); + if (empty($betaGroupName)) { + $this->logger->error('Beta group name is not configured.', ['app' => 'ecloud-accounts']); + return null; + } $groupExists = $this->groupManager->groupExists($betaGroupName); if (! $groupExists) { + $this->logger->error('Beta group is not available.', ['app' => 'ecloud-accounts']); return null; } return 'beta-user'; -- GitLab From 5d305ebae3379e2f57a180dd0203e1f31f01144c Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 26 Jan 2023 11:35:27 +0530 Subject: [PATCH 12/17] added classname --- templates/become_beta_user.php | 4 ++-- templates/opt_out_beta_user.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/become_beta_user.php b/templates/become_beta_user.php index 8dde68a5..478fd06a 100644 --- a/templates/become_beta_user.php +++ b/templates/become_beta_user.php @@ -16,8 +16,8 @@ style('ecloud-accounts', 'style');
-

t('Here is the list of currently available beta features:')) ?>

-
    +

    t('Here is the list of currently available beta features:')) ?>

    +
    • diff --git a/templates/opt_out_beta_user.php b/templates/opt_out_beta_user.php index 38f6b0e2..d77c7698 100644 --- a/templates/opt_out_beta_user.php +++ b/templates/opt_out_beta_user.php @@ -10,8 +10,8 @@ style('ecloud-accounts', 'style'); t('Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.')); ?>

      -

      t('Here is the list of currently available beta features:')) ?>

      -
        +

        t('Here is the list of currently available beta features:')) ?>

        +
        • -- GitLab From ae3a65b3006fef9ad724a6dd1a42a9b819b06059 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 26 Jan 2023 11:38:21 +0530 Subject: [PATCH 13/17] changed position of success message --- templates/become_beta_user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/become_beta_user.php b/templates/become_beta_user.php index 478fd06a..c6fda2ea 100644 --- a/templates/become_beta_user.php +++ b/templates/become_beta_user.php @@ -14,7 +14,6 @@ style('ecloud-accounts', 'style');
      -

      t('Here is the list of currently available beta features:')) ?>

        @@ -23,6 +22,7 @@ style('ecloud-accounts', 'style');
      +
-- GitLab From 8704baa908336517bfd7c22ba8ed1cc28192daf4 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 26 Jan 2023 11:41:27 +0530 Subject: [PATCH 14/17] reverted: changed position of success message --- templates/become_beta_user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/become_beta_user.php b/templates/become_beta_user.php index c6fda2ea..6d9b82b0 100644 --- a/templates/become_beta_user.php +++ b/templates/become_beta_user.php @@ -14,7 +14,8 @@ style('ecloud-accounts', 'style'); -
+
+

t('Here is the list of currently available beta features:')) ?>

    @@ -22,7 +23,6 @@ style('ecloud-accounts', 'style');
-
-- GitLab From 9b32117eed7d543d293e21991f32fb0e789593ae Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 26 Jan 2023 11:45:52 +0530 Subject: [PATCH 15/17] added margin-bottom in alert --- css/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/style.css b/css/style.css index 09f0b98d..183aade0 100644 --- a/css/style.css +++ b/css/style.css @@ -2,6 +2,7 @@ position: relative; padding: 0.75rem 1.25rem; margin-top: 1rem; + margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; width: fit-content; -- GitLab From 53a783490e380d082e1ea8f42299c4a99c2f10b8 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 26 Jan 2023 11:46:33 +0530 Subject: [PATCH 16/17] added margin-bottom in alert --- css/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 183aade0..1c850421 100644 --- a/css/style.css +++ b/css/style.css @@ -1,6 +1,5 @@ .alert { position: relative; - padding: 0.75rem 1.25rem; margin-top: 1rem; margin-bottom: 1rem; border: 1px solid transparent; @@ -12,12 +11,14 @@ color: #155724; background-color: #d4edda; border-color: #c3e6cb; + padding: 0.75rem 1.25rem; } .alert-fail { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; + padding: 0.75rem 1.25rem; } #issue-submit-form #title, -- GitLab From 74b0b1f18bd7c1248d5c36c3af8d08ebdafea020 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 26 Jan 2023 17:32:07 +0530 Subject: [PATCH 17/17] text changes --- lib/Settings/BetaUserSetting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index 3a85d1e7..696d9433 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -71,12 +71,12 @@ class BetaUserSetting implements ISettings { public function getSection(): ?string { $betaGroupName = $this->config->getSystemValue("beta_group_name"); if (empty($betaGroupName)) { - $this->logger->error('Beta group name is not configured.', ['app' => 'ecloud-accounts']); + $this->logger->warning('Beta group name is not set in config.php', ['app' => 'ecloud-accounts']); return null; } $groupExists = $this->groupManager->groupExists($betaGroupName); if (! $groupExists) { - $this->logger->error('Beta group is not available.', ['app' => 'ecloud-accounts']); + $this->logger->warning('Beta group does not exist!', ['app' => 'ecloud-accounts']); return null; } return 'beta-user'; -- GitLab