Merge branch 'release_19.09' into dev

This commit is contained in:
Martin Cech
2019-09-17 09:34:02 -04:00
6 changed files with 47 additions and 42 deletions
@@ -65,7 +65,7 @@ export default {
});
},
onCategory(category) {
this.$emit("onCategory", category);
this.$emit("onCategory", `category:'${category}'`);
}
}
};
@@ -1,21 +1,28 @@
<template>
<div class="overflow-auto h-100 p-1" @scroll="onScroll">
<div v-if="error" class="alert alert-danger">{{ error }}</div>
<div v-else>
<b-input-group class="mb-3">
<b-input
class="mb-3"
placeholder="search repositories"
v-model="queryInput"
@input="delayQuery"
@change="setQuery"
@keydown.esc="setQuery()"
/>
<serverselection
:toolshedUrl="toolshedUrl"
:toolshedUrls="toolshedUrls"
:total="total"
:loading="loading"
@onToolshed="setToolshed"
/>
<b-input-group-append>
<b-btn :disabled="!queryInput" @click="setQuery()">
<i class="fa fa-times"/>
</b-btn>
</b-input-group-append>
</b-input-group>
<serverselection
:toolshedUrl="toolshedUrl"
:toolshedUrls="toolshedUrls"
:total="total"
:loading="loading"
@onToolshed="setToolshed"
/>
<div v-if="error" class="alert alert-danger">{{ error }}</div>
<div v-else>
<repositories
:query="query"
:scrolled="scrolled"
@@ -102,6 +109,7 @@ export default {
this.query = this.queryInput = query;
},
setToolshed(url) {
this.error = null;
this.toolshedUrl = url;
},
setTotal(total) {
@@ -110,7 +118,7 @@ export default {
setLoading(loading) {
this.loading = loading;
},
onScroll: function({ target: { scrollTop, clientHeight, scrollHeight } }) {
onScroll({ target: { scrollTop, clientHeight, scrollHeight } }) {
this.scrolled = scrollTop + clientHeight >= scrollHeight;
}
}
+3 -3
View File
@@ -75,11 +75,11 @@ postgresql:///mydatabase?host=/var/run/postgresql
For more hints on available options for the database URL, see the [SQLAlchemy documentation](https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls).
#### Deprecated MySQL support
#### MySQL database server (unsupported)
Postgres database backend is more used and better tested, please use it if you can.
Postgres database backend is far more used and better tested, please use it if you can.
In the past Galaxy supported [MySQL](https://dev.mysql.com/) but currently there are nontrivial problems associated with it so expect amount of troubleshooting when using it.
In the past Galaxy supported [MySQL](https://dev.mysql.com/), but currently there may be nontrivial problems associated with it, so expect some amount of troubleshooting when using it.
Connection string example:
```
+1 -1
View File
@@ -5071,7 +5071,7 @@ class WorkflowInvocation(UsesCreateAndUpdateTime, Dictifiable, RepresentById):
for output_dataset_assoc in self.output_datasets:
outputs.append(output_dataset_assoc)
for output_dataset_collection_assoc in self.output_dataset_collections:
outputs.append(output_dataset_collection_assoc.dataset_collection)
outputs.append(output_dataset_collection_assoc)
return outputs
@property
+4 -1
View File
@@ -335,6 +335,9 @@ class ToolShedController(BaseAPIController):
pathspec.append(params.pop("id"))
if "action" in params:
pathspec.append(params.pop("action"))
return json.loads(util.url_get(tool_shed_url, params=dict(params), pathspec=pathspec))
try:
return json.loads(util.url_get(tool_shed_url, params=dict(params), pathspec=pathspec))
except Exception as e:
raise MessageException("Invalid server response. %s." % str(e))
else:
raise MessageException("Invalid toolshed url.")
@@ -15,7 +15,6 @@ from galaxy.exceptions import ObjectNotFound
if sys.version_info > (3,):
long = int
RESERVED_SEARCH_TERMS = ["category", "owner"]
log = logging.getLogger(__name__)
schema = Schema(
@@ -159,7 +158,7 @@ class RepoSearch(object):
:returns allow_query: whoosh Query object used for filtering
results of searching in index
:returns search_term_without_filters: str that represents user's
search phrase without the wildcards
search phrase without the filters
>>> rs = RepoSearch()
>>> rs._parse_reserved_filters("category:assembly")
@@ -170,6 +169,10 @@ class RepoSearch(object):
(And([Term('categories', 'Climate Analysis')]), 'psy_maps')
>>> rs._parse_reserved_filters("climate category:'Climate Analysis' owner:'bjoern gruening' psy_maps")
(And([Term('categories', 'Climate Analysis'), Term('repo_owner_username', 'bjoern gruening')]), 'climate psy_maps')
>>> rs._parse_reserved_filters("climate category:'John Says This Fails' owner:'bjoern gruening' psy_maps")
(And([Term('categories', 'John Says This Fails'), Term('repo_owner_username', 'bjoern gruening')]), 'climate psy_maps')
>>> rs._parse_reserved_filters("climate o:'bjoern gruening' middle strings c:'John Says This Fails' psy_maps")
(And([Term('repo_owner_username', 'bjoern gruening'), Term('categories', 'John Says This Fails')]), 'climate middle strings psy_maps')
>>> rs._parse_reserved_filters("abyss category:assembly")
(And([Term('categories', 'assembly')]), 'abyss')
>>> rs._parse_reserved_filters("abyss category:assembly greg")
@@ -181,28 +184,19 @@ class RepoSearch(object):
>>> rs._parse_reserved_filters("meaningoflife:42")
(None, 'meaningoflife:42')
"""
allow_query = None
allow_terms = []
# Split query string on spaces that are not followed by <anytext>singlequote_space_
# to allow for quoting filtering values. Also unify double and single quotes into single quotes.
search_term_chunks = re.split(r"\s+(?!\w+'\s)", search_term.replace('"', "'"), re.MULTILINE)
reserved_terms = []
for term_chunk in search_term_chunks:
if ":" in term_chunk:
reserved_filter = term_chunk.split(":")[0]
# Remove the quotes used for delimiting values with space(s)
reserved_filter_value = term_chunk.split(":")[1].replace("'", "")
if reserved_filter in RESERVED_SEARCH_TERMS:
reserved_terms.append(term_chunk)
if reserved_filter == "category":
allow_terms.append(Term('categories', reserved_filter_value))
elif reserved_filter == "owner":
allow_terms.append(Term('repo_owner_username', reserved_filter_value))
else:
pass # Treat unrecognized filter as normal search term.
if allow_terms:
allow_query = And(allow_terms)
search_term_without_filters = " ".join([chunk for chunk in search_term_chunks if chunk not in reserved_terms])
else:
search_term_without_filters = search_term
search_term_without_filters = None
search_space = search_term.replace('"', "'")
reserved = re.compile(r"(category|c|owner|o):(\w+|\'.*?\')")
while True:
match = reserved.search(search_space)
if match is None:
search_term_without_filters = ' '.join(search_space.split())
break
if match.groups()[0] in ["category", "c"]:
allow_terms.append(Term('categories', match.groups()[1].strip().replace("'", "")))
elif match.groups()[0] in ["owner", "o"]:
allow_terms.append(Term('repo_owner_username', match.groups()[1].strip().replace("'", "")))
search_space = search_space[0:match.start()] + search_space[match.end():]
allow_query = And(allow_terms) if allow_terms else None
return allow_query, search_term_without_filters