wasabee-project / Wasabee-IITC

ENL DrawTools and Op Management
Apache License 2.0
30 stars 21 forks source link

Drawtools and bookmark import using wrong MPE-Dataset #260

Closed MysticJay closed 3 years ago

MysticJay commented 3 years ago

Describe the bug With IITC-CE (0.31.0) we have Multi Project Extension (MPE) support with Drawtools and Bookmarks.

Seems to use a hardcoded string to identify the localstorage ID, where it should use the dynamic assigned values in DT and BKMKS

To Reproduce Activate MPE create set of Bookmarks (in default, three should do) create a field on that Bookmarks add a new MPE project in the menu for Bookmarks and Drawtools create a different set of Bookmarks (far away) and a field with DT.

Now, still on the second project create an OP in wasabee and import the draw. Portals can not be resolved or will be resolved with the closest of the default projects.

Expected behavior Obvious

Solution Use window.plugin.drawTools.KEY_STORAGE window.plugin.bookmarks.KEY_STORAGE not hard coded strings

MysticJay commented 3 years ago

patch for importDialog.js

@@ -71,7 +71,7 @@ const ImportDialog = WDialog.extend({
  },

  drawToolsFormat() {
    const dtitems = localStorage["plugin-draw-tools-layer"];
    const dtitems = localStorage[window.plugin.drawTools.KEY_STORAGE];
    if (dtitems) {
      this._textarea.value = dtitems;
    } else {
@ @@

maybe first need to check if DT is loaded if not already done.

cloudkucooland commented 3 years ago

I've not looked at that code in a while. We will need to ensure that window.plugin.DrawTools exists (if that check isn't already in place). I almost never have DrawTools enabled.

@TheMitch2 this would be a good enhancement for you to try. If you are willing

TheMitch2 commented 3 years ago

Doesn't look hard. I'll add this into my projects.

MysticJay commented 3 years ago

Doesn't look hard. I'll add this into my projects. its pretty well documented. contact me for the links.

TheMitch2 commented 3 years ago

Fixed with PR#262