Giter Club home page Giter Club logo

redmine_drawio's Introduction

Redmine draw.io plugin

draw.io is free online diagramming tool.

This plugin will allow embedding draw.io diagrams into Redmine wiki pages, issues descriptions and issue notes.

A note

Before submit an issue please read carefully the README.md file (this page): many of those that seem defects are instead the expected behavior for the macros, so read it before you start using this plugin and whenever you find unusual behaviors.

Requirements

  • Requires Redmine v2.6+. Tested with Redmine v3.1.4, v3.2.4, v3.3.3, v3.4.0, v4.0.4, v5.0.1 as well as Easy Redmine 2016.05.07.

Installation

  • install redmine_drawio plugin:

    cd $REDMINE_HOME/plugins
    git clone https://github.com/mikitex70/redmine_drawio.git
    
  • restart Redmine to load the new plugin

  • for macro drawio_attach make sure to enable Rest API of Redmine

  • for macro drawio_dmsf make sure to install the DMSF plugin and to enable the module for the project

  • if you have troubles with the embedded editor using Internet Explorer, try a more recent version (Internet Explorer 11 should work fine) or, better, use another browser, such as Firefox or Chrome.

Configuration

The plugin can be configured by the Redmine administrator via the Redmine interface, Administration -> Plugins -> Redmine Drawio Plugin -> Configure.

In the configuration form you can set the Drawio server url; the default is //embed.diagrams.net, to use the default internet installation regardless of the protocol. The value can be changed to use a private drawio editor installation (see more later).

An important configuration is Enable SVG diagrams: diagrams in SVG format can introduce Cross-Site Scripting security issues, so from version 1.2.0 they are handled in a different way:

  • if the field is checked, the behaviour is similar to previous releases: SVG diagrams are rendered as-is, in particular hyperlinks can be used to navigate to other pages (or sites). XSS issues are mitigated, but cannot be completely removed
  • if the field is unchecked (default), SVG diagrams are encoded and rendered as images. The quality is the same as original SVG (they scale in the same way) and there are no security issues, but hyperlink don't work.

So the Redmine administrator is responsible to choose a security level adequate to the installation (Internet vs Intranet, for example), and the usage (how much important are hyperlinks?).

In this form you can also enable the mathematical symbol support for SVG diagrams. The default is disabled because enabling this adds about 170k of Javascript to download, so enable only if you really need it.

Security

By configuring the header Content-Security-Policy in the Redmine webserver is possible to restrict what can be loaded in a web page. An example value is this:

default-src 'self'; script-src 'unsafe-inline' 'self' 'unsafe-eval'; connect-src 'self'; img-src 'self'; style-src 'unsafe-inline' 'self'

This setting is very restrictive: is allows loading scripts, stylesheets and images only from local server. This kind of setting is too restrictive for the redmine_drawio plugin, but can be relaxed a bit:

default-src 'self' embed.diagrams.net; script-src 'unsafe-inline' 'self' 'unsafe-eval' ; connect-src 'self'; img-src 'self' data: embed.diagrams.net; style-src 'unsafe-inline' 'self'

In this case we have relaxed the policy allowing to load scripts and images from embed.diagrams.net (the external site which serves the diagram editor). If security is an issue, you can use a local installation of the editor website (see the section Using a personal installation of draw.io), modifying the Content-Security-Policy header accordingly.

Another value added in the configuration above is the data: for the image-src policy: this allows to use inline embedded images, and is fundamental for the plugin to work as it is the way edited images are shown after editing without the need to reload the page.

An additional important configuration that may be present is the frame-src: it configures the policy for the use of iframes. The diagram editor is run in a iframe, so the setting must be relaxed to allow loading contents from embed.diagrams.net. Example (to be added in the Content-Security-Policy header):

frame-src: embed.diagrams.net 'self'; child-src: embed.diagrams.net 'self'

Usage

There are three macros that can be used to embed diagrams in wiki pages/issues; use what best fits your needs.

drawio macro

This macro is now deprecated and not working anymore. Use the drawio_attach macro as a direct replacement.

drawio_attach macro

This macro handles diagrams saved as attachments of issues or wiki pages.

The supported diagrams format are:

  • xml: normal diagram source in XML format
  • drawio: an alias for xml, used to load exported diagrams from the online ditor without changing the file extension
  • png: PNG image with an embedded XML source of the diagram (PNG+XML)
  • svg: SVG image with an embedded XML source of the diagram (SVG+XML)

The xml format uses a Javascript viewer to render the diagram runtime. It maybe a bit slow, but adds navigation options to the diagram (zoom, page and layer selector).

With this macro the attachments are in PNG+XML, a special format consisting in an PNG image of the diagram plus the XML diagram source embeded as a field of the image.

With an.svg attachment name extension the image format is handled as SVG+XML; like the PNG+XML, this is an SVG image with an embedded XML source of the diagram (the diagram must be created with the draw.io editor, normal SVG are displayed but cannot be edited).

WARNING: SVG images can introduce XSS(Cross-Site Scripting) security issues. For internet deploys make sure the Enable SVG diagrams configuration options is unchecked, so the svg diagrams will rendered as a base64 encoded image (no XSS issues, same quality, but hyperlinks will not work).

From version 1.0.0 are also supported diagrams in XML format (as used with the old drawio macro).

Usage is very simple:

  • make sure REST API are enabled in Redmine global settings; this is needed to be able to save diagrams as attachments. To enable it, go into Administration -> Settings -> API tab and check the Enable REST web service flag.

  • in Wiki or issue pages use the drawio_attach macro to specify the name of attachment containing the diagram. For example:

    {{drawio_attach(myDiagram)}}

    If the diagram doesn't exists, a predefined diagram will be used as a placeholder, like this:

    Diagram placeholder

    For PNG and SVG diagrams, double click on the diagram to start editing with the embedded editor. When you save the the diagram the editor will close, the diagram will be saved in a new attachment and the reference in the wiki/issue page is updated.

    For XML diagrams, a toolbar will appear when the mouse enters the diagram area; in the toolbar there is a button for start editing the diagram.

    The diagram attachments are versioned by suffixing the name with a counter. This is necessary because is not possible to update an existing attachment. Moreover, is not possible to delete attachments throught rest API (seems to be possible from Redmine 3.3.0, but I need to experiment), so the old versions of an attachment must be explicitly (manually) deleted from the Redmine web interface.

  • the following macro options are available (default values are shown):

    • size=number : force image width, in pixels (default, show in original size)
    • only for XML diagrams:
      • hilight=#0000ff: color to highlight diagram hyperlinks
      • tbautohide=true: if false the toolbar is always visibile (if there are buttons), else it will be shown only when the mouse enters the diagram area
      • lightbox=false: activates the LightBox viewer button in the toolbar
      • zoom=false: activates the zoom buttons in the toolbar
      • page=number: if not empty a page selector will appear in the toolbar (for multi-page diagrams) and the initial page (starting from 0) will be selected
      • layers: if set as a list of space separated number of layers, those layer will be activated for default, and a layer selector control will appear in the toolbar.

In the toolbar editor there is a button with icon drawio_attach icon that opens a dialog that can be used to insert a macro for a new diagram to be saved as attachment (for lazy people).

The dialog can be used also for modifying a macro: simply place the caret (the cursor in the editing area) somewhere in the body of the macro, click the corresponding button in the toolbar, and the dialog will open with fields pre-filled with values from the macro source. When confirming new values, the macro source will be updated.

drawio_dmsf macro

This macro handles diagrams saved in the DMSF repository as PNG+XML or SVG+XML images, or as XML documents (from version 1.0.0). The DMSF module must be enabled for the project to be able to use this macro.

Usage is very simple:

  • enable the WebDAV functionality of the DMSF plugin in Read/Write mode; this is necessary to be able to save the diagram from the embedded editor. If you prefer you can disable WebDAV after all editings are done. NOTE: starting from the DMSF plugin version v3.0.0 you need to modify the Redmine config/additional_environment.rb file; see here for more details.

  • in Wiki or issue pages use the drawio_dmsf macro to specify the path of the diagram, relative to the DMSF documents of the current project. For example:

    {{drawio_dmsf(diagrams/myDiagram)}}

    The path is optional, but if specified then it must exists in the DMSF managed repository. If the diagram doesn't exists a predefined diagram will be used as a placeholder, like this:

    Diagram placeholder

    For PNG and SVG diagrams, double click on the diagram to start editing with the embedded editor. When you save the the diagram the editor will close, the diagram will be saved in a new attachment and the reference in the wiki/issue page is updated.

    For XML diagrams, a toolbar will appear when the mouse enters the diagram area; in the toolbar there is a button for start editing the diagram.

  • the following macro options are available (default values are shown):

    • size=number : force image width, in pixels (default, show in original size)
    • only for XML diagrams:
      • hilight=#0000ff: color to highlight diagram hyperlinks
      • tbautohide=true: if false the toolbar is always visibile (if there are buttons), else it will be shown only when the mouse enters the diagram area
      • lightbox=false: activates the LightBox viewer button in the toolbar
      • zoom=false: activates the zoom buttons in the toolbar
      • page=number: if not empty a page selector will appear in the toolbar (for multi-page diagrams) and the initial page (starting from 0) will be selected
      • layers: if set as a list of space separated number of layers, those layer will be activated for default, and a layer selector controlo will appear in the toolbar.

Like for the drawio_attach macro, in the toolbar editor there is a button with icon drawio_attach icon that opens a dialog that can be used to insert a macro for a new diagram to be saved as DMSF document.

As for the drawio_attach macro, the dialog can be used for updating a macro simply by positioning the editing cursor in the right place and clicking the button.

Diagrams in PDF export

Starting from version 1.4.2, diagrams are included in PDF exports.

There is a limitation: if the diagram is saved in a document managed by the DMSF plugin you need at least the 'v3.0.3' version of the plugin to make the export work. And this means that it only works starting with Redmine 5.

Some note on the drawio editor

Someone can be concerned about security in sending own diagrams to the draw.io site.

The diagrams aren't sent to draw.io for editing/rendering, but all the operations are done by the browser using only Javascript and HTML5. The only things loaded externally are the scripts and the editor page, when the diagram editor is opened. The diagram source remains local to browser/redmine site.

Using a personal installation of draw.io

If you like, you can configure this plugin to use your own installation of the draw.io site.

The build of the war file is a bit problematic because the drawio macro needs a script dynamically produced by the EmbedServlet2 servlet, which is deployed in the draw.io site but not built from the default sources.

This servlet is excluded from build because of a missing library from Google, maybe because of copyright issues.

If you are planning to use only the png and svg formats you can use the source as is without troubles, but if you want/need diagrams in the xml format it is necessary to apply the embed2js.patch patch (included in this plugin sources).

The build steps are:

git clone https://github.com/jgraph/draw.io.git
cd draw.io
patch -p1 < PATH_TO_DRAWIO_PLUGIN/embed2js.patch
cd etc/build
ant war
cd ../../build

If the build ends without errors, in the build directory you should find a working version of the war file that you can deploy in your favourite servlet container (like Tomcat); be sure to enable the HTTPS protocol because is is required.

Then enter your Redmine installation, go to Administration -> Plugins -> Redmine Drawio plugin, click on the Configure link and then specify your address for the draw.io site.

Local MathJax installation

The MathJax library is used to render mathematical symbols in SVG diagrams.

Once enabled from the Redmine Drawio plugin settings it is loaded from internet every time a wiki page is rendered.

This can be slow (it's a big library) and maybe not doable behind a proxy or without an internet connection.

However it is possible to use a local installation of the library following these steps:

  1. install the MathJax library locally (through zip, svn, git, npm, ecc.) in a web server; for detailed instructions see here
  2. go to Administration -> Plugins -> Redmine Drawio plugin, click on the Configure link and:
    1. select the SVG mathemathics support
    2. fill the MathJax library URL with the URL of the installation, for example //my.server/mathjax/MathJax.js

Once updated the settings, go to a wiki page with a mathematical SVG diagram and you should see the diagram exactly as before. You can check from where the library is downloaded using the browser developer tools.

Known issues

  • Diagrams in xml format are rendered on the browser so they aren't visible inside a PDF export. As workaround you can print the web page as PDF document (easy with Linux, a bit more problematic in Windows), or export the diagram in PNG format and include it as image.

  • There can be a browser limit on the embedded diagram size. For example Opera 11 limits Data URIs size to 65000 characters. If the diagram is too big, use the xml diagram format to render the diagram from an XML source.

  • The drawio_attach macro doesn't completly work with issue notes: Redmine APIs allow to create new issue notes, but not to change them, so the issue note must be changed manually. As alternative use drawio_dmsf macro, which works fine.

TODO

  • Allow specify diagrams from other other sources:

    • use a file managed by the DMSF plugin
    • embed diagram as macro body
    • use GoogleDrive, Dropbox and OneDrive as possible diagram sources. I don't have time, and I think is not so useful
    • implement tests
    • make diagram images exportable in PDF
    • CKEditor widgets: this is a bit complicated but it would be cool. Problems:
      • first image: how to setup the initial placeholder and let be replaced when saved?
      • how to save diagrams when the wiki/issue content is new and not already saved? A "document" is needed to attach an attachment
      • url of image: the url is generated by the macro (from attachment or DMSF), using in a widget may require an AJAX call

Contributing

Any code contribution is well accepted. There are only a few rules that I would like to be respected to easy merging:

  • work on develop branch and leave the master branch untouched. This is importat to keep the released versions stable.
  • I would prefer comments in the style used by gitchangelog; this will simplify generation of the CHANGELOG.md. It isn't fundamental, I can edit comments and insert prefixes, or edit manually the CHANGELOG.md, but it would be nice if you can help me.

redmine_drawio's People

Contributors

ahorek avatar amenk avatar anton-sergeev avatar archonwang avatar athomsen avatar dinya avatar javango avatar liaham avatar maudov avatar mikitex70 avatar nanego avatar nicklesandy avatar potatogim avatar sk-ys avatar sstidl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redmine_drawio's Issues

drawio macro does not appear in chrome browser

hello

can you give me a hint ...
i activated this plugin and it works fine with firefox but now my colleague is using a current chrome browser version and when i want to add for instance a new issue the macros do NOT appear.
strange is that this works on firefox?

thanks for appreciated response

greetings michael

i have the following enviroment:
Environment:
Redmine version 3.3.2.stable
Ruby version 2.1.10-p492 (2016-04-01) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Subversion 1.9.5
Git 2.7.4
Filesystem
Redmine plugins:
clipboard_image_paste 1.10
redmine_checklists 3.1.1
redmine_ckeditor 1.1.0
redmine_contacts 4.0.2
redmine_dmsf 1.5.9
redmine_drawio 0.5.0
redmine_image_clipboard_paste 3.3.0
redmine_mail_reminder 3.0.0.0001
redmine_per_project_formatting 0.0.4
redmine_wiki_extensions 0.7.0

separate field for diagram

Hi

Thank you for that plugin!

After using it for a while, I think it would be useful to be able to set up custom fields with format "draw.io diagram"

this is because, when specifying a new feature, I want my product owners to fill mandatory fields, like:

  • Mockups
  • Datamodel diagram
  • Test cases
  • ...

And I prefer to have separate fields for that, instead of putting everything in the field "description"

So, it would be great to have the ability to define a custom field "Mockups", that can contain a draw.io diagram. And it's currently impossible with the plugin

Let me know if you think it can be useful. If needed, I can try to help

Cheers

Cyrillic symbols are not saved from the embedded editor

redmine_drawio plugin version 0.7.1 has a problem with cyrillic symbols
when the diagram is created by drawio_attach macro from the embedded editor.
When you try to save cyrillic symbols in embedded editor the following exception is thrown:

Uncaught Error: this string seems to contain (still encoded) multibytes
    at Object.arrayBufferToString (drawioEditor.js:386)
    at Object.extractImageData (drawioEditor.js:52)
    at receive (drawioEditor.js:115)

But embedding presaved diagram from draw.io with cyrillic symbols by obsolete drawio macro works fine:

2017-07-07 14 37 22

2017-07-07 14 40 05

deleted

Posted in the wrong project - stupid me!

Plugin not working when `root` route is set to custom value

Hi,

redmine_drawio doesn't seem to work if you have a custom value for your root route (in config/routes.rb within Redmine). Justification for changing the default root route is when you only have one project, and you'd like the "Home" button to go to that one project.

Original root route;

root :to => 'welcome#index', :as => 'home'

Our custom root route;

root :controller => 'projects', :action => 'show', :id => 'foobar', :as => 'home'

Error in log/production.log when going to the "Wiki" page;

Started GET "/projects/foobar/wiki" for fa80::1 at 2016-11-22 18:01:37 +0000
Processing by WikiController#show as HTML
  Parameters: {"project_id"=>"foobar"}
  Current user: foobar (id=1337)
  Rendered wiki/_content.html.erb (18.1ms)
  Rendered attachments/_form.html.erb (2.8ms)
  Rendered wiki/_sidebar.html.erb (2.6ms)
  Rendered wiki/show.html.erb within layouts/base (33.3ms)
Completed 500 Internal Server Error in 205ms (ActiveRecord: 84.8ms)

ActionView::Template::Error (No route matches {:action=>"index", :controller=>"welcome"}):
    120:   <div class="bgl"><div class="bgr">
    121:     Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> &copy; 2006-2016 Jean-Philippe Lang
    122:   </div></div>
    123: </div>
    124: </div>
    125: </div>
    126: <%= call_hook :view_layouts_base_body_bottom %>
  plugins/redmine_drawio/lib/hooks/view_hooks.rb:29:in `redmine_url'
  plugins/redmine_drawio/lib/hooks/view_hooks.rb:17:in `view_layouts_base_body_bottom'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:96:in `call_hook'
  app/views/layouts/base.html.erb:123:in `_app_views_layouts_base_html_erb___1379630492326330453_66880840'
  app/controllers/wiki_controller.rb:119:in `show'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Running Redmine 3.3.1.devel with redmine_drawio 0.3.2 (cloned from git half an hour ago).

Cannot install draw.io plugin on redmine 3.3.1

Hi!
We've updated redmine to version 3.3.1.stable and cannot install redmine_drawio plugin.
It worked well on redmine 3.2.3.
At the start hooks could not be found,
LoadError: no such file to load -- hooks/view_hooks
so we changed init.rb:
require_dependency 'hooks/view_hooks' require_dependency 'hooks/macro_dialog'
to absolute path:
require_dependency '/full/path/to/redmine/plugins/redmine_drawio/lib/hooks/view_hooks' require_dependency '/full/path/to/redmine/plugins/redmine_drawio/lib/hooks/macro_dialog'
After that another error appeared. Please have a look at log attached.
production.zip
Our current system spec:
OS: CentOS 7.0
redmine: 3.3.1.stable
ruby: 2.3.0-p0
rails: 4.2.7.1

Undefined method `alias_method_chain' for Redmine::WikiFormatting::Textile::Helper:Module

Just cloned the repo, restart the nginx and I got an error:

Message from application: undefined method `alias_method_chain' for Redmine::WikiFormatting::Textile::Helper:Module
Did you mean?  alias_method (NoMethodError)
  /var/www/redmine/plugins/redmine_drawio/lib/redmine_drawio/helpers/textile_helper.rb:18:in `<module:Helper>'
  /var/www/redmine/plugins/redmine_drawio/lib/redmine_drawio/helpers/textile_helper.rb:4:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
  /var/www/redmine/plugins/redmine_drawio/lib/redmine_drawio.rb:10:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:379:in `block in require_or_load'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:36:in `block in load_interlock'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies/interlock.rb:11:in `loading'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:36:in `load_interlock'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:357:in `require_or_load'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:335:in `depend_on'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:251:in `require_dependency'
  /var/www/redmine/plugins/redmine_drawio/after_init.rb:2:in `<top (required)>'
  /var/www/redmine/plugins/redmine_drawio/init.rb:21:in `require_relative'
  /var/www/redmine/plugins/redmine_drawio/init.rb:21:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
  /var/www/redmine/lib/redmine/plugin.rb:155:in `block in load'
  /var/www/redmine/lib/redmine/plugin.rb:146:in `each'
  /var/www/redmine/lib/redmine/plugin.rb:146:in `load'
  /var/www/redmine/config/initializers/30-redmine.rb:21:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `load'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `block in load'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `load'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/engine.rb:655:in `block in load_config_initializer'
  /usr/local/rvm/gems/ruby-2.3.5/gems/activesupport-5.1.2/lib/active_support/notifications.rb:168:in `instrument'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/engine.rb:654:in `load_config_initializer'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/engine.rb:611:in `each'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/engine.rb:611:in `block in <class:Engine>'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `instance_exec'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `run'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/initializable.rb:59:in `block in run_initializers'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/initializable.rb:48:in `each'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/initializable.rb:48:in `tsort_each_child'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:415:in `call'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:347:in `each'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:347:in `call'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
  /usr/local/rvm/rubies/ruby-2.3.5/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/initializable.rb:58:in `run_initializers'
  /usr/local/rvm/gems/ruby-2.3.5/gems/railties-5.1.2/lib/rails/application.rb:353:in `initialize!'
  /var/www/redmine/config/environment.rb:14:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>'
  /usr/local/rvm/gems/ruby-2.3.5/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
  /usr/local/rvm/gems/ruby-2.3.5/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `eval'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
Environment:
  Redmine version                3.4.3.devel
  Ruby version                   2.3.5-p376 (2017-09-14) [x86_64-linux]
  Rails version                  5.1.2
  Environment                    production
  Database adapter               PostgreSQL

Buttons are switched

Great plugin!
The new toolbar buttons are wrong though; the dmsf one generates drawio_attach and the opposite for the other one.
Also, the new embedded editor doesn't work for me, I think it's because we don't run redmine at root url, because of Bitnami.
Thanks
Roger

Errors on drawio_attach and drawio_dmsf

Hi,

The plugin is great and works correctly with the 'drawio' macro.
However, I have an error if I use the 'drawio_attach' and 'drawio_dmsf' macros.

Error executing the drawio_dmsf macro (undefined method `editable?' for #Journal:0x007fdfd55bc0e0 Did you mean? editable_by?)

Error executing the drawio_attach macro (undefined method `editable?' for #Journal:0x007fdfd55bc0e0 Did you mean? editable_by?)

Infos:

  • Redmine version 3.3.1.stable.15949
  • Ruby version 2.3.0-p0 (2015-12-25) [x86_64-linux]
  • Rails version 4.2.7.1
  • progressive_projects_list 1.0.0
  • redmine_agile 1.4.2
  • redmine_checklists 3.1.5
  • redmine_dmsf 1.5.8
  • redmine_drawio 0.3.2
  • redmine_editor_preview_tab 0.1.5

Render Redmine commands and macroses in SVG

Dear @mikitex70

Is it possible to render Redmine commands (like issue links #1) and macroses in SVG diagrams how it works for other formatted text fields in Redmine (wiki, issues, comments, etc.)?

I think "double click to edit" may be placed to diagram menu (above/below figure). Also this menu will allow other features (buttons) like "Export diagram" and so on. What do you think about that?

drawing not included in pdf export

Using the PDF export option for a Wiki page draw.io drawings are not rendered in the exported pdf file.

Info:
Editor: CKEditor

Environment:
Redmine version 3.4.4.stable
Ruby version 2.3.6-p384 (2017-12-14) [x86_64-linux]
Rails version 4.2.8
Environment production
Database adapter Mysql2
SCM:
Git 1.8.3.1
Filesystem
Redmine plugins:
redmine_agile 1.4.5
redmine_checklists 3.1.10
redmine_ckeditor 1.1.5
redmine_cms 1.1.0
redmine_contacts 4.1.2
redmine_contacts_helpdesk 3.0.9
redmine_contacts_invoices 4.1.6
redmine_crm_mailchimp 1.0.2
redmine_dmsf 1.6.0
redmine_drawio 0.8.1
redmine_favorite_projects 2.0.3
redmine_finance 2.1.3
redmine_people 1.3.2
redmine_products 2.0.4
redmine_questions 0.0.7
redmine_zenedit 0.0.2
redmineup_tags 2.0.1

Error while saving the diagram to DMSF with project names enabled in WebDAV

If I enable

dmsf_webdav_pjc_names

then redmine_drawio raises exception:

Error saving diagram:
Make sure the DMSF folder exists and is accessible

Redmine installation

Environment:
  Redmine version                3.3.1.stable
  Ruby version                   2.2.3-p173 (2015-08-18) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2

with

  redmine_dmsf                   1.5.9
  redmine_drawio                 0.6.0

Plugin configure section to choose drawio server

Hi,

My company takes privacy very seriously. For that reason, we have deployed a private drawio server in order to use it only internally without Internet access.

I have achieved to make it work modifying assets/javascripts/drawioEditor.js, concretely:

image.setAttribute('src', '//www.draw.io/images/ajax-loader.gif');
and
iframe.setAttribute('src', 'https://www.draw.io/?embed=1&ui=atlas&spin=1&modified=unsavedChanges&proto=json');

Maybe, you would like to make that feature available to everyone using the configure plugin section. It is just an idea.

Cheers and keep on with your great work!!

Can't save when diagram is embedded on the ticket main text (not in a note)

  1. Edit the ticket header / main text
  2. Add diagram
  3. Save
  4. Javascript error Cannot read property 'match' of undefined
       drawioEditor.js:217 Uncaught TypeError: Cannot read property 'match' of undefined
    at referencesDiagram (drawioEditor.js:217)
    at Object.savePage [as success] (drawioEditor.js:242)
    at j (jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js:2)
    at x (jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js:4)
    at XMLHttpRequest.b (jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js:4)

v0.7.1 is not working

After updating to redmine_drawio v0.7.1 it's not possible to insert diagrams to text:
niether

{{drawio_dmsf(fig)}}

or

{{drawio_attach(fig)}}

is not working. The figure "Double click to start drawing"

is shown. But double click hides this figure and it doesn't start draw.io window.

Define diagram macros windows doesn't work too: "Insert diagram" button is not responsible to any clicks

macros_window

Redmine installation

Environment:
  Redmine version                3.3.1.stable
  Ruby version                   2.2.3-p173 (2015-08-18) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            1.9.1
  Filesystem                     
Redmine plugins:
  a_common_libs                  2.3.0
  computed_custom_field          1.0.5
  custom_menu                    1.7.4
  easy_wbs                       2016-0.0
  redmine_agile                  1.4.1
  redmine_checklists             3.1.5
  redmine_default_custom_query   1.2.0
  redmine_dmsf                   1.5.9
  redmine_drawio                 0.7.1
  redmine_issue_tabs             1.2.2
  redmine_latex_mathjax_macro    0.3.0
  redmine_lightbox2              0.3.2
  redmine_mentions               0.0.1
  redmine_my_page                0.1.10
  redmine_presentation           0.2
  redmine_pygments               0.0.1
  redmine_sublime_markdown_codemirror 0.0.1
  redmine_tags                   3.1.1
  redmine_wiki_extensions        0.7.0
  redmine_wiki_lists             0.0.7
  sidebar_hide                   0.0.8
  view_customize                 1.1.4
  wiki_graphviz_plugin           0.7.0
  wiki_issue_fields              0.5.2

Duplicated diagram

I create a new diagram in a new issue, save it. Then I double click again for update it. Save the new diagram, refresh the page and I have 2 diagrams instead of one :
drawio

Cyrillic filenames doesn't work properly in develop branch

I update my redmine_drawio plugin version to develop branch (2017-07-06).

I have few pages with cyrillic names in macros uses like

{{drawio_dmsf(diagrams/Диаграмма.png)}

This work well in redmine_drawio v0.6.0. But after update I have blanks "Double click to start drawing" istead of my diagrams.

I try to create with develop branch

{{drawio_dmsf(diagrams/Тест)}

and

{{drawio_dmsf(diagrams/Тест.png)}

In the first case the plugin creates diagrams/.png file, in the second case it creates diagrams/.png.png file. Plugin is removing non-ascii symbols now?

P.S. I rename all cyrillic names like {{drawio_dmsf(diagrams/Диаграмма.png)} to ascii-names like {{drawio_dmsf(diagrams/Diagram.png)}. And all my diagrams are shown correctly now.

[Support] Compatibility with Easy Redmine

After installation of the plugin, the easy redmine install does not start anymore.

Can you give me some pointers on how to debug?

Message from application: No such file to load -- hooks/view_hooks (LoadError)

App 21245 stdout: 
[ 2017-04-27 13:19:29.7182 19866/7f28923eb700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /srv/easyproject/public_html: An error occurred while starting up the preloader.
  Error ID: 828d7f4b
  Error details saved to: /tmp/passenger-error-ippfcO.html
  Message from application: No such file to load -- hooks/view_hooks (LoadError)
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:360:in `require_or_load'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:317:in `depend_on'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:233:in `require_dependency'
  /srv/easyproject/public_html/plugins/redmine_drawio/init.rb:6:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  /srv/easyproject/public_html/plugins/easyproject/init.rb:385:in `load_plugin_init'
  /srv/easyproject/public_html/plugins/easyproject/init.rb:371:in `block in load_all_plugins'
  /srv/easyproject/public_html/plugins/easyproject/init.rb:370:in `each'
  /srv/easyproject/public_html/plugins/easyproject/init.rb:370:in `load_all_plugins'
  /srv/easyproject/public_html/plugins/easyproject/init.rb:339:in `init!'
  /srv/easyproject/public_html/plugins/easyproject/init.rb:391:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  /srv/easyproject/public_html/config/initializers/22-change_plugins_order.rb:15:in `load'
  /srv/easyproject/public_html/config/initializers/30-redmine.rb:21:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `block in load'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
  /usr/local/rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:651:in `load_config_initializer'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `each'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `each'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `tsort_each_child'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:415:in `call'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `call'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
  /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
  /usr/local/rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
  /srv/easyproject/public_html/config/environment.rb:14:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/rack-1.6.5/lib/rack/builder.rb:55:in `instance_eval'
  /usr/local/rvm/gems/ruby-2.3.3/gems/rack-1.6.5/lib/rack/builder.rb:55:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/passenger-5.1.2/src/helper-scripts/rack-preloader.rb:110:in `eval'
  /usr/local/rvm/gems/ruby-2.3.3/gems/passenger-5.1.2/src/helper-scripts/rack-preloader.rb:110:in `preload_app'
  /usr/local/rvm/gems/ruby-2.3.3/gems/passenger-5.1.2/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/passenger-5.1.2/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/local/rvm/gems/ruby-2.3.3/gems/passenger-5.1.2/src/helper-scripts/rack-preloader.rb:29:in `<main>'

Compatibility issue with Omniauth Google plugin

When attempting to add a diagram upon saving (from draw.io) the user is asked for a username/password however, since login was provided by Omniauth initially user does not have that information so currently impossible to use.

Resize drawio_dmsf?

Hi,

Really great plugin!

Maybe a stupid question, but is there a way to resize images printed by the drawio_dmsf macro? (similar to the zoom option for the drawio macro).

could not load drawio

@mikitex70 , please check it.
Environment:

  Redmine version                3.3.4.stable.16766
  Ruby version                   2.2.4-p230 (2015-12-16) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2

error log

Started GET "/plugin_assets/redmine_drawio/javascripts/lang/drawio_jstoolbar-zh.js" for 192.168.20.253 at 2017-07-10 10:37:52 +0800

ActionController::RoutingError (No route matches [GET] "/plugin_assets/redmine_drawio/javascripts/lang/drawio_jstoolbar-zh.js"):
  actionpack (4.2.7.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.2.7.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.7.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.7.1) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.7.1) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.7.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.5) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.5) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.7.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  actionpack (4.2.7.1) lib/action_dispatch/middleware/static.rb:120:in `call'
  rack (1.6.5) lib/rack/content_length.rb:15:in `call'
  rack (1.6.5) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.7.1) lib/rails/engine.rb:518:in `call'
  railties (4.2.7.1) lib/rails/application.rb:165:in `call'
  railties (4.2.7.1) lib/rails/railtie.rb:194:in `public_send'
  railties (4.2.7.1) lib/rails/railtie.rb:194:in `method_missing'
  thin (1.7.0) lib/thin/connection.rb:86:in `block in pre_process'
  thin (1.7.0) lib/thin/connection.rb:84:in `catch'
  thin (1.7.0) lib/thin/connection.rb:84:in `pre_process'
  thin (1.7.0) lib/thin/connection.rb:50:in `block in process'
  eventmachine (1.2.3) lib/eventmachine.rb:1076:in `call'
  eventmachine (1.2.3) lib/eventmachine.rb:1076:in `block in spawn_threadpool'

Error on Redmine v 3.3.0

Redmine::PluginRequirementError: redmine_drawio plugin requires a Redmine version between 2.6 and 3.2 but current is 3.3.0.stable
/opt/redmine-3.3.0/lib/redmine/plugin.rb:220:in block in requires_redmine' /opt/redmine-3.3.0/lib/redmine/plugin.rb:205:ineach'
/opt/redmine-3.3.0/lib/redmine/plugin.rb:205:in requires_redmine' /opt/redmine-3.3.0/plugins/redmine_drawio/init.rb:14:inblock in <top (required)>'
/opt/redmine-3.3.0/lib/redmine/plugin.rb:75:in instance_eval' /opt/redmine-3.3.0/lib/redmine/plugin.rb:75:inregister'
/opt/redmine-3.3.0/plugins/redmine_drawio/init.rb:6:in <top (required)>' /var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:inrequire'
/var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in block in require' /var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:inload_dependency'
/var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in require' /opt/redmine-3.3.0/lib/redmine/plugin.rb:155:inblock in load'
/opt/redmine-3.3.0/lib/redmine/plugin.rb:146:in each' /opt/redmine-3.3.0/lib/redmine/plugin.rb:146:inload'
/opt/redmine-3.3.0/config/initializers/30-redmine.rb:21:in <top (required)>' /var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:inload'
/var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in block in load' /var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:inload_dependency'
/var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in load' /var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/engine.rb:652:inblock in load_config_initializer'
/var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:166:in instrument' /var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/engine.rb:651:inload_config_initializer'
/var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/engine.rb:616:in block (2 levels) in <class:Engine>' /var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/engine.rb:615:ineach'
/var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/engine.rb:615:in block in <class:Engine>' /var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:ininstance_exec'
/var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in run' /var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:inblock in run_initializers'
/var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:in each' /var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/initializable.rb:44:intsort_each_child'
/var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in run_initializers' /var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/application.rb:352:ininitialize!'
/opt/redmine-3.3.0/config/environment.rb:14:in <top (required)>' /var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:inrequire'
/var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in block in require' /var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:inload_dependency'
/var/lib/gems/2.1.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in require' /var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/application.rb:328:inrequire_environment!'
/var/lib/gems/2.1.0/gems/railties-4.2.6/lib/rails/application.rb:457:in block in run_tasks_blocks' /var/lib/gems/2.1.0/gems/rake-11.2.2/exe/rake:27:in<top (required)>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)

big images in drawing causing slow thumbnail generation

When I

  1. import a big image (800 x 600px RGB-JPG, 300kB) in draw.io and
  2. close io.draw with save-option and
  3. refresh the page for update of history/thumbnails

it took 2 minutes to refresh redmine issue-page. With bigger images redmine-proxies are completely blocked and issue is not available anymore.
I see that png file with embeded xml-description was created successfully. Problem seems to be the automatic thumbnail generation an/or history-creation.

Problem install

Error:

/var/lib/gems/1.9.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require': /srv/redmine-3.0/plugins/redmine_drawio/init.rb:47: invalid multibyte char (US-ASCII) (SyntaxError)

Solution: write head init.rb

"# encoding: UTF-8"

Regards,

Duplicate footer after save charts (incompatible with redmine_wiki_extensions)

Hi Michele,

This plugin is very useful to me, thanks!

However I find it may cause some trouble when use it with another plugin.

When I finish drawing and save it back, redmine_drawio plugin may duplicate the footer which is created by redmine_wiki_extensions

Like this:

screenshot_20181024_193506

My environment:

  • Redmine: 3.4.6
  • Redmine Drawio plugin: 0.8.2
  • Redmine Wiki Extensions plugin: 0.8.1

see: https://github.com/haru/redmine_wiki_extensions

attach drawio function does not work

hello

i installed this nice plugin and the following feature does not work:
i pasted with the drawio_attach button the following line:
{{drawio_attach(US-process02.xml, size=100)}}

before i uploaded US-process02.xml in the same wiki page ...

after that i get the following message:
Diagram as XML not supported: start a new diagram and import the old

any idea?

i use 3.1.1.stable as current redmine version

thanks
michael

Display diagram from DMSF plugin

Hi mikitex70,

We are using DMSF plugin for managing documentation and works great. We ave also diagrams saved as documents and this will be great feature if wiki page can just simple display it. I am redmine administrator and javascript developer but I have no experience in Ruby but I would like to collaborate with development. If you don't mind I would like prepare patch which add such functionality to this plugin?

Diagram is attached as Name_1.png and so not shown after page reload

Easyredmine / EasyredmineCompat Branch

Steps to reproduce

  1. Go to an issue
  2. insert {{drawio_attach(test.png)}}
  3. save
  4. click to draw and draw
  5. save in drawio
  6. all fine so far, diagram is shown
  7. reload the page

See:

  • the diagram was attached as test_1.png
  • and thus is not shown in the inline note anymore (which references test.png)
  • there is no test.png attached before

Want to see:

  • Diagram still shows in the note

Mixed Content Warning / Cannot open Editor anymore

  1. insert svg Diagram to wiki page

  2. Double click to edit

  3. Chrome warning / does not load:

     Mixed Content: The page at 'https://tracker.example.com/projects/foobar/wiki/Systemlandschaft'
     was loaded over HTTPS, but requested an insecure resource 'http://www.draw.io/?
     embed=1&ui=atlas&spin=1&modified=unsavedChanges&proto=json&https=0'. This request has
     been blocked; the content must be served over HTTPS.
    

Save SVG file to DMSF error on line 1 at column xxxxxxx : expected '>'

  1. Insert{{drawio_dmsf(bahlahbahlah.svg)}} marco to wiki or issue and save svg file to DMSF
  2. Reedit bahlahbahlah.svg one or several times and save to DMSF
  3. Go DMSF to view bahlahbahlah.svg that will occur following message:

This page contains the following errors: error on line 1 at column xxxxxx: expected '>' Below is a rendering of the page up to the first error.

I download bahlahbahlah.svg to my laptop and open with editor found EOF missing '>'
Thanks a lot

Can't save diagramm

Hi, I faced with srange problem.
When I finished editing the image and press the save button, I get an error:
screenshot_15
But I use drawio_attach macro. Please help, if you have time.

Enviroment:

Environment:
  Redmine version                3.3.1.stable
  Ruby version                   2.1.0-p0 (2013-12-25) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2

Error log:

Started GET "/projects/tr-7/wiki/%d0%90%d1%80%d1%85%d0%b8%d1%82%d0%b5%d0%ba%d1%82%d1%83%d1%80%d0%b0_%d0%9f%d0%9e/%d0%90%d1%80%d1%85%d0%b8%d1%82%d0%b5%d0%ba%d1%82%d1%83%d1%80%d0%b0_%d0%9f%d0%9e.json?include=journals" for 212.116.102.34 at 2017-08-03 13:13:43 +0300

ActionController::RoutingError (No route matches [GET] "/projects/tr-7/wiki/%D0%90%D1%80%D1%85%D0%B8%D1%82%D0%B5%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%9F%D0%9E/%D0%90%D1%80%D1%85%D0%B8%D1%82%D0%B5%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%9F%D0%9E.json"):
  actionpack (4.2.7.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.2.7.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.7.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.7.1) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.7.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.7.1) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.7.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.5) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.5) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.7.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  actionpack (4.2.7.1) lib/action_dispatch/middleware/static.rb:120:in `call'
  rack (1.6.5) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.7.1) lib/rails/engine.rb:518:in `call'
  railties (4.2.7.1) lib/rails/application.rb:165:in `call'
  railties (4.2.7.1) lib/rails/railtie.rb:194:in `public_send'
  railties (4.2.7.1) lib/rails/railtie.rb:194:in `method_missing'
  passenger (4.0.38) lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  passenger (4.0.38) lib/phusion_passenger/request_handler/thread_handler.rb:142:in `accept_and_process_next_request'
  passenger (4.0.38) lib/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
  passenger (4.0.38) lib/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'

error save draw.io in wiki page (redmine:3.4.6)

Rendered plugins/redmine_drawio/app/views/redmine_drawio/_macro_dialog.html.erb (0.4ms)
Completed 200 OK in 204ms (Views: 200.1ms | ActiveRecord: 1.4ms)
Started POST "/uploads.json?filename=aa1_1.png" for 176.116.193.101 at 2018-09-06 06:59:54 +0000
Processing by AttachmentsController#upload as JSON
Parameters: {"filename"=>"aa1_1.png"}
Current user: admin (id=1)
Saving attachment '/home/redmine/data/files/2018/09/180906065954_aa1_1.png' (14727 bytes)
Rendered attachments/upload.api.rsb (0.7ms)
Completed 201 Created in 43ms (Views: 11.9ms | ActiveRecord: 5.2ms)
Started GET "/projects/sitepark/wiki/Wiki_sitepark.json?include=journals" for 176.116.193.101 at 2018-09-06 06:59:54 +0000
Processing by WikiController#show as JSON
Parameters: {"include"=>"journals", "project_id"=>"sitepark", "id"=>"Wiki_sitepark"}
Current user: admin (id=1)
Rendered wiki/show.api.rsb (2.7ms)
Completed 200 OK in 33ms (Views: 11.6ms | ActiveRecord: 5.4ms)
Started PUT "/projects/sitepark/wiki/Wiki_sitepark.json" for 176.116.193.101 at 2018-09-06 06:59:54 +0000
Processing by WikiController#update as JSON
Parameters: {"attachments"=>{"0"=>{"token"=>"17.e1e55768930d88b6a17418b1602cf3a29168c2275dd9fcf944b8987b23f27ec7", "filename"=>"aa1_1.png", "content-type"=>"image/png"}}, "wiki_page"=>{"text"=>"# Wiki sitepark\r\n\r\n{{drawio_attach(aa1_1.png,size=111)}}\r\n"}, "project_id"=>"sitepark", "id"=>"Wiki_sitepark"}
Current user: admin (id=1)
Completed 500 Internal Server Error in 27ms (ActiveRecord: 6.9ms)

NoMethodError (undefined method empty?' for nil:NilClass): plugins/redmine_messenger/lib/redmine_messenger/patches/wiki_page_patch.rb:38:in send_messenger_update'
app/models/wiki_page.rb:217:in block in save_with_content' app/models/wiki_page.rb:216:in save_with_content'
app/controllers/wiki_controller.rb:176:in update' lib/redmine/sudo_mode.rb:63:in sudo_mode

3.4.0 support

Hi,
Was in the process of upgrading a test server to the latest Redmine version, during the upgrade process the following error occurred
“Redmine::PluginRequirementError: redmine_drawio plugin requires a Redmine version between 2.6 and 3.3 but current is 3.4.0.stable.14186”

Like to know when 3.4 will be supported

Diagram attached to wiki not shown after page reload

Dear,

I've got an issue similar to the #19, in wiki page the edition of draw.io element is not display after a page reload.

Steps to reproduce

Go to an wiki
edit the drawio element
save in drawio
all fine so far, diagram is shown
reload the page

The modification disapear after the page realaod


Environment:
Redmine version 3.3.2.stable
Ruby version 2.1.10-p492 (2016-04-01) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Subversion 1.9.5
Git 2.7.4
Filesystem
Redmine plugins:
hide_journal_details 0.0.2
redmine_banner 0.1.2
redmine_default_custom_query 1.2.0
redmine_documents 1.0.0
redmine_drawio 0.8.0
redmine_my_page 0.1.10
redmine_user_specific_theme 1.2.0
redmine_wiki_extensions 0.7.0
sidebar_hide 0.0.8
vote_on_issues 1.0.2

Error 422 Unprocessable Entity

Hi,

I have installed redmine and a lot of plugins to test it but I have a problem that I havent succeed to fix it's with redmine_drowio. The installation worked perfect and I try to use it and that works well but when I try to save it I have to connect again to redmine (that work) and after this I have a litle window who show a 422 error. I don't know from where that come. If you have any ideas ?
The problem com when I use the drawio_attached button (the DMSF don't work at all) and if I joined a local save diagram that show it fine with {{drawio(MyDiagram.xml, options)}}

This is my environment :

Environment:
Redmine version 3.3.3.stable
Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Git 2.1.4
Filesystem
Redmine plugins:
a_common_libs 2.3.0
extra_queries 2.2.7
issue_charts 1.3.0
issuestats 0.0.2
parent_issue_filter 1.0.2
redmine_ckeditor 1.1.4
redmine_drawio 0.6.0
redmine_editor_preview_tab 0.1.5
redmine_emojibutton 0.4.1
redmine_favorite_projects 2.0.3
redmine_import_issues 1.0.0
redmine_issue_tabs 1.2.2
redmine_issue_templates 0.1.5
redmine_lightbox2 0.3.2
redmine_questions 0.0.7
redmine_stats 0.0.1
redmine_theme_changer 0.2.0
redmine_wiki_html_util 0.0.1
redmine_wiki_lists 0.0.7
redmine_work_time 0.3.4
sidebar_hide 0.0.8

Markdown support

Currently the toolbar button is only shown when using Textile.

It should be shown when Markdown formatting is enabled as well.

DMSF linking

Hello!
I want to use plugin with dmsf, but I have a problem.

image

On the screen you can see my diagram-file with extension .xml.
This file id is 2.

So, I link it:
image

And result:
image

Why is it?)

saving draw.io diagram -> "Attachment extension is not allowed"

Hello,
I'm facing an issue when saving DrawIO diagram in a redmine issue. Not sure if this is caused by incorrect redmine configuration (extension allowed).

Steps to reproduce:
Go to a random issue
Edit
Insert drawio diagram,
image
double-click to edit diagram
image
saving the diagram "extension not allowed"
image

--> The diagram is not saved in the issue.

Getting HTTP 422 error:
[ 2018-03-19 13:53:42.4981 129550/7f1b369cf700 age/Cor/Con/ForwardResponse.cpp:206 ]: [Client 2-6] Processing 57 bytes of application data: "33\r\n{"errors":["Attachment extension is not allowed"]}\r\n"

Maybe related to #48 (?)

Extensions allowed as per "Settings/Files/Allowed extensions":
doc, docx, pdf, xlsx, xls, txt, gif, tif, jpg, jpeg, png, ppt, mp3, wav, avi, mpg, mpeg, wmv, gz, gzip, rar, tgz, zip, html, swf, exe, vsd ,mp4, xml, msg, mov, oft, pptx, mdb, sql, ics, xml, svg, png

Environment:
Redmine version 3.4.4.stable
Ruby version 2.3.4-p301 (2017-03-30) [x86_64-linux]
Rails version 4.2.8
Environment production
Database adapter Mysql2
SCM:
Git 1.7.1
Filesystem
Redmine plugins:
advanced_roadmap_v2 2.4.2
easy_baseline 1.4
easy_gantt 1.10
easy_gantt_pro 1.10
easy_wbs 2016-0.0
redmine_agile 1.4.5
redmine_checklists 3.1.5
redmine_ckeditor 1.1.4
redmine_contacts 4.1.1
redmine_contacts_helpdesk 3.0.9
redmine_dmsf 1.6.0
redmine_drawio 0.8.1
redmine_people 1.3.0

Thx.

Error saving diagram: Not Found

Hi,

With redmine-3.3.1 and redmine_drawio version v0.4.0 (API enabled). I receive the following error after editing a diagram in a Wiki page:

Error saving diagram:
Not Found

The problem goes off if I checkout into a v0.3.2 tag. Meanwhile I will use 0.3.2 version.

If you need any additional info, please, let me know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.