nocode-js/sequential-workflow-designer

Can I change Ui template for task or switch

Closed this issue · 5 comments

Can I change Ui template for task or switch

What you mean by template?

well usually styling of component is done by creating a html template - that is what the user meant.
Unfortunately the styling of the step components in the sequential workflow designer seems to be hard coded per step type - which makes it very inflexible.

Simple things like adding custom css classes or svg code as icons, seems impossible and require a special step components just for that,

Like also just for adding an extra description - you suddenly have to use a new component with large description.

This is the inflexibility of the current OOP approach for every styling property you need to make a new step type - so you can eventually end up with something like "MyStepComponentWithLargeBordersCustomIconsExtraDescriptionPurple"

While this would have being easily avoided by supplying a html template or more generic properties for styling. This is how at least most modern web components work.

The designer renders the flow on the canvas using SVG so it's not possible to use HTML. SVG is not flexible as HTML.

Simple things like adding custom css classes or svg code as icons, seems impossible and require a special step components just for that,

Basically, this is the core concept. If you need a dedicated view, you should implement a dedicated step component. We don't want to overload the logic responsible for rendering. The configuration for each step component should be minimal. We offer a finite amout of step components. If this is not enought, then you need to create a dedicated component. The documentation how to prepare own components is in progress (only for the pro users).

While this would have being easily avoided by supplying a html template or more generic properties for styling. This is how at least most modern web components work.

This is one factor why many frameworks are slow. They have overloaded logic responsible for rendering and customization. It's true this part may be more difficult, but the SWD is designed to work fast with a large number of steps.

Thanks well good to hear that creating custom components will be a possibility.

but still having a custom css style and svg code as icon - seems to me as basic requirements for every component - in stead of the current hardcode codes now. Also optional description instead of going for a special large view component. Otherwise we will be ending in a jungle of custom components for such simple things.

So a bit more flexibility will create wonders.

but still having a custom css style and svg code as icon - seems to me as basic requirements for every component

About icons, you may pass them via data: URLs. You don't need to use files.

About CSS, yeah this part may be a bit complicated. Basically, the designer has separated a layout with styling. I have an idea to solve this by SASS functions. But it's not started yet.

Also optional description instead of going for a special large view component.

That sounds like a custom component for me. The SWD is used by many people that like the simplicity of the task step component. Not all users want there any description (even if optional).