Skip to content

Commit

Permalink
Merge branch 'getredash:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk authored Feb 6, 2024
2 parents 6000d75 + ab39283 commit fc90c47
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 30 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict = true
25 changes: 3 additions & 22 deletions client/app/pages/dashboards/components/ShareDashboardDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,28 +118,9 @@ class ShareDashboardDialog extends React.Component {
/>
</Form.Item>
{dashboard.public_url && (
<>
<Form.Item>
<Alert
message={
<div>
Custom rule for hiding filter components when sharing links:
<br />
You can hide filter components by appending `&hide_filter={"{{"} component_name{"}}"}` to the
sharing URL.
<br />
Example: http://{"{{"}ip{"}}"}:{"{{"}port{"}}"}/public/dashboards/{"{{"}id{"}}"}
?p_country=ghana&p_site=10&hide_filter=country
</div>
}
type="warning"
/>
</Form.Item>

<Form.Item label="Secret address" {...this.formItemProps}>
<InputWithCopy value={dashboard.public_url} data-test="SecretAddress" />
</Form.Item>
</>
<Form.Item label="Secret address" {...this.formItemProps}>
<InputWithCopy value={dashboard.public_url} data-test="SecretAddress" />
</Form.Item>
)}
</Form>
</Modal>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"engines": {
"node": ">14.16.0 <17.0.0",
"npm": "please-use-yarn",
"yarn": "^1.22.10"
},
"author": "Redash Contributors",
Expand Down
2 changes: 1 addition & 1 deletion redash/query_runner/cass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion redash/query_runner/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion redash/query_runner/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 2 additions & 5 deletions redash/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit fc90c47

Please sign in to comment.