mikitex70 / redmine_drawio

Macro plugin to embed draw.io diagrams into Redmine wiki pages
MIT License
121 stars 51 forks source link

fix_for_failing_redmine_api_key_test #108

Closed liaham closed 2 years ago

liaham commented 2 years ago

Hi @mikitex70,

during redmine test with redmine_drawio plugin installed I recognized a failing redmine test since redmine_drawio creates by default an api key for the current user even if the api is disabled. This will happen in RedmineDrawio::ViewLayoutsBaseHtmlHeadHook when providing the hash code.

In order to fix that redmine test failure I created this pull request which provides the api key only if the api is enabled. Furthermore, it will render a warning for the administrator if the api is not enabled.

And of course, I added some tests. :)

Please let me know if there could be done something better.

Best Regards, liaham

Update: In contrast to the first PR I fixed a wrong api check and added further tests.