Don't wait for the database connection before rendering the Query Tool UI, for improved UX. Fixes #4453

In addition, unescape HTML entities in database names in the Query Tool title bar. Fixes #4584
This commit is contained in:
Aditya Toshniwal authored and Dave Page committed 2019-08-23 12:14:20 +01:00
1 parent 25f85fe123
commit 234efc3be7
28 files changed
+337 -449

No files matched your search

+24
View File
@@ -47,6 +47,30 @@ def underscore_escape(text):
return text
def underscore_unescape(text):
"""
This function mimics the behaviour of underscore js unescape function
The html unescape by jinja is not compatible for underscore escape
function
:param text: input html text
:return: unescaped text
"""
html_map = {
"&": '&',
"&lt;": '<',
"&gt;": '>',
"&quot;": '"',
"&#96;": '`',
"&#x27;": "'"
}
# always replace & first
for c, r in html_map.items():
text = text.replace(c, r)
return text
def is_version_in_range(sversion, min_ver, max_ver):
assert (max_ver is None or isinstance(max_ver, int))
assert (min_ver is None or isinstance(min_ver, int))