From 28085d9aa791b0a3c48f181847c262a791156921 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 20 Feb 2024 21:08:12 +0100 Subject: [PATCH 01/51] remove line breaks --- templates/css/stylesheet.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/css/stylesheet.php b/templates/css/stylesheet.php index c7eb453..5638629 100644 --- a/templates/css/stylesheet.php +++ b/templates/css/stylesheet.php @@ -42,13 +42,11 @@ top: 49px; } - #side-menu.hide-opener .side-menu-header .side-menu-opener.side-menu-closer - { + #side-menu.hide-opener .side-menu-header .side-menu-opener.side-menu-closer { visibility: hidden; } - #side-menu.hide-opener.side-menu-with-categories .side-menu-search - { + #side-menu.hide-opener.side-menu-with-categories .side-menu-search { float: none; } From 2cecd0d6f4fe82b82278f5645496a84e7d583ce0 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 20 Feb 2024 21:08:46 +0100 Subject: [PATCH 02/51] move the logo inside #nextcloud element (fix #278 #239) [NC26] --- templates/js/script.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/js/script.php b/templates/js/script.php index b67c9b2..77fcc95 100644 --- a/templates/js/script.php +++ b/templates/js/script.php @@ -24,6 +24,7 @@ if ($_['always-displayed']) { const body = document.querySelector('body') const html = document.querySelector('html') const nextcloud = document.querySelector('#nextcloud') + const logo = document.querySelector('.header-left .logo') const isTouchDevice = window.matchMedia("(pointer: coarse)").matches @@ -170,6 +171,10 @@ if ($_['always-displayed']) { if (nextcloud) { + if (logo && logo.parentNode !== nextcloud) { + nextcloud.appendChild(logo) + } + nextcloud.parentNode.insertBefore(sideMenuOpener, nextcloud) From 32cd25b73608ba6db964166fdf8ea0fe7238b84f Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 20 Feb 2024 21:18:18 +0100 Subject: [PATCH 03/51] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3533d10..ed3c302 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## [Unreleased] +### Fixed +* move the logo inside #nextcloud element (fix #278 #239) [NC26] + ## 3.11.7 ### Added * update translations From 56904c5aa0a3ed62d53dfe4fc1a69f149557b7a9 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 20 Feb 2024 21:22:05 +0100 Subject: [PATCH 04/51] release v3.11.8 --- CHANGELOG.md | 1 + appinfo/info.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed3c302..0af2b42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [Unreleased] +## 3.11.8 ### Fixed * move the logo inside #nextcloud element (fix #278 #239) [NC26] diff --git a/appinfo/info.xml b/appinfo/info.xml index c293e56..47667c3 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.11.7 + 3.11.8 agpl Simon Vieille SideMenu From 45d4e5f24c6c69230f300cf9a3dddf6a6ac65bed Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 21 Feb 2024 11:16:56 +0100 Subject: [PATCH 05/51] refactorint ci steps use gitnet.fr/deblan/woodpecker-cache to generate cache --- .woodpecker.yml | 103 -------------------------------------- .woodpecker/.build.yml | 28 +++++++++++ .woodpecker/.publish.yml | 55 ++++++++++++++++++++ .woodpecker/.security.yml | 17 +++++++ 4 files changed, 100 insertions(+), 103 deletions(-) delete mode 100644 .woodpecker.yml create mode 100644 .woodpecker/.build.yml create mode 100644 .woodpecker/.publish.yml create mode 100644 .woodpecker/.security.yml diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index 61563c0..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,103 +0,0 @@ -steps: - "Verify tag and app version": - image: alpine - commands: - - TAG=${CI_COMMIT_TAG/v//} - - grep "$TAG" appinfo/info.xml - when: - event: [tag] - - "Install dependencies": - image: node:16 - pull: true - commands: - - npm i - when: - event: [tag, push, pull_request, manual] - branch: [master, develop, feature/*, fix/*, bugfix/*, translations] - - "Check dependencies": - image: gitnet.fr/deblan/osv-detector:v0.10 - commands: - - osv-detector package-lock.json - failure: ignore - - "Build JS": - image: node:16 - commands: - - npm run build - when: - event: [tag, push, pull_request, manual] - branch: [master, develop, feature/*, fix/*, bugfix/*, translations] - - "Build translations": - image: deblan/php:8.0 - commands: - - php bin/generate_l10n.php - when: - event: [tag, push, pull_request, manual] - branch: [master, develop, feature/*, fix/*, bugfix/*, translations] - - "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) - - export RELEASE_DIRECTORY="/var/www/html/artifacts/deblan/side_menu" - - make release - when: - event: [tag] - - "Push release": - image: plugins/gitea-release - volumes: - - /var/www/html/artifacts:/var/www/html/artifacts - settings: - api_key: - from_secret: gitnet_api_key - base_url: https://gitnet.fr - note: ${CI_COMMIT_MESSAGE} - files: /var/www/html/artifacts/deblan/side_menu/${CI_COMMIT_TAG/v//}/* - when: - event: [tag] diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml new file mode 100644 index 0000000..93b0530 --- /dev/null +++ b/.woodpecker/.build.yml @@ -0,0 +1,28 @@ +variables: + volumes: &volumes + - /data/${CI_REPO}:/builds + +when: + event: [tag, push, pull_request, manual] + branch: [master, develop, feature/*, fix/*, bugfix/*, translations] + +steps: + "Install dependencies": + image: node:16 + pull: true + commands: + - npm i + + "Build JS": + image: node:16 + commands: + - npm run build + + "Build translations": + image: deblan/php:8.0 + commands: + - php bin/generate_l10n.php + + "Build cache": + image: gitnet.fr/deblan/woodpecker-cache + volumes: *volumes diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml new file mode 100644 index 0000000..4d0f639 --- /dev/null +++ b/.woodpecker/.publish.yml @@ -0,0 +1,55 @@ +variables: + volumes: &volumes + - /data/${CI_REPO}:/builds + - /var/www/html/artifacts:/var/www/html/artifacts + +depends_on: + - build + +when: + event: [tag] + +steps: + "Create signature": + image: nextcloud:25 + secrets: [app_certificate, app_public_certificate] + volumes: &volumes + environment: + SQLITE_DATABASE: /var/www/data/data.db + NEXTCLOUD_ADMIN_USER: admin + NEXTCLOUD_ADMIN_PASSWORD: admin + commands: + - cd "/builds/$CI_COMMIT_SHA" + - 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/ + + "Create package": + image: deblan/php:8.0 + volumes: *volumes + secrets: [app_certificate] + commands: + - cd "/builds/$CI_COMMIT_SHA" + - 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) + - export RELEASE_DIRECTORY="/var/www/html/artifacts/deblan/side_menu" + - make release + + "Push release": + image: plugins/gitea-release + volumes: *volumes + settings: + api_key: + from_secret: gitnet_api_key + base_url: https://gitnet.fr + note: ${CI_COMMIT_MESSAGE} + files: /var/www/html/artifacts/deblan/side_menu/${CI_COMMIT_TAG/v//}/* diff --git a/.woodpecker/.security.yml b/.woodpecker/.security.yml new file mode 100644 index 0000000..50612c6 --- /dev/null +++ b/.woodpecker/.security.yml @@ -0,0 +1,17 @@ +variables: + volumes: &volumes + - /data/${CI_REPO}:/builds + +depends_on: + - build + +skip_clone: true + +steps: + "Check dependencies": + image: gitnet.fr/deblan/osv-detector:v0.10 + volumes: *volumes + commands: + - cd "/builds/$CI_COMMIT_SHA" + - osv-detector package-lock.json + failure: ignore From 3e7dcac307684444527104d19d5060ed27330fab Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 21 Feb 2024 12:35:47 +0100 Subject: [PATCH 06/51] add forgejo templates --- .gitea/issue_template/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .gitea/issue_template/config.yml diff --git a/.gitea/issue_template/config.yml b/.gitea/issue_template/config.yml new file mode 100644 index 0000000..ff7be7c --- /dev/null +++ b/.gitea/issue_template/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: Documentation + url: https://deblan.gitnet.page/side_menu_doc/ + about: Official documentation web site + - name: Ask a question in our Matrix room + about: If you prefer a chat-like conversation or in need for quick help, this might be an alternative to opening an issue. + url: https://matrix.to/#/#custommenu:neutralnetwork.org From a94a94b5641314f30d6f60571b91f2ff68fe5739 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 21 Feb 2024 15:45:08 +0100 Subject: [PATCH 07/51] update forgejo templates --- .gitea/issue_template/QUESTION_TEMPLATE.yml | 30 +++++++++++++++++++++ .gitea/issue_template/config.yml | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .gitea/issue_template/QUESTION_TEMPLATE.yml diff --git a/.gitea/issue_template/QUESTION_TEMPLATE.yml b/.gitea/issue_template/QUESTION_TEMPLATE.yml new file mode 100644 index 0000000..41301ae --- /dev/null +++ b/.gitea/issue_template/QUESTION_TEMPLATE.yml @@ -0,0 +1,30 @@ +name: New question +about: Use this template when you don't know how to do something +title: "[Question] " +labels: + - question +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill information. + + - type: textarea + id: environment + attributes: + label: Environment + value: | + * Custom menu version: + * Nextcloud version: + * PHP version: + * Web server (Nginx, Apache2): + * Web browser and version (Firefox 80, Google Chrome 74, etc): + validations: + required: true + + - type: textarea + id: question + attributes: + label: Question + validations: + required: true diff --git a/.gitea/issue_template/config.yml b/.gitea/issue_template/config.yml index ff7be7c..d065f39 100644 --- a/.gitea/issue_template/config.yml +++ b/.gitea/issue_template/config.yml @@ -1,4 +1,4 @@ -blank_issues_enabled: true +blank_issues_enabled: false contact_links: - name: Documentation url: https://deblan.gitnet.page/side_menu_doc/ From afa48c6239da601333c0d467faa28aac97f7be5b Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 21 Feb 2024 16:14:05 +0100 Subject: [PATCH 08/51] ci: update deblan/php version --- .woodpecker/.build.yml | 2 +- .woodpecker/.publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml index 93b0530..7ad69f4 100644 --- a/.woodpecker/.build.yml +++ b/.woodpecker/.build.yml @@ -19,7 +19,7 @@ steps: - npm run build "Build translations": - image: deblan/php:8.0 + image: deblan/php:8.3 commands: - php bin/generate_l10n.php diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml index 4d0f639..ef4a8a8 100644 --- a/.woodpecker/.publish.yml +++ b/.woodpecker/.publish.yml @@ -31,7 +31,7 @@ steps: - mv /tmp/app/appinfo/signature.json appinfo/ "Create package": - image: deblan/php:8.0 + image: deblan/php:8.3 volumes: *volumes secrets: [app_certificate] commands: From 71f5dfef9afb272cf2ba60a0830c882a6cda7723 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 8 Apr 2024 11:41:26 +0200 Subject: [PATCH 09/51] add compatibility with NC29 --- CHANGELOG.md | 4 ++++ appinfo/info.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0af2b42..c6ae03a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +## 3.12.0 +### Added +* add compatibility with NC29 + ## 3.11.8 ### Fixed * move the logo inside #nextcloud element (fix #278 #239) [NC26] diff --git a/appinfo/info.xml b/appinfo/info.xml index 47667c3..4356db9 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -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 - + From 9c5be63f16007202a60f9fe09df4d7ca46b43540 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 8 Apr 2024 14:14:16 +0200 Subject: [PATCH 10/51] ci: fix signature step (volumes) --- .woodpecker/.publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml index ef4a8a8..46564a1 100644 --- a/.woodpecker/.publish.yml +++ b/.woodpecker/.publish.yml @@ -13,7 +13,7 @@ steps: "Create signature": image: nextcloud:25 secrets: [app_certificate, app_public_certificate] - volumes: &volumes + volumes: *volumes environment: SQLITE_DATABASE: /var/www/data/data.db NEXTCLOUD_ADMIN_USER: admin From 012c660fed88acede62a9d1db6467b53875b9d02 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 8 Apr 2024 14:33:22 +0200 Subject: [PATCH 11/51] ci: rollback tag check --- .woodpecker/.publish.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml index 46564a1..2a4776b 100644 --- a/.woodpecker/.publish.yml +++ b/.woodpecker/.publish.yml @@ -10,6 +10,12 @@ when: event: [tag] steps: + "Verify tag and app version": + image: alpine + commands: + - TAG=${CI_COMMIT_TAG/v//} + - grep "$TAG" appinfo/info.xml + "Create signature": image: nextcloud:25 secrets: [app_certificate, app_public_certificate] From 38f400b24cdc0d35311ee0ccf5be886dce8b1acb Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 8 Apr 2024 15:30:20 +0200 Subject: [PATCH 12/51] fix app version number --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 4356db9..b3db9f8 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.11.8 + 3.12.0 agpl Simon Vieille SideMenu From 05c35b9a63af1dce36844c56e055687c72fa8dac Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 27 Jun 2024 20:08:56 +0200 Subject: [PATCH 13/51] retrieve tables apps --- lib/Service/AppRepository.php | 59 ++++++++++++++--------------------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/lib/Service/AppRepository.php b/lib/Service/AppRepository.php index ec10a36..d53317c 100644 --- a/lib/Service/AppRepository.php +++ b/lib/Service/AppRepository.php @@ -5,6 +5,11 @@ namespace OCA\SideMenu\Service; use OC\User\User; use OCP\INavigationManager; use OCP\L10N\IFactory; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; +use OCP\IUserSession; +use OCP\AppFramework\Http\TemplateResponse; +use OCA\SideMenu\AppInfo\Application; /** * class AppRepository. @@ -13,43 +18,19 @@ use OCP\L10N\IFactory; */ class AppRepository { - /** - * @var \OC_App - */ - protected $ocApp; - - /** - * @var IFactory - */ - protected $l10nFactory; - - /** - * @var ConfigProxy - */ - protected $config; - - /** - * @var CategoryRepository - */ - protected $categoryRepository; - - /** - * @var INavigationManager - */ - protected $navigationManager; - public function __construct( - \OC_App $ocApp, - INavigationManager $navigationManager, - IFactory $l10nFactory, - ConfigProxy $config, - CategoryRepository $categoryRepository + protected \OC_App $ocApp, + protected INavigationManager $navigationManager, + protected IFactory $l10nFactory, + protected ConfigProxy $config, + protected CategoryRepository $categoryRepository, + protected IEventDispatcher $dispatcher, + protected IUserSession $userSession, ) { - $this->ocApp = $ocApp; - $this->l10nFactory = $l10nFactory; - $this->config = $config; - $this->navigationManager = $navigationManager; - $this->categoryRepository = $categoryRepository; + $this->dispatcher->dispatchTyped(new BeforeTemplateRenderedEvent( + $this->userSession->isLoggedIn(), + new TemplateResponse(Application::APP_NAME, '') + )); } /** @@ -90,6 +71,14 @@ class AppRepository 'external_links', ], ]; + } elseif ('tables_application' === substr($app['id'], 0, 18)) { + $visibleApps[$app['id']] = [ + 'id' => $app['id'], + 'name' => $this->getAppName($app), + 'href' => $app['href'], + 'icon' => $app['icon'], + 'category' => [], + ]; } elseif ('files' === $app['id']) { $visibleApps[$app['id']] = [ 'id' => $app['id'], From 7c5654f3bc1887c8eea8a214733d17f1445f7075 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 27 Jun 2024 20:27:31 +0200 Subject: [PATCH 14/51] add constructor property promotion add return type of methods --- lib/Controller/AdminSettingController.php | 30 +++------ lib/Controller/AppController.php | 20 +----- lib/Controller/CssController.php | 41 +++--------- lib/Controller/JsController.php | 26 ++------ lib/Controller/NavController.php | 50 +++----------- lib/Controller/PersonalSettingController.php | 30 ++------- lib/Service/AppRepository.php | 20 +++--- lib/Service/CategoryRepository.php | 44 ++---------- lib/Service/ConfigProxy.php | 7 +- lib/Service/LangRepository.php | 7 +- lib/Settings/Admin.php | 70 +++----------------- lib/Settings/AdminSection.php | 37 ++--------- lib/Settings/Personal.php | 40 ++--------- lib/Settings/PersonalSection.php | 44 ++---------- 14 files changed, 78 insertions(+), 388 deletions(-) diff --git a/lib/Controller/AdminSettingController.php b/lib/Controller/AdminSettingController.php index aa11d9a..4ecfbea 100644 --- a/lib/Controller/AdminSettingController.php +++ b/lib/Controller/AdminSettingController.php @@ -22,37 +22,25 @@ use OCA\SideMenu\AppInfo\Application; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataDownloadResponse; use OCP\AppFramework\Http\RedirectResponse; -use OCP\AppFramework\Http\Response; use OCP\IConfig; use OCP\IRequest; use OCP\IURLGenerator; class AdminSettingController extends Controller { - /** - * @var IConfig - */ - protected $config; - - /** - * @var IURLGenerator - */ - protected $urlGenerator; - - public function __construct($appName, IRequest $request, IConfig $config, IURLGenerator $urlGenerator) - { + public function __construct( + $appName, + IRequest $request, + protected IConfig $config, + protected IURLGenerator $urlGenerator + ) { parent::__construct($appName, $request); - - $this->config = $config; - $this->urlGenerator = $urlGenerator; } /** * @NoCSRFRequired - * - * @return RedirectResponse */ - public function removeCache() + public function removeCache(): RedirectResponse { $this->config->setAppValue(Application::APP_ID, 'cache-categories', '[]'); @@ -63,10 +51,8 @@ class AdminSettingController extends Controller /** * @NoCSRFRequired - * - * @return Response */ - public function exportConfiguration() + public function exportConfiguration(): DataDownloadResponse { $keys = $this->config->getAppKeys(Application::APP_ID); $appConfig = []; diff --git a/lib/Controller/AppController.php b/lib/Controller/AppController.php index 588911f..dd2993e 100644 --- a/lib/Controller/AppController.php +++ b/lib/Controller/AppController.php @@ -29,28 +29,14 @@ use OCP\IUserSession; class AppController extends Controller { - /** - * @var ConfigProxy - */ - protected $config; - - /** - * @var AppRepository - */ - protected $appRepository; - public function __construct( string $appName, IRequest $request, - AppRepository $appRepository, - IURLGenerator $urlGenerator, - ConfigProxy $config + protected AppRepository $appRepository, + protected IURLGenerator $urlGenerator, + protected ConfigProxy $config ) { parent::__construct($appName, $request); - - $this->appRepository = $appRepository; - $this->urlGenerator = $urlGenerator; - $this->config = $config; } /** diff --git a/lib/Controller/CssController.php b/lib/Controller/CssController.php index 06f7ae8..93fafb3 100644 --- a/lib/Controller/CssController.php +++ b/lib/Controller/CssController.php @@ -32,49 +32,26 @@ use OCP\IUserSession; class CssController extends Controller { - /** - * @var ConfigProxy - */ - protected $config; - - /** - * @var User - */ - protected $user; - - /** - * @var ThemingDefaults - */ - protected $theming; - - /** - * @var Color - */ - protected $color; + protected ?User $user; public function __construct( string $appName, IRequest $request, - ConfigProxy $config, - ThemingDefaults $theming, - Color $color + protected ConfigProxy $config, + protected ThemingDefaults $theming, + protected Color $color ) { parent::__construct($appName, $request); $this->user = OC::$server[IUserSession::class]->getUser(); - $this->config = $config; - $this->theming = $theming; - $this->color = $color; } /** * @NoAdminRequired * @NoCSRFRequired * @PublicPage - * - * @return Response */ - public function stylesheet() + public function stylesheet(): TemplateResponse { $response = new TemplateResponse(Application::APP_ID, 'css/stylesheet', $this->getConfig(), 'blank'); $response->addHeader('Content-Type', 'text/css'); @@ -107,15 +84,15 @@ class CssController extends Controller $isDarkThemeUserEnabled = 'dark' === $this->config->getUserValue($this->user, 'theme', '', 'accessibility'); $isBreezeDarkUserEnabled = $this->config->getUserValue($this->user, 'theme_enabled', '', 'breezedark'); - $isBreezeDarkUserEnabled = '1' === $isBreezeDarkUserEnabled || - ($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); diff --git a/lib/Controller/JsController.php b/lib/Controller/JsController.php index 13d803e..a1b26e3 100644 --- a/lib/Controller/JsController.php +++ b/lib/Controller/JsController.php @@ -32,32 +32,14 @@ use OCP\L10N\IFactory; class JsController extends Controller { - /** - * @var ConfigProxy - */ - protected $config; - - /** - * @var User - */ - protected $user; - - /** - * @var ThemingDefaults - */ - protected $themingDefaults; - - /** - * @var IFactory - */ - protected $l10nFactory; + protected ?User $user; public function __construct( string $appName, IRequest $request, - ConfigProxy $config, - ThemingDefaults $themingDefaults, - IFactory $l10nFactory + protected ConfigProxy $config, + protected ThemingDefaults $themingDefaults, + protected IFactory $l10nFactory ) { parent::__construct($appName, $request); diff --git a/lib/Controller/NavController.php b/lib/Controller/NavController.php index 50efc4c..21fb23c 100644 --- a/lib/Controller/NavController.php +++ b/lib/Controller/NavController.php @@ -19,7 +19,6 @@ namespace OCA\SideMenu\Controller; use OC; -use OC\App\AppStore\Fetcher\CategoryFetcher; use OC\URLGenerator; use OCA\SideMenu\Service\AppRepository; use OCA\SideMenu\Service\CategoryRepository; @@ -32,57 +31,24 @@ use OCP\L10N\IFactory; class NavController extends Controller { - /** - * @var ConfigProxy - */ - protected $config; - - /** - * @var AppRepository - */ - protected $appRepository; - - /** - * @var IFactory - */ - protected $l10nFactory; - - /** - * @var CategoryFetcher - */ - protected $categoryFetcher; - - /** - * @var URLGenerator - */ - protected $router; - public function __construct( string $appName, IRequest $request, - ConfigProxy $config, - AppRepository $appRepository, - CategoryRepository $categoryRepository, - URLGenerator $router, - IFactory $l10nFactory + protected ConfigProxy $config, + protected AppRepository $appRepository, + protected CategoryRepository $categoryRepository, + protected URLGenerator $router, + protected IFactory $l10nFactory ) { parent::__construct($appName, $request); - - $this->config = $config; - $this->appRepository = $appRepository; - $this->categoryRepository = $categoryRepository; - $this->l10nFactory = $l10nFactory; - $this->router = $router; } /** * @NoAdminRequired * @NoCSRFRequired * @PublicPage - * - * @return JSONResponse */ - public function items() + public function items(): JSONResponse { $user = OC::$server[IUserSession::class]->getUser(); $items = []; @@ -189,11 +155,11 @@ class NavController extends Controller usort($items, function ($a, $b) use ($categoriesLabels) { foreach ($categoriesLabels as $key => $value) { - if ($a['categoryId'] === 'other') { + if ('other' === $a['categoryId']) { return -1; } - if ($b['categoryId'] === 'other') { + if ('other' === $b['categoryId']) { return 1; } diff --git a/lib/Controller/PersonalSettingController.php b/lib/Controller/PersonalSettingController.php index fc30c35..e4f6331 100644 --- a/lib/Controller/PersonalSettingController.php +++ b/lib/Controller/PersonalSettingController.php @@ -21,40 +21,20 @@ namespace OCA\SideMenu\Controller; use OCA\SideMenu\AppInfo\Application; use OCA\SideMenu\Service\ConfigProxy; use OCP\AppFramework\Controller; -use OCP\AppFramework\Http\Response; use OCP\IConfig; use OCP\IRequest; use OCP\IUserSession; class PersonalSettingController extends Controller { - /** - * @var IConfig - */ - protected $config; - - /** - * @var ConfigProxy - */ - protected $configProxy; - - /** - * @var IUserSession - */ - protected $userSession; - public function __construct( $appName, IRequest $request, - IConfig $config, - ConfigProxy $configProxy, - IUserSession $userSession + protected IConfig $config, + protected ConfigProxy $configProxy, + protected IUserSession $userSession ) { parent::__construct($appName, $request); - - $this->config = $config; - $this->configProxy = $configProxy; - $this->userSession = $userSession; } /** @@ -63,10 +43,8 @@ class PersonalSettingController extends Controller * * @param mixed $name * @param mixed $value - * - * @return Response */ - public function valueSet($name, $value) + public function valueSet($name, $value): array { $doSave = false; $user = $this->userSession->getUser(); diff --git a/lib/Service/AppRepository.php b/lib/Service/AppRepository.php index d53317c..3c64f7d 100644 --- a/lib/Service/AppRepository.php +++ b/lib/Service/AppRepository.php @@ -3,13 +3,13 @@ namespace OCA\SideMenu\Service; use OC\User\User; -use OCP\INavigationManager; -use OCP\L10N\IFactory; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; -use OCP\IUserSession; -use OCP\AppFramework\Http\TemplateResponse; use OCA\SideMenu\AppInfo\Application; +use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; +use OCP\AppFramework\Http\TemplateResponse; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\INavigationManager; +use OCP\IUserSession; +use OCP\L10N\IFactory; /** * class AppRepository. @@ -35,10 +35,8 @@ class AppRepository /** * Retrieves visibles apps. - * - * @return array */ - public function getVisibleApps() + public function getVisibleApps(): array { $navigation = $this->navigationManager->getAll(); $appCategoriesCustom = $this->config->getAppValueArray('apps-categories-custom', '[]'); @@ -99,7 +97,7 @@ class AppRepository return $visibleApps; } - public function getAppName($app) + public function getAppName($app): string { return $this->config->getAppValue( 'app.navigation.name', @@ -108,7 +106,7 @@ class AppRepository ); } - public function getOrderedApps(?User $user = null) + public function getOrderedApps(?User $user = null): array { $apps = $this->getVisibleApps(); $orders = $this->config->getAppValueArray('apps-order', '[]'); diff --git a/lib/Service/CategoryRepository.php b/lib/Service/CategoryRepository.php index c146609..7173442 100644 --- a/lib/Service/CategoryRepository.php +++ b/lib/Service/CategoryRepository.php @@ -15,51 +15,19 @@ use OCP\L10N\IFactory; */ class CategoryRepository { - /** - * @var CategoryFetcher - */ - protected $categoryFetcher; - - /** - * @var IFactory - */ - protected $l10nFactory; - - /** - * @var ConfigProxy - */ - protected $config; - - /** - * @var IConfig - */ - protected $iConfig; - - /** - * @var IUserSession - */ - protected $userSession; - public function __construct( - CategoryFetcher $categoryFetcher, - ConfigProxy $config, - IConfig $iConfig, - IFactory $l10nFactory, - IUserSession $userSession + protected CategoryFetcher $categoryFetcher, + protected ConfigProxy $config, + protected IConfig $iConfig, + protected IFactory $l10nFactory, + protected IUserSession $userSession ) { - $this->categoryFetcher = $categoryFetcher; - $this->l10nFactory = $l10nFactory; - $this->config = $config; - $this->iConfig = $iConfig; - $this->userSession = $userSession; } /** * Retrieves categories. - * - * @return array */ - public function getOrderedCategories() + public function getOrderedCategories(): array { $currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2); $type = $this->config->getAppValue('categories-order-type', 'default'); diff --git a/lib/Service/ConfigProxy.php b/lib/Service/ConfigProxy.php index d162dfd..6745851 100644 --- a/lib/Service/ConfigProxy.php +++ b/lib/Service/ConfigProxy.php @@ -13,12 +13,7 @@ use OCP\IConfig; */ class ConfigProxy { - /** - * @var IConfig - */ - protected $config; - - public function __construct(IConfig $config) + public function __construct(protected IConfig $config) { $this->config = $config; } diff --git a/lib/Service/LangRepository.php b/lib/Service/LangRepository.php index 3c379f0..1cde40a 100644 --- a/lib/Service/LangRepository.php +++ b/lib/Service/LangRepository.php @@ -11,12 +11,7 @@ use OCP\IDBConnection; */ class LangRepository { - /** - * @var IDBConnection - */ - protected $db; - - public function __construct(IDBConnection $db) + public function __construct(protected IDBConnection $db) { $this->db = $db; } diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 86ddac4..a6c438e 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -21,75 +21,27 @@ namespace OCA\SideMenu\Settings; use OCA\SideMenu\AppInfo\Application; use OCA\SideMenu\Service\AppRepository; use OCA\SideMenu\Service\CategoryRepository; +use OCA\SideMenu\Service\Color; use OCA\SideMenu\Service\ConfigProxy; +use OCA\SideMenu\Service\LangRepository; +use OCA\Theming\ThemingDefaults; use OCP\AppFramework\Http\TemplateResponse; use OCP\IL10N; use OCP\ILogger; use OCP\Settings\ISettings; -use OCA\Theming\ThemingDefaults; -use OCA\SideMenu\Service\Color; -use OCA\SideMenu\Service\LangRepository; class Admin implements ISettings { - /** - * @var IL10N - */ - private $l; - - /** - * @var ILogger - */ - private $logger; - - /** - * @var ConfigProxy - */ - private $config; - - /** - * @var AppRepository - */ - private $appRepository; - - /** - * @var CategoryRepository - */ - private $categoryRepository; - - /** - * @var ThemingDefaults - */ - protected $theming; - - /** - * @var Color - */ - protected $color; - - /** - * @var LangRepository - */ - protected $langRepository; - public function __construct( - IL10N $l, - ILogger $logger, - ConfigProxy $config, - AppRepository $appRepository, - CategoryRepository $categoryRepository, - ThemingDefaults $theming, - Color $color, - LangRepository $langRepository + protected IL10N $l, + protected ILogger $logger, + protected ConfigProxy $config, + protected AppRepository $appRepository, + protected CategoryRepository $categoryRepository, + protected ThemingDefaults $theming, + protected Color $color, + protected LangRepository $langRepository ) { - $this->l = $l; - $this->logger = $logger; - $this->config = $config; - $this->appRepository = $appRepository; - $this->categoryRepository = $categoryRepository; - $this->theming = $theming; - $this->color = $color; - $this->langRepository = $langRepository; } /** diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php index 8629e8a..c8993b4 100644 --- a/lib/Settings/AdminSection.php +++ b/lib/Settings/AdminSection.php @@ -25,51 +25,22 @@ use OCP\Settings\IIconSection; class AdminSection implements IIconSection { - /** - * @var IL10N - */ - private $l; - - /** - * @var IURLGenerator - */ - private $url; - - public function __construct(IURLGenerator $url, IL10N $l) - { - $this->url = $url; - $this->l = $l; + public function __construct( + protected IURLGenerator $url, + protected IL10N $l + ) { } - /** - * returns the ID of the section. It is supposed to be a lower case string, - * e.g. 'ldap'. - * - * @returns string - */ public function getID() { return Application::APP_ID; } - /** - * returns the translated name as it should be displayed, e.g. 'LDAP / AD - * integration'. Use the L10N service to translate it. - * - * @return string - */ public function getName() { return $this->l->t(Application::APP_NAME); } - /** - * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. - * - * E.g.: 70 - */ public function getPriority() { return 70; diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index 57112d0..efa5e16 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -29,43 +29,13 @@ use OCP\Settings\ISettings; class Personal implements ISettings { - /** - * @var IL10N - */ - private $l; - - /** - * @var ILogger - */ - private $logger; - - /** - * @var ConfigProxy - */ - private $config; - - /** - * @var IUserSession - */ - private $userSession; - - /** - * @var AppRepository - */ - private $appRepository; - public function __construct( - IL10N $l, - ILogger $logger, - ConfigProxy $config, - IUserSession $userSession, - AppRepository $appRepository + protected IL10N $l, + protected ILogger $logger, + protected ConfigProxy $config, + protected IUserSession $userSession, + protected AppRepository $appRepository ) { - $this->l = $l; - $this->logger = $logger; - $this->config = $config; - $this->userSession = $userSession; - $this->appRepository = $appRepository; } /** diff --git a/lib/Settings/PersonalSection.php b/lib/Settings/PersonalSection.php index 58a773f..9456ff7 100644 --- a/lib/Settings/PersonalSection.php +++ b/lib/Settings/PersonalSection.php @@ -26,34 +26,13 @@ use OCP\Settings\IIconSection; class PersonalSection implements IIconSection { - /** - * @var IL10N - */ - private $l; - - /** - * @var IURLGenerator - */ - private $url; - - /** - * @var ConfigProxy - */ - private $configProxy; - - public function __construct(IURLGenerator $url, IL10N $l, ConfigProxy $configProxy) - { - $this->url = $url; - $this->l = $l; - $this->configProxy = $configProxy; + public function __construct( + protected IURLGenerator $url, + protected IL10N $l, + protected ConfigProxy $configProxy + ) { } - /** - * returns the ID of the section. It is supposed to be a lower case string, - * e.g. 'ldap'. - * - * @returns string - */ public function getID() { if ($this->configProxy->getAppValueBool('force', '0')) { @@ -63,12 +42,6 @@ class PersonalSection implements IIconSection return Application::APP_ID; } - /** - * returns the translated name as it should be displayed, e.g. 'LDAP / AD - * integration'. Use the L10N service to translate it. - * - * @return string - */ public function getName() { if ($this->configProxy->getAppValueBool('force', '0')) { @@ -78,13 +51,6 @@ class PersonalSection implements IIconSection return $this->l->t(Application::APP_NAME); } - /** - * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. - * - * E.g.: 70 - */ public function getPriority() { if ($this->configProxy->getAppValueBool('force', '0')) { From df525f985894ec39b23ad4223a033b43ae4b219d Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 5 Jul 2024 12:40:38 +0200 Subject: [PATCH 15/51] fix #348: remove .app-navigation--close translationX for always-displayed menu --- css/sideMenu.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/css/sideMenu.css b/css/sideMenu.css index 8a63202..6b30509 100644 --- a/css/sideMenu.css +++ b/css/sideMenu.css @@ -293,8 +293,9 @@ display: inline; } -.side-menu-always-displayed .app-navigation--close { - transform: translateX(calc(-100% + 50px)); +.side-menu-always-displayed .app-navigation-toggle-wrapper { + right: 0 !important; + margin-left: 0 !important; } #side-menu.side-menu-with-categories { From 3b992dc06f62ccd58d15691390aa99f5de45043c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 5 Jul 2024 12:57:15 +0200 Subject: [PATCH 16/51] release v3.13.0 --- CHANGELOG.md | 7 +++++++ appinfo/info.xml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6ae03a..300015d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## [Unreleased] +## 3.13.0 +### Added +* show apps generated with Tables (fix #349) +* add constructor property promotion +### Fixed +* remove .app-navigation--close translationX for always-displayed menu (fix #348) + ## 3.12.0 ### Added * add compatibility with NC29 diff --git a/appinfo/info.xml b/appinfo/info.xml index b3db9f8..af86e38 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.12.0 + 3.13.0 agpl Simon Vieille SideMenu From b6275c807084e2c9a531738aff3d757381ca20e2 Mon Sep 17 00:00:00 2001 From: deblan Date: Tue, 9 Jul 2024 16:43:04 +0200 Subject: [PATCH 17/51] fix link to the documentation in forgejo issue template Signed-off-by: deblan --- .gitea/issue_template/ISSUE_TEMPLATE.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/issue_template/ISSUE_TEMPLATE.yml b/.gitea/issue_template/ISSUE_TEMPLATE.yml index 96e6c28..8486a5f 100644 --- a/.gitea/issue_template/ISSUE_TEMPLATE.yml +++ b/.gitea/issue_template/ISSUE_TEMPLATE.yml @@ -26,7 +26,7 @@ body: id: configuration attributes: label: Configuration - description: Export the configuration using the admin page and copy/paste here ([documentation](https://deblan.gitnet.page/side_menu_doc/tips/#export-the-configuration)). + description: Export the configuration using the admin page and copy/paste here ([documentation](https://deblan.gitnet.page/side_menu_doc/docs/FAQ/export-config/)). value: | ``` { From 73b21039b953c45b43f9b8c857ee0280fd0fa918 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 10 Jul 2024 19:29:51 +0200 Subject: [PATCH 18/51] rewrite of the script to import config allow mysql and sqlite --- bin/import_config.php | 80 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 13 deletions(-) diff --git a/bin/import_config.php b/bin/import_config.php index f2fbd14..db5857d 100644 --- a/bin/import_config.php +++ b/bin/import_config.php @@ -1,21 +1,75 @@ prepare('UPDATE oc_appconfig SET configvalue=:value WHERE configkey=:key and appid=:appId'); + exit($code); +} -foreach ($config as $key => $value) { +function value(string $shortName, string $longName, array $options, bool $required = true): ?string +{ + $value = $options[$shortName] ?? $options[$longName] ?? null; + + if (is_array($value)) { + echo "To much --{$longName}\n"; + showUsageAndExit(1); + } + + if (empty($value) && $required) { + echo "--{$longName} is missing\n"; + showUsageAndExit(1); + } + + return $value; +} + +$options = getopt('t:f:c:h', [ + 'type:', + 'file:', + 'config:', + 'help', +]); + +$help = value('h', 'help', $options, false); +$config = value('c', 'config', $options); +$file = value('f', 'file', $options); + +if (!is_readable($config) && !is_file($config)) { + echo "No such file: {$config}\n"; + + exit(1); +} + +if (!is_readable($file) && !is_file($file)) { + echo "No such file: {$file}\n"; + + exit(1); +} + +$appConfig = json_decode(file_get_contents($file), true); + +require $config; + +if ('mysql' === $CONFIG['dbtype']) { + $pdo = new \PDO( + 'mysql:host='.$CONFIG['dbhost'].';dbname='.$CONFIG['dbname'], + $CONFIG['dbuser'], + $CONFIG['dbpassword'] + ); +} elseif ($CONFIG['dbtype']) { + $pdo = new \PDO(sprintf('sqlite:%s', $CONFIG['datadirectory'].'/owncloud.db')); +} else { + echo "dbtype is not valid\n"; + + exit(1); +} + +$stmt = $pdo->prepare('UPDATE '.$CONFIG['dbtableprefix'].'appconfig SET configvalue=:value WHERE configkey=:key and appid=:appId'); + +foreach ($appConfig as $key => $value) { $stmt->execute([ 'appId' => 'side_menu', 'key' => $key, From 827bbd7c70bdebbf17e0e6c27d17be3b31b62c34 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 10 Jul 2024 19:39:52 +0200 Subject: [PATCH 19/51] fix #354: remove the opener when the menu is always displayed --- src/SideMenu.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SideMenu.vue b/src/SideMenu.vue index 95731b3..20c7163 100644 --- a/src/SideMenu.vue +++ b/src/SideMenu.vue @@ -23,7 +23,7 @@ along with this program. If not, see . v-bind:label="settings.name" v-bind:avatar="settings.avatar" /> - + Date: Wed, 10 Jul 2024 19:47:09 +0200 Subject: [PATCH 20/51] fix extra margin between the logo and the opener --- css/sideMenu.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css/sideMenu.css b/css/sideMenu.css index 6b30509..6971df0 100644 --- a/css/sideMenu.css +++ b/css/sideMenu.css @@ -89,6 +89,10 @@ .side-menu-opener span { position: relative; left: 50px; + display: block; + width: 1px; + height: 1px; + overflow: hidden; } .side-menu-opener:active, .side-menu-opener:focus { From 83cc15b1bbee0267517e91e8b2860ad33147869e Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 10 Jul 2024 19:51:00 +0200 Subject: [PATCH 21/51] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 300015d..b2de6b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## [Unreleased] +## 3.13.1 +### Fixed +* fix #354: remove the opener when the menu is always displayed +* fix extra margin between the logo and the opener + ## 3.13.0 ### Added * show apps generated with Tables (fix #349) From 0df8b97686ba34ade3cf893335a076686b12af42 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 10 Jul 2024 19:51:51 +0200 Subject: [PATCH 22/51] update PHP requirement update app version --- appinfo/info.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index af86e38..79123d0 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.13.0 + 3.13.1 agpl Simon Vieille SideMenu @@ -55,7 +55,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_default_menu.png - + OCA\SideMenu\Settings\Admin From 0ecd828a5d93ee217ef138605e6199b398fb500b Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 6 Oct 2024 16:11:46 +0200 Subject: [PATCH 23/51] #359: fix menu category appearance --- css/sideMenu.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/css/sideMenu.css b/css/sideMenu.css index 6971df0..66a1a8c 100644 --- a/css/sideMenu.css +++ b/css/sideMenu.css @@ -225,6 +225,11 @@ .side-menu-category-title { padding-left: 10px; color: var(--side-menu-text-color, #fff); + font-weight: bold; + font-size: 20px; + margin-bottom: 12px; + line-height: 30px; + margin-top: 0; } .side-menu-loader { From 5cc856927741060e7be9b9f6a775036364f3632f Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 6 Oct 2024 16:55:57 +0200 Subject: [PATCH 24/51] [WIP] #359: update dependencies --- package.json | 86 +++++++++++++++++++++------------------ tsconfig.json | 33 +++++++++++++++ webpack.js | 110 +++++++++++++++++++++++++++++--------------------- 3 files changed, 143 insertions(+), 86 deletions(-) create mode 100644 tsconfig.json diff --git a/package.json b/package.json index 9298a83..a31de07 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,13 @@ "stylelint:fix": "./node_modules/.bin/stylelint src --fix" }, "dependencies": { + "@nextcloud/browserslist-config": "^3.0.1", + "@nextcloud/event-bus": "^3.3.1", + "@nextcloud/initial-state": "^2.2.0", + "@nextcloud/l10n": "^3.1.0", + "@vueuse/core": "^11.1.0", "axios": "^1.6.7", - "trim": "^1.0.1", - "vue": "^2.6.11" + "trim": "^1.0.1" }, "browserslist": [ "extends @nextcloud/browserslist-config" @@ -22,42 +26,46 @@ "node": ">=16.0.0" }, "devDependencies": { - "@babel/core": "^7.9.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/preset-env": "^7.9.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": "^2.1.0", - "@nextcloud/vue": "^7.12.1", - "babel-eslint": "^10.1.0", - "babel-loader": "^8.1.0", - "css-loader": "^6.10.0", - "eslint": "^8.0.0", - "eslint-config-standard": "^17.0.0", - "eslint-import-resolver-webpack": "^0.12.1", - "eslint-plugin-import": "^2.20.0", - "eslint-plugin-nextcloud": "^0.3.0", - "eslint-plugin-node": "^10.0.0", - "eslint-plugin-promise": "^6.0.0", - "eslint-plugin-standard": "^4.0.1", - "eslint-plugin-vue": "^9.0.0", - "eslint-webpack-plugin": "^3.0.0", - "file-loader": "^6.0.0", - "sass": "^1.49.9", - "sass-loader": "^13.0.2", - "stylelint": "^14.0.0", - "stylelint-config-recommended-scss": "^7.0.0", - "stylelint-scss": "^4.0.0", - "stylelint-webpack-plugin": "^3.3.0", - "url-loader": "^4.0.0", - "vue-loader": "^15", - "vue-style-loader": "^4.1.3", - "vue-template-compiler": "^2.7.13", - "webpack": "^5.0.0", - "webpack-cli": "^4.0.0", - "webpack-merge": "^4.2.2", - "webpack-node-externals": "^1.7.2" + "@babel/node": "^7.25.7", + "@babel/plugin-transform-private-methods": "^7.25.7", + "@babel/preset-typescript": "^7.24.7", + "@cypress/vue2": "^2.1.1", + "@cypress/webpack-preprocessor": "^6.0.2", + "@nextcloud/babel-config": "^1.2.0", + "@nextcloud/eslint-config": "^8.4.1", + "@nextcloud/stylelint-config": "^3.0.1", + "@nextcloud/typings": "^1.9.1", + "@nextcloud/webpack-vue-config": "^6.0.1", + "@simplewebauthn/types": "^10.0.0", + "@types/dockerode": "^3.3.29", + "@types/wait-on": "^5.3.4", + "@vue/tsconfig": "^0.5.1", + "babel-loader": "^9.2.1", + "babel-loader-exclude-node-modules-except": "^1.2.1", + "babel-plugin-module-resolver": "^5.0.2", + "colord": "^2.9.3", + "eslint-plugin-cypress": "^3.5.0", + "eslint-plugin-es": "^4.1.0", + "exports-loader": "^5.0.0", + "file-loader": "^6.2.0", + "handlebars-loader": "^1.7.3", + "jasmine-core": "~2.5.2", + "jasmine-sinon": "^0.4.0", + "jsdoc": "^4.0.2", + "raw-loader": "^4.0.2", + "sass": "^1.79.3", + "stylelint": "^16.9.0", + "stylelint-use-logical": "^2.1.2", + "ts-loader": "^9.5.0", + "ts-node": "^10.9.1", + "tslib": "^2.7.0", + "typescript": "^5.6.2", + "vue-loader": "^15.9.8", + "vue-template-compiler": "^2.7.16", + "wait-on": "^8.0.1", + "webpack": "^5.94.0", + "webpack-cli": "^5.0.2", + "webpack-merge": "^6.0.1", + "workbox-webpack-plugin": "^7.1.0" } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..cd22dba --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,33 @@ +{ + "extends": "@vue/tsconfig/tsconfig.json", + "include": ["./src/**/*.js"], + "compilerOptions": { + "types": ["node", "vue", "vue-router"], + "outDir": "./js/", + "target": "ESNext", + "module": "ESNext", + // Set module resolution to bundler and `noEmit` to be able to set `allowImportingTsExtensions`, so we can import Typescript with .ts extension + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "noEmit": true, + // Allow ts to import js files + "allowJs": true, + "allowSyntheticDefaultImports": true, + "declaration": false, + "noImplicitAny": false, + "resolveJsonModule": true, + "strict": true, + }, + "vueCompilerOptions": { + "target": 2.7 + }, + "ts-node": { + // these options are overrides used only by ts-node + // same as our --compilerOptions flag and our TS_NODE_COMPILER_OPTIONS environment variable + "compilerOptions": { + "moduleResolution": "node", + "module": "commonjs", + "verbatimModuleSyntax": false + } + } +} diff --git a/webpack.js b/webpack.js index 6e3eac8..ec5e494 100644 --- a/webpack.js +++ b/webpack.js @@ -1,54 +1,70 @@ const path = require('path') -const { VueLoaderPlugin } = require('vue-loader') -const StyleLintPlugin = require('stylelint-webpack-plugin') +const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except') +const { + VueLoaderPlugin +} = require('vue-loader') +// const StyleLintPlugin = require('stylelint-webpack-plugin') module.exports = { - devtool: "source-map", - entry: { - 'admin': path.join(__dirname, 'src', 'admin.js'), - 'sideMenu': path.join(__dirname, 'src', 'SideMenu.js'), - }, - output: { - path: path.resolve(__dirname, './js'), - publicPath: '/js', - filename: '[name].js?v=[hash]', - chunkFilename: 'chunks/[name]-[hash].js', - }, - module: { - rules: [ - { - test: /\.css$/, - use: ['vue-style-loader', 'css-loader'], - }, - { - test: /\.scss$/, - use: ['vue-style-loader', 'css-loader', 'sass-loader'], - }, - { - test: /\.vue$/, - loader: 'vue-loader', - }, - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/, - }, - { - test: /\.(png|jpg|gif|svg)$/, - loader: 'url-loader', - options: { - name: '[name].[ext]?[hash]', - limit: 8192, - }, + devtool: "source-map", + entry: { + 'admin': path.join(__dirname, 'src', 'admin.js'), + 'sideMenu': path.join(__dirname, 'src', 'SideMenu.js'), + }, + output: { + path: path.resolve(__dirname, './js'), + publicPath: '/js', + filename: '[name].js?v=[hash]', + chunkFilename: 'chunks/[name]-[hash].js', + }, + module: { + rules: [{ + test: /\.css$/, + use: ['vue-style-loader', 'css-loader'], + }, + { + test: /\.scss$/, + use: ['vue-style-loader', 'css-loader', 'sass-loader'], + }, + { + test: /\.vue$/, + loader: 'vue-loader', + }, + { + test: /\.tsx?$/, + use: [ + 'babel-loader', + { + // Fix TypeScript syntax errors in Vue + loader: 'ts-loader', + options: { + transpileOnly: true, }, + }, ], - }, - plugins: [ - new VueLoaderPlugin(), - new StyleLintPlugin(), + exclude: BabelLoaderExcludeNodeModulesExcept([]), + }, + { + test: /\.js$/, + loader: 'babel-loader', + exclude: /node_modules/, + }, + { + test: /\.(png|jpg|gif|svg)$/, + loader: 'url-loader', + options: { + name: '[name].[ext]?[hash]', + limit: 8192, + }, + }, ], - resolve: { - extensions: ['*', '.js', '.vue'], - symlinks: false, - }, + }, + plugins: [ + new VueLoaderPlugin(), + // new StyleLintPlugin(), + ], + resolve: { + extensions: ['.*', '.js', '.vue'], + symlinks: false, + }, } From 4e62b2e7dc2c18af986953386b2e40b02d4e414c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 27 Oct 2024 16:43:23 +0100 Subject: [PATCH 25/51] show apps on top menu --- package.json | 1 + src/AppMenu.vue | 138 ++++++++++++++++++++++++---------------- src/SideMenu.js | 2 - templates/js/script.php | 20 ++++++ 4 files changed, 105 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index a31de07..d5799ac 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "stylelint:fix": "./node_modules/.bin/stylelint src --fix" }, "dependencies": { + "@nextcloud/axios": "^2.5.1", "@nextcloud/browserslist-config": "^3.0.1", "@nextcloud/event-bus": "^3.3.1", "@nextcloud/initial-state": "^2.2.0", diff --git a/src/AppMenu.vue b/src/AppMenu.vue index 4e31f12..8874345 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -23,14 +23,15 @@ -