Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ant Design Table changes #127

Closed
wants to merge 2 commits into from
Closed

Conversation

zitrosolrac
Copy link
Contributor

No description provided.

Copy link
Collaborator

@guzman-raphael guzman-raphael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zitrosolrac @jverswijver Submitting initial review. Nice work guys!

for comp_name, comp in (
grid["component_templates"]
if "component_templates" in grid
else grid["components"]
).items():
if re.match(
r"^(table|metadata|plot|file|slider|dropdown-query).*$",
r"^(table|djtable|metadata|plot|file|slider|dropdown-query).*$",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r"^(table|djtable|metadata|plot|file|slider|dropdown-query).*$",
r"^(table|antd-table|metadata|plot|file|slider|dropdown-query).*$",

@@ -322,6 +348,7 @@ def dj_query_route(self):
"basicquery": BasicQuery,
"plot:plotly:stored_json": PlotPlotlyStoredjsonComponent,
"table": TableComponent,
"djtable": TableComponent,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"djtable": TableComponent,
"antd-table": TableComponent,

@@ -287,12 +306,19 @@ def __init__(self, *args, **kwargs):

def dj_query_route(self):
fetch_metadata = self.fetch_metadata
print(request.args, flush=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(request.args, flush=True)

Comment on lines +41 to +42
if type(o) is UUID:
return str(o)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if type(o) is UUID:
return str(o)
if type(o) is UUID:
return str(o)
if type(o) is str and o == "NaN":
return None

return json.JSONEncoder.default(self, o)

@classmethod
def dumps(cls, obj):
return json.dumps(obj, cls=cls)
return json.dumps(obj, cls=cls).replace("NaN", "null")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return json.dumps(obj, cls=cls).replace("NaN", "null")
return json.dumps(obj, cls=cls)

@@ -77,7 +80,7 @@ def __init__(self, name, component_config, static_config, jwt_payload: dict):
self.vm_list = [
dj.VirtualModule(
s,
s,
s.replace("__DASH__", "-"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double _ -> - might be a bit easier to work with though the user would need to know this...

Suggested change
s.replace("__DASH__", "-"),
s.replace("__", "-"),

@jverswijver jverswijver mentioned this pull request Aug 24, 2022
@guzman-raphael
Copy link
Collaborator

Nice work @zitrosolrac. 🤝

Since @jverswijver is cleaning this up and including your commits, I'll go ahead and close this since the other supersedes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants