diff --git a/.woodpecker.yml b/.woodpecker.yml index 47a4044..43bf009 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,47 +1,78 @@ -pipeline: +steps: dependencies: - image: gitnet.fr/deblan/devenv + image: node:16 + pull: true commands: - - make dep + - npm i when: - event: [tag, push, pull_request] - branch: [master, develop, feature/*, translations] + event: [tag, push, pull_request, manual] + branch: [master, develop, feature/*, fix/*, bugfix/*, translations] - osv_detector: - image: gitnet.fr/deblan/docker-osv-detector:v0.9 + osv-detector: + image: gitnet.fr/deblan/osv-detector:v0.10 commands: - osv-detector package-lock.json failure: ignore - build: - image: gitnet.fr/deblan/devenv + build-js: + image: node:16 commands: - - make build + - npm run build when: - branch: [master, develop, feature/*, translations] - event: [push, pull_request] + event: [tag, push, pull_request, manual] + branch: [master, develop, feature/*, fix/*, bugfix/*, translations] - code_quality: - image: sonarsource/sonar-scanner-cli - secrets: [sonar_token, sonar_host, sonar_project] + build-translations: + image: deblan/php:8.0 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 + - php bin/generate_l10n.php when: - event: [pull_request] + event: [tag, push, pull_request, manual] + branch: [master, develop, feature/*, fix/*, bugfix/*, translations] - package: - image: gitnet.fr/deblan/devenv + create-signature: + image: nextcloud:25 + secrets: [app_certificate, app_public_certificate] + environment: + SQLITE_DATABASE: /var/www/data/data.db + NEXTCLOUD_ADMIN_USER: admin + NEXTCLOUD_ADMIN_PASSWORD: admin + commands: + - echo "$APP_CERTIFICATE" > "/tmp/side_menu.key" + - echo "$APP_PUBLIC_CERTIFICATE" > "/tmp/side_menu.crt" + - mkdir /tmp/app + - cp -r README.md CHANGELOG.md appinfo css lib img l10n js src templates screenshots vendor /tmp/app + - /usr/src/nextcloud/occ integrity:sign-app + --privateKey=/tmp/side_menu.key + --certificate=/tmp/side_menu.crt + --path=/tmp/app + - mv /tmp/app/appinfo/signature.json appinfo/ + when: + event: [tag] + + # check-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] + + create-package: + image: deblan/php:8.0 volumes: - /var/www/html/artifacts:/var/www/html/artifacts secrets: [app_certificate] commands: + - apt-get update + - apt-get install -y zip make - mkdir -p "$HOME/.nextcloud/certificates" - echo "$APP_CERTIFICATE" > "$HOME/.nextcloud/certificates/side_menu.key" - export VERSION=$(grep "" appinfo/info.xml | grep -o "[0-9]*\.[0-9]*\.[0-9]*" --color=never) @@ -50,7 +81,7 @@ pipeline: when: event: [tag] - release: + push-release: image: plugins/gitea-release volumes: - /var/www/html/artifacts:/var/www/html/artifacts diff --git a/CHANGELOG.md b/CHANGELOG.md index c979fe2..5dc6363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,64 @@ ## [Unreleased] +## 3.11.0 +### Added +* add a search component in menus +### Fixed +* remove the label of the link to personal settings - fix #283 + +## 3.10.3 +### Fixed +* change the way to load nextcloud components (NcActionLink/NcActions) - fix #274 +* update @nexcloud/* packages + +## 3.10.2 +### Fixed +* add missing properties + +## 3.10.1 +### Fixed +* fix #269: use php7 syntax + +## 3.10.0 +### Added +* add compatibility with NC28 +### Fixed +* fix NC28 error: remove deprecated method `OC_App::getNavigation()` + +## 3.9.1 +### Fixed +* fix fixed menu on dashboard (#262) + +## 3.9.0 +### Added +* add compatibility with NC27 +### Fixed +* fix app redirect (#261) + +## 3.8.0 +### Added +* add option to show hovered label only on top menu (fix #253) + +## 3.7.4 +### Fixed +* fix Integrity failed (#247) + +## 3.7.3 +### Fixed +* fix #244: use app href for redirection +### Added +* add signature on build + +## 3.7.2 +### Added +* update pipeline conditions allowing `fix/*` +### Fixed +* fix #233: load configuration and then retrieve apps in default side menu display + +## 3.7.1 +### Fixed +* fix build process (#230) + ## 3.7.0 ### Added * add translations (thanks to AHOHNMYC) diff --git a/Makefile b/Makefile index 783bb6a..e5b6267 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ dep: npm link @nextcloud/vue || sudo npm link @nextcloud/vue .ONESHELL: -release: build translations +release: if [ -z "$$VERSION" ]; then echo "VERSION required" exit 1 diff --git a/README.md b/README.md index 449bc17..bf8abbb 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://ci.gitnet.fr/api/badges/deblan/side_menu/status.svg)](https://ci.gitnet.fr/deblan/side_menu) [![Translations](https://translate.codeberg.org/widgets/custom-menu/-/application/svg-badge.svg)](https://translate.codeberg.org/engage/custom-menu/) +![Downloads](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=downloads&query=%24.K_downloads&suffix=K&url=https%3A%2F%2Fapi-side-menu.deblan.org%2Fdownloads.php) Allows you to modify the position of the main menu by creating a panel on the left of the interface or with a big menu on the top. You can also add and sort custom categories, define apps that must be displayed in the top menu, etc. Fully customisable. diff --git a/appinfo/info.xml b/appinfo/info.xml index fc48124..4840e27 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -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.7.0 + 3.11.0 agpl Simon Vieille SideMenu @@ -54,7 +54,7 @@ In case of downtime, you can download **Custom Menu** from [here](https://kim.de https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_big_menu.png https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_default_menu.png - + diff --git a/css/sideMenu.css b/css/sideMenu.css index 7224803..9bf15c8 100644 --- a/css/sideMenu.css +++ b/css/sideMenu.css @@ -47,7 +47,7 @@ margin-top: 2px; float: right; line-height: 34px; - height: 28px; + height: 42px; display: none; } @@ -155,7 +155,7 @@ } #side-menu.hide-opener .side-menu-logo { - margin-top: 20px; + margin-top: 10px; } #side-menu-loader { @@ -223,7 +223,7 @@ } .side-menu-loader svg { - width: 38px; + width: 45px; margin: auto; stroke: var(--side-menu-text-color, #fff); } @@ -239,14 +239,23 @@ left: 50px; } +.side-menu-always-displayed #header { + position: absolute !important; +} + .side-menu-always-displayed #side-menu { display: block; } .side-menu-always-displayed .side-menu-apps-list { + height: 100vh; + top: 0; + overflow: hidden; +} + +.side-menu-always-displayed .side-menu-apps-list--with-settings { height: calc(100vh - 49px); top: 49px; - overflow: hidden; } .side-menu-always-displayed .side-menu-apps-list:hover { @@ -309,12 +318,35 @@ visibility: visible; } +.side-menu-search { + float: right; +} + +.side-menu-search input { + background: none; + border: 0; + border-radius: 0; + color: var(--side-menu-text-color); +} + +.side-menu-search input::placeholder { + color: var(--side-menu-text-color); +} + +.side-menu-always-displayed .side-menu-search { + display: none; +} + @media screen and (max-width: 1024px) { #side-menu.side-menu-big { max-width: 290px; height: 100vh; } + #side-menu.hide-opener.side-menu-big .side-menu-search { + float: none; + } + .side-menu-categories { display: block; padding: 0; diff --git a/lib/Controller/AppController.php b/lib/Controller/AppController.php index 83a0e8c..588911f 100644 --- a/lib/Controller/AppController.php +++ b/lib/Controller/AppController.php @@ -74,33 +74,37 @@ class AppController extends Controller $inTopMenuApps = in_array($app['id'], $topMenuApps); $inHiddenApps = in_array($app['id'], $hiddenApps); - if (!$inTopMenuApps || $inHiddenApps) { + if (!$inTopMenuApps && $inHiddenApps) { continue; } - return $this->redirectToApp($app['id']); + return $this->redirectToApp($app, true); } return $this->redirectToApp('files'); } - protected function redirectToApp($appId): RedirectResponse + protected function redirectToApp($app, bool $isHref = false): RedirectResponse { - $isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue( - 'htaccess.IgnoreFrontController', - false - ); + if (!$isHref) { + $isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue( + 'htaccess.IgnoreFrontController', + false + ); - $isFrontControllerActive = 'true' === getenv('front_controller_active'); + $isFrontControllerActive = 'true' === getenv('front_controller_active'); - if ($isIgnoreFrontController || $isFrontControllerActive) { - $path = '/apps/%s/'; + if ($isIgnoreFrontController || $isFrontControllerActive) { + $path = '/apps/%s/'; + } else { + $path = '/index.php/apps/%s/'; + } + + $url = $this->urlGenerator->getAbsoluteURL(sprintf($path, $app)); } else { - $path = '/index.php/apps/%s/'; + $url = $app['href']; } - $url = $this->urlGenerator->getAbsoluteURL(sprintf($path, $appId)); - return new RedirectResponse($url); } } diff --git a/lib/Controller/JsController.php b/lib/Controller/JsController.php index 3abcdba..13d803e 100644 --- a/lib/Controller/JsController.php +++ b/lib/Controller/JsController.php @@ -171,7 +171,7 @@ class JsController extends Controller 'avatar' => $avatar, 'top-menu-apps' => $topMenuApps, 'top-side-menu-apps' => $topSideMenuApps, - 'top-menu-mouse-over-hidden-label' => $this->config->getAppValueBool( + 'top-menu-mouse-over-hidden-label' => $this->config->getAppValueInt( 'top-menu-mouse-over-hidden-label', '0' ), diff --git a/lib/Service/AppRepository.php b/lib/Service/AppRepository.php index ce96107..ec10a36 100644 --- a/lib/Service/AppRepository.php +++ b/lib/Service/AppRepository.php @@ -3,6 +3,7 @@ namespace OCA\SideMenu\Service; use OC\User\User; +use OCP\INavigationManager; use OCP\L10N\IFactory; /** @@ -32,8 +33,14 @@ class AppRepository */ protected $categoryRepository; + /** + * @var INavigationManager + */ + protected $navigationManager; + public function __construct( \OC_App $ocApp, + INavigationManager $navigationManager, IFactory $l10nFactory, ConfigProxy $config, CategoryRepository $categoryRepository @@ -41,6 +48,7 @@ class AppRepository $this->ocApp = $ocApp; $this->l10nFactory = $l10nFactory; $this->config = $config; + $this->navigationManager = $navigationManager; $this->categoryRepository = $categoryRepository; } @@ -51,7 +59,7 @@ class AppRepository */ public function getVisibleApps() { - $navigation = $this->ocApp->getNavigation(); + $navigation = $this->navigationManager->getAll(); $appCategoriesCustom = $this->config->getAppValueArray('apps-categories-custom', '[]'); $categories = $this->categoryRepository->getOrderedCategories(); $apps = $this->ocApp->listAllApps(); diff --git a/package.json b/package.json index 503c7d1..05e2ef7 100644 --- a/package.json +++ b/package.json @@ -25,12 +25,12 @@ "@babel/core": "^7.9.0", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/preset-env": "^7.9.0", - "@nextcloud/axios": "^1.8.0", - "@nextcloud/browserslist-config": "^1.0.0", + "@nextcloud/axios": "^2.3.0", + "@nextcloud/browserslist-config": "^2.3.0", "@nextcloud/eslint-config": "^8.1.2", "@nextcloud/initial-state": "^2.0.0", - "@nextcloud/l10n": "^1.6.0", - "@nextcloud/vue": "^7.0.0", + "@nextcloud/l10n": "^2.1.0", + "@nextcloud/vue": "^7.12.1", "babel-eslint": "^10.1.0", "babel-loader": "^8.1.0", "css-loader": "^3.4.2", diff --git a/src/AppMenu.vue b/src/AppMenu.vue index 0e550d7..c456370 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -24,14 +24,14 @@