Unverified Commit 84004174 authored by Martin Cech's avatar Martin Cech Committed by GitHub
Browse files

Merge pull request #6737 from nsoranzo/release_18.05_revert_6707

[18.05] Decode tool id and version in the client, not in the API 
parents 6993dbb6 35754dc4
import $ from "jquery";
import "bootstrap";
import * as _ from "underscore";
import decodeUriComponent from "decode-uri-component";
import GalaxyApp from "galaxy";
import Router from "layout/router";
import ToolPanel from "./panels/tool-panel";
......@@ -314,7 +315,12 @@ window.app = function app(options, bootstrapped) {
/** load the center panel with a tool form described by the given params obj */
_loadToolForm: function(params) {
//TODO: load tool form code async
params.id = decodeURIComponent(params.tool_id);
if (params.tool_id) {
params.id = decodeUriComponent(params.tool_id);
}
if (params.version) {
params.version = decodeUriComponent(params.version);
}
this.page.display(new ToolForm.View(params));
},
......
......@@ -20,6 +20,7 @@
"bootstrap-tour": "https://github.com/sorich87/bootstrap-tour.git#6a1028fb562f9aa68c451f0901f8cfeb43cad140",
"bootstrap-vue": "^2.0.0-rc.8",
"d3": "3",
"decode-uri-component": "^0.2.0",
"font-awesome": "^4.7.0",
"gulp-sass": "^3.1.0",
"handsontable": "^2.0.0",
......
import logging
from json import dumps
from six.moves.urllib.parse import unquote
import galaxy.queue_worker
from galaxy import exceptions, managers, util, web
from galaxy.managers.collections_util import dictify_dataset_collection_instance
......@@ -512,9 +510,6 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
# -- Helper methods --
#
def _get_tool(self, id, tool_version=None, user=None):
id = unquote(id)
if tool_version:
tool_version = unquote(tool_version)
tool = self.app.toolbox.get_tool(id, tool_version)
if not tool:
raise exceptions.ObjectNotFound("Could not find tool with id '%s'." % id)
......
......@@ -9,7 +9,6 @@ import os
import requests
from markupsafe import escape
from six.moves.urllib.parse import unquote
from sqlalchemy import desc, false, or_, true
from sqlalchemy.orm import joinedload
......@@ -545,15 +544,6 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn
#
# -- Helper methods --
#
def _get_tool(self, id, tool_version=None, user=None):
id = unquote(id)
if tool_version:
tool_version = unquote(tool_version)
tool = self.app.toolbox.get_tool(id, tool_version)
if not tool or not tool.allow_user_access(user):
raise exceptions.ObjectNotFound("Could not find tool with id '%s'" % id)
return tool
def __api_import_from_archive(self, trans, archive_data, source=None):
try:
data = json.loads(archive_data)
......
from __future__ import print_function
import glob
import os
import shutil
......@@ -9,16 +11,20 @@ def link_up_static(f):
src = os.path.join(GXY_ROOT, 'config/plugins', f)
dest = os.path.join(GXY_ROOT, 'static/plugins', f)
dest_parent = os.path.abspath(os.path.join(dest, os.pardir))
if os.path.exists(dest):
if os.path.lexists(dest):
# We have to clear out the old staged or linked static to relink.
if os.path.islink(dest):
os.unlink(dest)
os.remove(dest)
else:
shutil.rmtree(dest)
elif not os.path.exists(dest_parent):
# Create parent dir structure to symlink directly to static.
os.makedirs(dest_parent)
os.symlink(src, dest)
try:
os.symlink(src, dest)
except Exception:
print("Error symlinking '%s' to '%s'" % (src, dest))
raise
if __name__ == "__main__":
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment