Skip to content

Commit

Permalink
Use label pads for menus, fix mysql github actions and badges
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Mar 20, 2021
1 parent ab26f78 commit ac13f29
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 34 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -103,13 +102,15 @@ 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
- 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
Expand 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"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

v1.0.4
------

- Use label Pads for menu

v1.0.3
------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
--------
Expand Down
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ de:
label_hedgedoc_list_info_html: '<strong>Hinweis:</strong> 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 <em>allen</em> Projektmitgliedern angezeigt.<br />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: '<strong>Hinweis:</strong> 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").<br />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
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ en:
label_hedgedoc_list_info_html: '<strong>Important:</strong> 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 <em>all</em> project members.<br />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: '<strong>Important:</strong> Lists all PADs with the prefix "%{prefix}" that are not marked as private or they are your own (e.g. "%{prefix}: My PAD").<br />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
6 changes: 3 additions & 3 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@
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'
end)
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'
end)
menu :project_menu,
:hedgedocs,
{ controller: 'hedgedocs', action: 'show' },
caption: :project_module_hedgedoc,
caption: :label_hedgedoc_pads,
param: :project_id
end

Expand Down
2 changes: 1 addition & 1 deletion lib/redmine_hedgedoc/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RedmineHedgedoc
VERSION = '1.0.3'.freeze
VERSION = '1.0.4'.freeze
end
24 changes: 3 additions & 21 deletions test/support/database-mysql.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit ac13f29

Please sign in to comment.