Unhide "scripts"/triggerless rules from "Rules" view#4290
Conversation
…pt" tag Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
#5875 Bundle Size — 13.84MiB (~+0.01%).9dda24d(current) vs efb9ad3 main#5873(baseline) Warning Bundle contains 2 duplicate packages – View duplicate packages Bundle metrics
|
| Current #5875 |
Baseline #5873 |
|
|---|---|---|
1.46MiB |
1.46MiB |
|
0B |
0B |
|
0% |
0% |
|
842 |
842 |
|
981 |
981 |
|
2743 |
2743 |
|
0 |
0 |
|
0% |
0% |
|
122 |
122 |
|
1 |
1 |
Bundle size by type
1 change
1 regression
| Current #5875 |
Baseline #5873 |
|
|---|---|---|
11.53MiB (~+0.01%) |
11.53MiB |
|
902.38KiB |
902.38KiB |
|
638.41KiB |
638.41KiB |
|
526.1KiB |
526.1KiB |
|
295.6KiB |
295.6KiB |
|
847B |
847B |
Bundle analysis report Branch Nadahar:unhide-triggerless Project dashboard
Generated by RelativeCI Documentation Report issue
|
I would like to discuss this properly in an issue before changing it, also with an outline what to change and how. |
|
Sure, I had just had this in the back of my mind for a while that it would be a nice "first step" so that "Scripts" weren't suddenly removed before users had "gotten used to" them showing in "Rules", and then suddenly the 5.2.0 release was getting very close, so I just did this. The thing is that the whole thing is quite unnatural as it is, because you can create rules without triggers already. The only difference between that and a script is the The exception is DSL rules, where To me, changing this just means getting rid of an inconsistency/obstacle. |
As was discussed here: openhab/openhab-core#5462 (comment), there seem to be some agreement that we should move away from the "script" concept, even though the exact road to get there isn't clear.
There is no technical difference between a triggerless rule and a "script", except that a "script" has the
Scripttag applied to it. This tag triggers specific functionality in MainUI that hides the rule under "Rules" inrules-list.vueand makes it show up under "Scripts" instead. However, "Scripts" doesn't allow the user to access the rule itself, it opens the script editor for the firstActiondirectly.DSL rules that have the
.scriptextension automatically gets theScripttag applied. For other scripting languages, you must specifically create it under "Scripts" to have the tag applied - but it also prevents you from seeing the YAML view, modifying various details, and adding triggers or conditions. If you create it under "Rules" instead, you don't have all these restrictions, and the only thing you can't do with such a rule is to add theScripttag, because that tag is "banned" and is ignored if you try.This PR simply removes the hiding of rules with the
Scripttag from the "Rules" view and unbans theScripttag so that it's possible to add manually. Apart from that, nothing else is changed, "Scripts" behave as before.I see this as a "soft" first step towards removing the artificial difference in treatment between rules with and without the
Scripttag.