open-scd
open-scd copied to clipboard
Editor type plug-ins should be able to be rendered without a doc being present
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.
- From a given list of editor type plugins, only the ones with
- If no
editor
type plugins are rendered, don't show themwc-tab-bar
(CSS:empty
)
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.
See the DRAFT pull-request; it can be fixed.