-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: Added Re-run in Console Button in Console Log Doctype #21825
feat: Added Re-run in Console Button in Console Log Doctype #21825
Conversation
the type of script would also need to be recorded in the console log so that it can be reloaded back appropriately - currently we only support 2 types: sql & python (and I'm not sure if there are any future plans for adding new types) so a checkbox might suffice OR we can try to parse the script and see if it's valid python (while reloading in sysconsole) and set the type appropriately |
@phot0n |
// refresh: function(frm) { | ||
// } | ||
refresh: function (frm) { | ||
frm.add_custom_button(__("Reload in Console"), () => { |
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.
frm.add_custom_button(__("Reload in Console"), () => { | |
frm.add_custom_button(__("Re-run in Console"), () => { |
Better naming IMO.
The solution works but it is causing one more issue, it is opening system-console/new and because of that the action button 'Logs' is missing Maybe try in the way we do in customize form. We store the doctype name in local and repopulate when it is loaded |
👀 |
frm.add_custom_button(__("Re-Run in Console"), () => { | ||
window.localStorage.setItem("system_console_code", frm.doc.script); | ||
window.localStorage.setItem("system_console_type", frm.doc.type); | ||
window.location.href = "/app/system-console"; |
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.
don't hard code routing in code.
[skip ci]
Added this button in Console Log Doctype.
Now the user can click on the button and they will be redirected to System Console and code and type will be pre populated.
System.Console.mov
What Changed:
no-docs