瀏覽代碼

fix(DX): sourceURL to debug report and page JS

version-14
Ankush Menat 4 年之前
父節點
當前提交
a6d3962b80
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. +1
    -0
      frappe/core/doctype/page/page.py
  2. +2
    -0
      frappe/desk/query_report.py

+ 1
- 0
frappe/core/doctype/page/page.py 查看文件

@@ -109,6 +109,7 @@ class Page(Document):
if os.path.exists(fpath):
with open(fpath, 'r') as f:
self.script = render_include(f.read())
self.script += f"\n\n//# sourceURL={page_name}.js"

# css
fpath = os.path.join(path, page_name + '.css')


+ 2
- 0
frappe/desk/query_report.py 查看文件

@@ -177,11 +177,13 @@ def get_script(report_name):
if os.path.exists(script_path):
with open(script_path, "r") as f:
script = f.read()
script += f"\n\n//# sourceURL={scrub(report.name)}.js"

html_format = get_html_format(print_path)

if not script and report.javascript:
script = report.javascript
script += f"\n\n//# sourceURL={scrub(report.name)}__custom"

if not script:
script = "frappe.query_reports['%s']={}" % report_name


Loading…
取消
儲存