Loading client/src/components/Panels/InteractiveToolsPanel.vue +1 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ function openInteractiveTool(toolId: string) { <div class="tool-icon mr-2"> <img v-if="tool.icon" :src="getAppRoot() + 'api/tools/' + tool.id + '/icon'" :src="getAppRoot() + 'api/tools/' + encodeURIComponent(tool.id) + '/icon'" alt="tool icon" /> <FontAwesomeIcon v-else :icon="faTools" size="2x" /> </div> Loading lib/galaxy/webapps/galaxy/api/tools.py +1 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ class FetchTools: return self.service.create_fetch(trans, payload, files) @router.get( "/api/tools/{tool_id}/icon", "/api/tools/{tool_id:path}/icon", summary="Get the icon image associated with a tool", response_class=PNGIconResponse, responses={ Loading lib/galaxy_test/api/test_tools.py +14 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,20 @@ class TestToolsApi(ApiTestCase, TestsTools): assert output["label"] == "Duplicate List" assert output["inherit_format"] is True def test_tool_icon_endpoint_with_simple_id(self): response = self._get("tools/simple_tool_id/icon") self._assert_status_code_is(response, 404) def test_tool_icon_endpoint_with_toolshed_id(self): # Test complex toolshed tool ID with slashes toolshed_tool_id = "toolshed.g2.bx.psu.edu/repos/devteam/fastqc/fastqc/0.74+galaxy0" response = self._get(f"tools/{toolshed_tool_id}/icon") # We expect either 200 (if tool is installed and has icon) or 404 (if # not found), but this tests the routing either way. assert response.status_code in [200, 404] if response.status_code == 200: assert response.headers["Content-Type"] == "image/png" @skip_without_tool("test_data_source") def test_data_source_build_request(self): with self.dataset_populator.test_history() as history_id: Loading Loading
client/src/components/Panels/InteractiveToolsPanel.vue +1 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ function openInteractiveTool(toolId: string) { <div class="tool-icon mr-2"> <img v-if="tool.icon" :src="getAppRoot() + 'api/tools/' + tool.id + '/icon'" :src="getAppRoot() + 'api/tools/' + encodeURIComponent(tool.id) + '/icon'" alt="tool icon" /> <FontAwesomeIcon v-else :icon="faTools" size="2x" /> </div> Loading
lib/galaxy/webapps/galaxy/api/tools.py +1 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ class FetchTools: return self.service.create_fetch(trans, payload, files) @router.get( "/api/tools/{tool_id}/icon", "/api/tools/{tool_id:path}/icon", summary="Get the icon image associated with a tool", response_class=PNGIconResponse, responses={ Loading
lib/galaxy_test/api/test_tools.py +14 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,20 @@ class TestToolsApi(ApiTestCase, TestsTools): assert output["label"] == "Duplicate List" assert output["inherit_format"] is True def test_tool_icon_endpoint_with_simple_id(self): response = self._get("tools/simple_tool_id/icon") self._assert_status_code_is(response, 404) def test_tool_icon_endpoint_with_toolshed_id(self): # Test complex toolshed tool ID with slashes toolshed_tool_id = "toolshed.g2.bx.psu.edu/repos/devteam/fastqc/fastqc/0.74+galaxy0" response = self._get(f"tools/{toolshed_tool_id}/icon") # We expect either 200 (if tool is installed and has icon) or 404 (if # not found), but this tests the routing either way. assert response.status_code in [200, 404] if response.status_code == 200: assert response.headers["Content-Type"] == "image/png" @skip_without_tool("test_data_source") def test_data_source_build_request(self): with self.dataset_populator.test_history() as history_id: Loading