mikitex70 / redmine_drawio

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

Several versions of diagrams after edit #134

Open vomus opened 6 months ago

vomus commented 6 months ago

Hi! I just installed the plugin for redmine 5.0.7, works just fine. However when I edit my diagram and save it several times, the plugin leaves several versions of a png file attached to my wiki page. Is this a normal behaviour? Is there any way to keep only the most recent version attached?

Besides, I wonder where does the plugin keep an original XML drawing?

Thanks,

mikitex70 commented 6 months ago

Hi @vomus, this is the normal behavior: in Redmine there doesn't seem to be an API to delete attachments (I need to call it from Javascript). An alternative is to use the DMSF plugin in conjunction with the drawio_dmsf macro, in order to save the diagrams in that document manager. In this case, the diagram remains unique (but still versioned).

mikitex70 commented 6 months ago

I just found an API to delete an attachment. It seems to have been added after I created the plugin. I'll do some testing, maybe I can use it to delete previous versions of diagrams.

vomus commented 6 months ago

Ok, thanks. I also tried to figure out where it keeps the original diagram to edit when I choose to save an svg or a png. One can choose a format (gawio, svg, png) for the diagram when creating it but after working on it and saving one can further edit. It is understandable what drawio takes for editing when drawio is saved but what happens when, say, an svg is chosen?

By the way, it would be great to have a default format setting and etc. in plugin configuration... And add an ability to choose whether to keep several versions of the diagram or not.