diff --git a/.woodpecker.yml b/.woodpecker.yml index d51f01d..71adb98 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -15,6 +15,29 @@ pipeline: branch: [master, develop, feature/*] event: [push, pull_request] + code_quality: + image: sonarsource/sonar-scanner-cli + secrets: [sonar_token, sonar_host, sonar_project] + commands: + - sonar-scanner + -Dsonar.projectKey=$SONAR_PROJECT + -Dsonar.sources=. + -Dsonar.host.url=$SONAR_HOST + -Dsonar.pullrequest.key=$CI_COMMIT_PULL_REQUEST + -Dsonar.pullrequest.branch=$CI_COMMIT_SOURCE_BRANCH + -Dsonar.pullrequest.base=$CI_COMMIT_TARGET_BRANCH + failure: ignore + when: + event: [pull_request] + + dependency_check: + image: node:16-slim + commands: + - npm audit + failure: ignore + when: + event: [pull_request] + package: image: gitnet.fr/deblan/devenv volumes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a7deac..3c14d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ ## [Unreleased] +## 3.4.1 ## Added -* add translations (thanks to zonorti, jorisvandijk) +* add translations (thanks to zonorti, jorisvandijk, jak2k) +## Fixed +* fix #183: hide custom categories list when empty (admin page) ## 3.4.0 ### Added diff --git a/Makefile b/Makefile index 966581f..783bb6a 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,4 @@ translations: .ONESHELL: run-code-quality-analysis: export SONAR_TOKEN="$$SONAR_TOKEN_DEBLAN_SIDE_MENU" - sonar-scanner -Dsonar.projectKey=deblan-side_menu -Dsonar.sources=. -Dsonar.host.url=https://cq.gitnet.fr + sonar-scanner -Dsonar.projectKey=deblan-side_menu -Dsonar.sources=. -Dsonar.host.url=$$SONAR_SERVER -Dsonar.branch.name=$$(git branch --show-current) diff --git a/README.md b/README.md index e5e90b4..273173d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You like this app and you want to support me? ☕ [Buy me a coffee](https://www. Requirements ------------ -* PHP >= 7.4 +* PHP >= 8.0 * App `theming` enabled Installation and upgrade diff --git a/appinfo/info.xml b/appinfo/info.xml index 1105b43..12570a5 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -17,7 +17,7 @@ You can report a bug or request a feature by opening an issue. Requirements: -* PHP >= 7.4 +* PHP >= 8.0 * App `theming` enabled If you like this application and if you want to support the development: @@ -32,7 +32,7 @@ Notice Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/). ]]> - 3.4.0 + 3.4.1 agpl Simon Vieille SideMenu diff --git a/css/admin.css b/css/admin.css index 5332c4e..b3d0b7c 100644 --- a/css/admin.css +++ b/css/admin.css @@ -137,6 +137,10 @@ padding-right: 20px; } +.side-menu-setting-label--top { + vertical-align: top; +} + .side-menu-setting-form { display: table-cell; min-width: 300px; @@ -182,7 +186,7 @@ } .badge { - border-size: 1px; + border-width: 1px; padding: 2px 8px; margin-right: 2px; margin-bottom: 5px; diff --git a/css/sideMenu.css b/css/sideMenu.css index 189d4da..7224803 100644 --- a/css/sideMenu.css +++ b/css/sideMenu.css @@ -235,9 +235,6 @@ .side-menu-always-displayed body { width: calc(100% - 50px) !important; -} - -.side-menu-always-displayed body { position: absolute; left: 50px; } diff --git a/lib/Controller/AppController.php b/lib/Controller/AppController.php index 1d3de92..83a0e8c 100644 --- a/lib/Controller/AppController.php +++ b/lib/Controller/AppController.php @@ -86,7 +86,11 @@ class AppController extends Controller protected function redirectToApp($appId): RedirectResponse { - $isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false); + $isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue( + 'htaccess.IgnoreFrontController', + false + ); + $isFrontControllerActive = 'true' === getenv('front_controller_active'); if ($isIgnoreFrontController || $isFrontControllerActive) { diff --git a/lib/Controller/CssController.php b/lib/Controller/CssController.php index 028ac11..06f7ae8 100644 --- a/lib/Controller/CssController.php +++ b/lib/Controller/CssController.php @@ -21,14 +21,14 @@ namespace OCA\SideMenu\Controller; use OC; use OC\User\User; use OCA\SideMenu\AppInfo\Application; +use OCA\SideMenu\Service\Color; use OCA\SideMenu\Service\ConfigProxy; +use OCA\Theming\ThemingDefaults; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\TemplateResponse; use OCP\IRequest; use OCP\IUserSession; -use OCA\Theming\ThemingDefaults; -use OCA\SideMenu\Service\Color; class CssController extends Controller { @@ -58,8 +58,7 @@ class CssController extends Controller ConfigProxy $config, ThemingDefaults $theming, Color $color - ) - { + ) { parent::__construct($appName, $request); $this->user = OC::$server[IUserSession::class]->getUser(); @@ -105,16 +104,18 @@ class CssController extends Controller $topSideMenuApps = $userTopSideMenuApps; } - $isDarkThemeUserEnabled = $this->config->getUserValue($this->user, 'theme', '', 'accessibility') === 'dark'; + $isDarkThemeUserEnabled = 'dark' === $this->config->getUserValue($this->user, 'theme', '', 'accessibility'); $isBreezeDarkUserEnabled = $this->config->getUserValue($this->user, 'theme_enabled', '', 'breezedark'); - $isBreezeDarkUserEnabled = $isBreezeDarkUserEnabled === '1' || ($isBreezeDarkGlobalEnabled && $isBreezeDarkUserEnabled === ''); + $isBreezeDarkUserEnabled = '1' === $isBreezeDarkUserEnabled || + ($isBreezeDarkGlobalEnabled && '' === $isBreezeDarkUserEnabled); } else { $isDarkThemeUserEnabled = false; $isBreezeDarkUserEnabled = false; } - $isDarkMode = ($isAccessibilityAppEnabled && $isDarkThemeUserEnabled) || ($isBreezeDarkAppEnabled && $isBreezeDarkUserEnabled); + $isDarkMode = ($isAccessibilityAppEnabled && $isDarkThemeUserEnabled) || + ($isBreezeDarkAppEnabled && $isBreezeDarkUserEnabled); $primaryColor = $this->theming->getColorPrimary(); $lightenPrimaryColor = $this->color->adjustBrightness($primaryColor, 0.2); @@ -125,25 +126,33 @@ class CssController extends Controller if ($isDarkMode) { $backgroundColor = $this->config->getAppValue('dark-mode-background-color', $darkenPrimaryColor); $backgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $darkenPrimaryColor); - $currentAppBackgroundColor = $this->config->getAppValue('dark-mode-current-app-background-color', $darkenPrimaryColor2); + $currentAppBackgroundColor = $this->config->getAppValue( + 'dark-mode-current-app-background-color', + $darkenPrimaryColor2 + ); $loaderColor = $this->config->getAppValue('dark-mode-loader-color', $lightenPrimaryColor); $textColor = $this->config->getAppValue('dark-mode-text-color', $textColor); $iconInvertFilter = abs($this->config->getAppValueInt('dark-mode-icon-invert-filter', '0')).'%'; $iconOpacity = abs($this->config->getAppValueInt('dark-mode-icon-opacity', '100') / 100); $opener = $this->config->getAppValue('dark-mode-opener', 'side-menu-opener'); - $backgroundOpacity = dechex($this->config->getAppValueInt('dark-mode-background-color-opacity', '100') * 255 / 100); + $opacity = $this->config->getAppValueInt('dark-mode-background-color-opacity', '100'); + $backgroundOpacity = dechex($opacity * 255 / 100); } else { $backgroundColor = $this->config->getAppValue('background-color', $darkenPrimaryColor); $backgroundColorTo = $this->config->getAppValue('background-color-to', $darkenPrimaryColor); - $currentAppBackgroundColor = $this->config->getAppValue('current-app-background-color', $darkenPrimaryColor2); + $currentAppBackgroundColor = $this->config->getAppValue( + 'current-app-background-color', + $darkenPrimaryColor2 + ); $loaderColor = $this->config->getAppValue('loader-color', $lightenPrimaryColor); $textColor = $this->config->getAppValue('text-color', $textColor); $iconInvertFilter = abs($this->config->getAppValueInt('icon-invert-filter', '0')).'%'; $iconOpacity = abs($this->config->getAppValueInt('icon-opacity', '100') / 100); $opener = $this->config->getAppValue('opener', 'side-menu-opener'); - $backgroundOpacity = dechex($this->config->getAppValueInt('background-color-opacity', '100') * 255 / 100); + $opacity = $this->config->getAppValueInt('background-color-opacity', '100'); + $backgroundOpacity = dechex($opacity * 255 / 100); } $backgroundColor .= $backgroundOpacity; diff --git a/lib/Controller/JsController.php b/lib/Controller/JsController.php index c0831a9..2ba62ed 100644 --- a/lib/Controller/JsController.php +++ b/lib/Controller/JsController.php @@ -95,7 +95,6 @@ class JsController extends Controller { $topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]'); $topSideMenuApps = $this->config->getAppValueArray('top-side-menu-apps', '[]'); - $topMenuAppsOrder = $this->config->getAppValueArray('top-menu-apps-order', '[]'); $targetBlankApps = $this->config->getAppValueArray('target-blank-apps', '[]'); $useAvatar = $this->config->getAppValueBool('use-avatar', '0'); $isForced = $this->config->getAppValueBool('force', '0'); diff --git a/lib/Controller/PersonalSettingController.php b/lib/Controller/PersonalSettingController.php index 6f126c7..fc30c35 100644 --- a/lib/Controller/PersonalSettingController.php +++ b/lib/Controller/PersonalSettingController.php @@ -43,8 +43,13 @@ class PersonalSettingController extends Controller */ protected $userSession; - public function __construct($appName, IRequest $request, IConfig $config, ConfigProxy $configProxy, IUserSession $userSession) - { + public function __construct( + $appName, + IRequest $request, + IConfig $config, + ConfigProxy $configProxy, + IUserSession $userSession + ) { parent::__construct($appName, $request); $this->config = $config; diff --git a/lib/Service/CategoryRepository.php b/lib/Service/CategoryRepository.php index 7559854..c146609 100644 --- a/lib/Service/CategoryRepository.php +++ b/lib/Service/CategoryRepository.php @@ -74,7 +74,8 @@ class CategoryRepository } foreach ($categoriesLabels as $k => $category) { - $categoriesLabels[$category['id']] = $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name']; + $categoriesLabels[$category['id']] = $category['translations'][$currentLanguage]['name'] ?? + $category['translations']['en']['name']; unset($categoriesLabels[$k]); } diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 12be78a..b1e2781 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -125,15 +125,24 @@ class Admin implements ISettings 'background-color' => $backgroundColor, 'background-color-to' => $backgroundColorTo, 'background-color-opacity' => $this->config->getAppValueInt('background-color-opacity', '100'), - 'current-app-background-color' => $this->config->getAppValue('current-app-background-color', $darkenPrimaryColor2), + 'current-app-background-color' => $this->config->getAppValue( + 'current-app-background-color', + $darkenPrimaryColor2 + ), 'loader-color' => $this->config->getAppValue('loader-color', $lightenPrimaryColor), 'icon-invert-filter' => $this->config->getAppValueInt('icon-invert-filter', '0'), 'icon-opacity' => $this->config->getAppValueInt('icon-opacity', '100'), 'text-color' => $this->config->getAppValue('text-color', $textColor), 'dark-mode-background-color' => $darkModeBackgroundColor, 'dark-mode-background-color-to' => $darkModeBackgroundColorTo, - 'dark-mode-background-color-opacity' => $this->config->getAppValueInt('dark-mode-background-color-opacity', '100'), - 'dark-mode-current-app-background-color' => $this->config->getAppValue('dark-mode-current-app-background-color', $darkenPrimaryColor2), + 'dark-mode-background-color-opacity' => $this->config->getAppValueInt( + 'dark-mode-background-color-opacity', + '100' + ), + 'dark-mode-current-app-background-color' => $this->config->getAppValue( + 'dark-mode-current-app-background-color', + $darkenPrimaryColor2 + ), 'dark-mode-loader-color' => $this->config->getAppValue('dark-mode-loader-color', $textColor), 'dark-mode-icon-invert-filter' => $this->config->getAppValueInt('dark-mode-icon-invert-filter', '0'), 'dark-mode-icon-opacity' => $this->config->getAppValueInt('dark-mode-icon-opacity', '100'), diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index e61f9e5..57112d0 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -54,8 +54,13 @@ class Personal implements ISettings */ private $appRepository; - public function __construct(IL10N $l, ILogger $logger, ConfigProxy $config, IUserSession $userSession, AppRepository $appRepository) - { + public function __construct( + IL10N $l, + ILogger $logger, + ConfigProxy $config, + IUserSession $userSession, + AppRepository $appRepository + ) { $this->l = $l; $this->logger = $logger; $this->config = $config; diff --git a/src/AdminCategoriesCustom.vue b/src/AdminCategoriesCustom.vue index c210fc3..2a84749 100644 --- a/src/AdminCategoriesCustom.vue +++ b/src/AdminCategoriesCustom.vue @@ -16,7 +16,7 @@ along with this program. If not, see . -->