diff --git a/.npmrc b/.npmrc
new file mode 100644
index 00000000..c42da845
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+engine-strict = true
diff --git a/client/app/pages/dashboards/components/ShareDashboardDialog.jsx b/client/app/pages/dashboards/components/ShareDashboardDialog.jsx
index 948c2b7a..5473a0b7 100644
--- a/client/app/pages/dashboards/components/ShareDashboardDialog.jsx
+++ b/client/app/pages/dashboards/components/ShareDashboardDialog.jsx
@@ -118,28 +118,9 @@ class ShareDashboardDialog extends React.Component {
/>
{dashboard.public_url && (
- <>
-
-
- Custom rule for hiding filter components when sharing links:
-
- You can hide filter components by appending `&hide_filter={"{{"} component_name{"}}"}` to the
- sharing URL.
-
- Example: http://{"{{"}ip{"}}"}:{"{{"}port{"}}"}/public/dashboards/{"{{"}id{"}}"}
- ?p_country=ghana&p_site=10&hide_filter=country
-
- }
- type="warning"
- />
-
-
-
-
-
- >
+
+
+
)}
diff --git a/package.json b/package.json
index 3d50abed..bdec7868 100644
--- a/package.json
+++ b/package.json
@@ -35,6 +35,7 @@
},
"engines": {
"node": ">14.16.0 <17.0.0",
+ "npm": "please-use-yarn",
"yarn": "^1.22.10"
},
"author": "Redash Contributors",
diff --git a/redash/query_runner/cass.py b/redash/query_runner/cass.py
index c95e1c68..1a56b993 100644
--- a/redash/query_runner/cass.py
+++ b/redash/query_runner/cass.py
@@ -26,7 +26,7 @@ def generate_ssl_options_dict(protocol, cert_path=None):
return ssl_options
-def json_encoder(dec, o):
+def custom_json_encoder(dec, o):
if isinstance(o, sortedset):
return list(o)
return None
diff --git a/redash/query_runner/mongodb.py b/redash/query_runner/mongodb.py
index 000aaf2d..e22d76ca 100644
--- a/redash/query_runner/mongodb.py
+++ b/redash/query_runner/mongodb.py
@@ -42,7 +42,7 @@
}
-def json_encoder(dec, o):
+def custom_json_encoder(dec, o):
if isinstance(o, ObjectId):
return str(o)
elif isinstance(o, Timestamp):
diff --git a/redash/query_runner/pg.py b/redash/query_runner/pg.py
index 763dc273..6b9422a7 100644
--- a/redash/query_runner/pg.py
+++ b/redash/query_runner/pg.py
@@ -55,7 +55,7 @@
}
-def json_encoder(dec, o):
+def custom_json_encoder(dec, o):
if isinstance(o, Range):
# From: https://github.com/psycopg/psycopg2/pull/779
if o._bounds is None:
diff --git a/redash/utils/__init__.py b/redash/utils/__init__.py
index b69658a1..f0376760 100644
--- a/redash/utils/__init__.py
+++ b/redash/utils/__init__.py
@@ -70,14 +70,11 @@ def generate_token(length):
return "".join(rand.choice(chars) for x in range(length))
-json_encoders = [m.custom_json_encoder for m in sys.modules if hasattr(m, "custom_json_encoder")]
-
-
class JSONEncoder(json.JSONEncoder):
"""Adapter for `json.dumps`."""
def __init__(self, **kwargs):
- self.encoders = json_encoders
+ self.encoders = [m.custom_json_encoder for m in sys.modules.values() if hasattr(m, "custom_json_encoder")]
super().__init__(**kwargs)
def default(self, o):
@@ -111,7 +108,7 @@ def default(self, o):
elif isinstance(o, bytes):
result = binascii.hexlify(o).decode()
else:
- result = super(JSONEncoder, self).default(o)
+ result = super().default(o)
return result