Closed Dimich-x33 closed 4 years ago
Hi @Dimich-x33, we're glad you're making this feature request because it's scheduled on our roadmap. However, we had some base requirements for it. One of them being Monaco. We're planning on converting actions to TS so typings support is very useful in this case.
How difficult would it be to convert your code to use Monaco? Let us know what you think!
@rndlaine I've already integrated the monaco-editor(of course with syntax highlight and intellisence for javascript) into action-property-editor. Current user flow is:
NodeProperties
dialog;Add new action
to open action creating dialog;Execute code
;EvalJS
;script
and button open editor
wich opens new dialog that contains monaco-editor with buttons save
and close
;save
and close
to finish editing;user
, temp
, session
to be able get them in next actions;All of these things above are already implemented. But currently without support for typescript.
Will fork the repo tomorrow to show the changes
@rndlaine I've pushed my changes into forked botpress repo here. Please take a look a them!
Awesome @Dimich-x33 we're gonna take a look at it thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello Botpress team,
I was inspired by this idea and found it very useful not only for me. But I want to have it as simple as possible - without heavy editors like monaco, but the final conclusion is up to you. Here are few things I imagine important to implement to run user-defined JS code inside one of builtin actions:
Create a builtin action that allows to run code which is stored as payload of action
session
,temp
,user
and other context-related variables and make them protected but still available for mutationAdd ability to edit code using one of simple editors like https://ace.c9.io
I already have almost completed implementation. Please, concider to include this functionality into botpress. Let me contribute and create PR after positive conlusion.
Regards, Dima