From ac13f29f70a72fa7d3449bcb6f154b9cc35a239d Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Sat, 20 Mar 2021 09:47:01 +0100 Subject: [PATCH] Use label pads for menus, fix mysql github actions and badges --- .github/workflows/tests.yml | 17 +++++++++-------- CHANGELOG.md | 5 +++++ README.md | 2 +- config/locales/de.yml | 1 + config/locales/en.yml | 1 + init.rb | 6 +++--- lib/redmine_hedgedoc/version.rb | 2 +- test/support/database-mysql.yml | 24 +++--------------------- 8 files changed, 24 insertions(+), 34 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d3afc70..851268e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,13 +32,12 @@ jobs: --health-retries 5 mysql: - image: mysql:5.7 + image: mysql:8.0 env: - MYSQL_USER: root - MYSQL_PASSWORD: '' - MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_ROOT_PASSWORD: 'BestPasswordEver' ports: - - 3306:3306 + # will assign a random free host port + - 3306/tcp options: >- --health-cmd="mysqladmin ping" --health-interval=10s @@ -48,7 +47,7 @@ jobs: steps: - name: Verify MySQL connection from host run: | - mysql --host 127.0.0.1 --port 3306 -uroot -e "SHOW DATABASES" + mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -pBestPasswordEver -e "SHOW DATABASES" if: matrix.db == 'mysql' - name: Checkout Redmine @@ -103,6 +102,7 @@ jobs: - name: Generate session store secret env: RAILS_ENV: test + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} working-directory: redmine run: | bundle exec rake generate_secret_token @@ -110,6 +110,7 @@ jobs: - name: Run Redmine DB and migration tasks env: RAILS_ENV: test + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} working-directory: redmine run: | bundle exec rake db:create:all @@ -126,12 +127,12 @@ jobs: - name: Import MySQL dump with hedgedoc working-directory: redmine run: | - mysql --host 127.0.0.1 --port 3306 -uroot hedgedoc < plugins/redmine_hedgedoc/test/support/hedgedoc-mysql.sql + mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -pBestPasswordEver hedgedoc < plugins/redmine_hedgedoc/test/support/hedgedoc-mysql.sql if: matrix.db == 'mysql' - name: Run tests env: RAILS_ENV: test - REDMINE_VERSION: ${{ matrix.redmine }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} working-directory: redmine run: bundle exec rake redmine:plugins:test NAME=redmine_hedgedoc RUBYOPT="-W0" diff --git a/CHANGELOG.md b/CHANGELOG.md index b94a7bc..6ca8943 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========= +v1.0.4 +------ + +- Use label Pads for menu + v1.0.3 ------ diff --git a/README.md b/README.md index 318db50..147acbe 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ HedgeDoc plugin for Redmine =========================== -[![Rate at redmine.org](https://img.shields.io/badge/rate%20at-redmine.org-blue.svg?style=fla)](https://www.redmine.org/plugins/redmine_hedgedoc) [![Run Rubocop](https://github.com/AlphaNodes/redmine_hedgedoc/workflows/Run%20Rubocop/badge.svg)](https://github.com/AlphaNodes/redmine_hedgedoc/actions?query=workflow%3A%22Run+Rubocop%22) [![Run Brakeman](https://github.com/AlphaNodes/redmine_hedgedoc/workflows/Run%20Brakeman/badge.svg)](https://github.com/AlphaNodes/redmine_hedgedoc/actions?query=workflow%3A%22Run+Brakeman%22) [![Run Tests](https://github.com/AlphaNodes/redmine_hedgedoc/workflows/Tests/badge.svg)](https://github.com/AlphaNodes/redmine_hedgedoc/actions?query=workflow%3ATests) +[![Rate at redmine.org](https://img.shields.io/badge/rate%20at-redmine.org-blue.svg?style=fla)](https://www.redmine.org/plugins/redmine_hedgedoc) [![Run Rubocop](https://github.com/AlphaNodes/redmine_hedgedoc/workflows/Run%20Rubocop/badge.svg)](https://github.com/AlphaNodes/redmine_hedgedoc/actions/workflows/rubocop.yml) [![Run Brakeman](https://github.com/AlphaNodes/redmine_hedgedoc/workflows/Run%20Brakeman/badge.svg)](https://github.com/AlphaNodes/redmine_hedgedoc/actions/workflows/brakeman.yml) [![Run Tests](https://github.com/AlphaNodes/redmine_hedgedoc/workflows/Tests/badge.svg)](https://github.com/AlphaNodes/redmine_hedgedoc/actions/workflows/tests.yml) Features -------- diff --git a/config/locales/de.yml b/config/locales/de.yml index 992cb36..a2d4dd2 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -10,3 +10,4 @@ de: label_hedgedoc_list_info_html: 'Hinweis: Aufgelistet werden alle eigenen PADs und alle nicht-privaten PADs, welche im PAD Titel als Präfix eine Redmine Projektkennung verwenden (z.B. "testprojekt: Mein PAD"). Hat man in Redmine Zugriff auf die Projekte mit dieser Projektkennung, dann werden diese PADs allen Projektmitgliedern angezeigt.
Informieren Sie Ihre HedgeDoc Benutzer, dass PADs mit einem korrekten Projektpräfix automatisch in Redmine gelistet werden, sofern der Autor ein Redmine Benutzer ist.' label_hedgedoc_project_list_info_html: 'Hinweis: Es werden alle PADs mit dem Präfix "%{prefix}" aufgelistet, welche nicht als privat markiert sind oder wenn es die eigenen sind (z.B. "%{prefix}: Mein PAD").
Informieren Sie Ihre HedgeDoc Benutzer, dass PADs mit diesem Projektpräfix automatisch in Redmine gelistet werden, sofern der Autor ein Redmine Benutzer ist.' field_hedgedoc_permission: Berechtigung + label_hedgedoc_pads: Pads diff --git a/config/locales/en.yml b/config/locales/en.yml index d5583d1..4e09053 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -10,3 +10,4 @@ en: label_hedgedoc_list_info_html: 'Important: All your own PADs and all non-private PADs are listed here if they use a Redmine project identifier as prefix in the PAD title (e.g. "testprojekt: My PAD"). If you have access in Redmine to the projects with this project identifier, these PADs will be displayed to all project members.
Inform your HedgeDoc users that PADs with a correct project prefix are automatically listed in Redmine if the author is also a Redmine user.' label_hedgedoc_project_list_info_html: 'Important: Lists all PADs with the prefix "%{prefix}" that are not marked as private or they are your own (e.g. "%{prefix}: My PAD").
Inform your HedgeDoc users that PADs with this project prefix will automatically be listed in Redmine if the author is also a Redmine user.' field_hedgedoc_permission: Permission + label_hedgedoc_pads: Pads diff --git a/init.rb b/init.rb index 3cc5144..b8ed100 100644 --- a/init.rb +++ b/init.rb @@ -23,7 +23,7 @@ menu :top_menu, :hedgedoc, { controller: 'hedgedocs', action: 'show', project_id: nil }, - caption: :project_module_hedgedoc, + caption: :label_hedgedoc_pads, if: (proc do User.current.allowed_to?({ controller: 'hedgedocs', action: 'show' }, nil, global: true) && RedmineHedgedoc.setting(:hedgedoc_in_menu) == 'top' @@ -31,7 +31,7 @@ menu :application_menu, :hedgedoc, { controller: 'hedgedocs', action: 'show', project_id: nil }, - caption: :project_module_hedgedoc, + caption: :label_hedgedoc_pads, if: (proc do User.current.allowed_to?({ controller: 'hedgedocs', action: 'show' }, nil, global: true) && RedmineHedgedoc.setting(:hedgedoc_in_menu) == 'app' @@ -39,7 +39,7 @@ menu :project_menu, :hedgedocs, { controller: 'hedgedocs', action: 'show' }, - caption: :project_module_hedgedoc, + caption: :label_hedgedoc_pads, param: :project_id end diff --git a/lib/redmine_hedgedoc/version.rb b/lib/redmine_hedgedoc/version.rb index 4eb6e8e..037a061 100644 --- a/lib/redmine_hedgedoc/version.rb +++ b/lib/redmine_hedgedoc/version.rb @@ -1,3 +1,3 @@ module RedmineHedgedoc - VERSION = '1.0.3'.freeze + VERSION = '1.0.4'.freeze end diff --git a/test/support/database-mysql.yml b/test/support/database-mysql.yml index 45a4211..95c6ad5 100644 --- a/test/support/database-mysql.yml +++ b/test/support/database-mysql.yml @@ -1,34 +1,16 @@ -production: - adapter: mysql2 - database: redmine - host: 127.0.0.1 - port: 3306 - username: root - password: - encoding: utf8mb4 - -development: - adapter: mysql2 - database: redmine - port: 3306 - host: 127.0.0.1 - username: root - password: - encoding: utf8mb4 - test: adapter: mysql2 database: redmine - port: 3306 + port: <%= ENV["MYSQL_PORT"] %> host: 127.0.0.1 username: root - password: + password: BestPasswordEver encoding: utf8mb4 hedgedoc: adapter: mysql2 database: hedgedoc - port: 3306 + port: <%= ENV["MYSQL_PORT"] %> host: 127.0.0.1 username: root password: