-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tags & script language to script settings #1601
Conversation
Job #667: Bundle Size — 15.96MiB (+0.01%).Metrics (1 change)
Total size by type (2 changes)
|
I love the idea. Again a step forward to easier allow to the new ECMAScript version. regarding the tags: I recently added some more search criteria in /settings/rules/ (see #1540) |
I've just checked it:
FYI: The code to list rules and the one to list scripts is the same and scripts are in fact only a special type of rules. |
@ghys This is now ready for review, it's working fine on my system and doesn't print any errors to the console. |
Does it not only search for the tags but also show the tags?. Our idea until now was that everything that is searchable is also shown on the list and vice versa. |
It also shows the tags -- it behaves exactly the same like the rule overview. |
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
d8f8ff1
to
a42c802
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
Another idea I had in to add a blue "Edit YAML" list button that would let you edit the script module resp. the entire script rule in a popup editor (similar to what you have in chart pages when you add e.g. a tooltip), but that's already very nice to have and can always be done later.
@@ -243,6 +231,22 @@ export default { | |||
this.load() | |||
}) | |||
}, | |||
loadScriptModules () { | |||
this.$oh.api.get('/rest/module-types/script.ScriptAction').then((data) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny general remark:
this component is also used to edit script conditions.
I understand you probably took this into account and figured there was no reason the list of languages would be different from the action to the condition, so good enough, but just pointing it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that information.
I wasn‘t aware of this, but as there is no difference in the list of available languages for actions and conditions, this should be fine.
If I see it correctly, this component also did not take into account whether it edits an action or a condition before this PR.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com> Signed-off-by: Boris Krivonog <boris.krivonog@inova.si>
Reference #1597.
Reference openhab/openhab-addons#14005.
Description
This PR extends the script settings to allow the user to set tags and change the MIME type after creation of the script.
The ability to add and edit tags was requested several times (I think also by @rkoshak).
The ability to change the MIME type of a script after creation is very important for openHAB 4, because Nashorn will (very likely) swap it's MIME type with GraalJS, but Nashorn scripts do not run on GraalJS without some changes. With the extended script settings, the user can just change the MIME type to the new MIME type of Nashorn.
The "Script" tag that all scripts have is hidden in the settings.
How it looks
Script Creation
Note that the "Tags" section is newly added and doesn't show the "Script" tag although it is present.
Editing a Script
Here has already been a settings popup. It has been extended with tags and the ability to change the MIME type:
Note that this script settings are from a Blockly script, therefore only Javascript versions (I've only installed GraalJS) are listed. If you open these settings for a normal script, you can change the MIME type to any of the available engines, e.g. Rules DSL.
Editing a Script in a Rule
The settings are newly introduced for this case and limited to the MIME type:
/ping @ghys @rkoshak @stefan-hoehn