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
Jkmarx/add tools list landing page #3122
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3122 +/- ##
==========================================
- Coverage 64.15% 61.06% -3.1%
==========================================
Files 435 429 -6
Lines 30698 27483 -3215
Branches 1293 1272 -21
==========================================
- Hits 19694 16782 -2912
+ Misses 11003 10701 -302
+ Partials 1 0 -1
Continue to review full report at Codecov.
|
@@ -1,24 +0,0 @@ | |||
(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One question about ToolDefinitionSerializer.get_workflow
refinery/tool_manager/serializers.py
Outdated
def get_workflow(self, tool): | ||
if tool.workflow: | ||
return tool.workflow.uuid | ||
return tool.workflow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the 2nd return tool.workflow
always be None
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, am I being redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a little. How about something like
def get_workflow(self, tool):
return tool.workflow.uuid if tool.is_workflow() else None
or
def get_workflow(self, tool):
if tool.is_visualization():
return None # Vis Tools have no associated Workflows
return tool.workflow.uuid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how that improves anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good to be explicit if we're going to be returning a None
. Otherwise, someone could be left wondering why we're returning tool.workflow
after already running the if tool.workflow
.
Another path could be something like:
def get_workflow(self, tool):
if tool.workflow is not None: # Vis Tools have no associated Workflows
return tool.workflow.uuid
Ref #2680
Note: Just getting the components in and will focus on styling once all the pieces are in place.