open-scd icon indicating copy to clipboard operation
open-scd copied to clipboard

Editor type plug-ins should be able to be rendered without a doc being present

Open pascalwilbrink opened this issue 9 months ago • 2 comments

Currently only menu type plug-ins are supported to work without a doc being present. This should also be the case for editor type plug-ins.

Acceptance criteria

  • requiredDoc attribute should not only be present in menu type plugins but also editor type ones
  • Editor type plugins should be able to be rendered without a doc being present.
    • From a given list of editor type plugins, only the ones with requiredDoc: false are visible when no doc is loaded and then if a doc is loaded all of them are visible.
  • If no editor type plugins are rendered, don't show the mwc-tab-bar (CSS :empty)

pascalwilbrink avatar Apr 30 '24 14:04 pascalwilbrink

After implementing this change in https://github.com/openscd/open-scd/pull/1530, the tests for packages/openscd/test/unit/Plugging.test.ts stop working specifically at "add custom plugin dialog". The tests neither pass or fail just become unresponsive.

I noticed that this goes away after undoing the adding of requireDoc: true to all editor type plugins in packages/openscd/src/plugins.ts but this change is now required for all editor type plugins to tell apart the ones that should appear initially at the landing screen.

juancho0202 avatar May 24 '24 12:05 juancho0202

See the DRAFT pull-request; it can be fixed.

Sander3003 avatar Jul 23 '24 12:07 Sander3003