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

Scottx611x/serialize tool definitions #2747

Merged
merged 3 commits into from
May 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions refinery/tool_manager/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class ToolSerializer(serializers.ModelSerializer):
container_url = CharField(source="get_relative_container_url")
relaunch_url = CharField() # this maps to Tool.relaunch_url
dataset = DataSetSerializer()
tool_definition = ToolDefinitionSerializer()

class Meta:
model = Tool
Expand Down
4 changes: 3 additions & 1 deletion refinery/tool_manager/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
from file_store.models import FileStoreItem, FileType
from tool_manager.management.commands.load_tools import \
Command as LoadToolsCommand
from tool_manager.serializers import ToolDefinitionSerializer
from tool_manager.tasks import django_docker_cleanup

from .models import (FileRelationship, GalaxyParameter, InputFile, Parameter,
Expand Down Expand Up @@ -2922,7 +2923,8 @@ def test_api_response_has_proper_fields_present(self):
'name': self.tool.name,
'owner': self.tool._get_owner_info_as_dict(),
'relaunch_url': self.tool.relaunch_url,
'tool_definition': self.tool.tool_definition.pk,
'tool_definition':
ToolDefinitionSerializer(self.tool.tool_definition).data,
'uuid': self.tool.uuid
}

Expand Down
4 changes: 2 additions & 2 deletions refinery/ui/source/js/dashboard/partials/history-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h4 class="emphasized text-align-center m-t-1-5">
<ul class="list-unstyled scrollable-list main-content-list">
<li ng-repeat="tool in $ctrl.tools" class="event-item">
{{ tool.modification_date | date:"MM/dd/yyyy" }}
<span class="p-l-1-2" ng-if="tool.tool_definition === 2">
<span class="p-l-1-2" ng-if="tool.tool_definition.tool_type === 'WORKFLOW'">
<a ng-href="/data_sets/{{ tool.dataset.uuid }}/#/analyses">
<i class="fa fa-cogs"></i>
<span ng-if="tool.owner.full_name">
Expand All @@ -31,7 +31,7 @@ <h4 class="emphasized text-align-center m-t-1-5">
launched an analysis: {{ tool.name }}
</a>
</span>
<span class="p-l-1-2" ng-if="tool.tool_definition === 1">
<span class="p-l-1-2" ng-if="tool.tool_definition.tool_type === 'VISUALIZATION'">
<a ng-href="/data_sets/{{ tool.dataset.uuid }}/#/visualizations">
<i class="fa fa-bar-chart"></i>
<span ng-if="tool.owner.full_name">
Expand Down