Переглянути джерело

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): if os.path.exists(fpath):
with open(fpath, 'r') as f: with open(fpath, 'r') as f:
self.script = render_include(f.read()) self.script = render_include(f.read())
self.script += f"\n\n//# sourceURL={page_name}.js"


# css # css
fpath = os.path.join(path, page_name + '.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): if os.path.exists(script_path):
with open(script_path, "r") as f: with open(script_path, "r") as f:
script = f.read() script = f.read()
script += f"\n\n//# sourceURL={scrub(report.name)}.js"


html_format = get_html_format(print_path) html_format = get_html_format(print_path)


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


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


Завантаження…
Відмінити
Зберегти