Resolve inconsistent routings names

This commit is contained in:
guerler
2017-11-13 13:36:28 -05:00
parent 32e00137be
commit 63c61d2ce7
14 changed files with 31 additions and 35 deletions
+3 -3
View File
@@ -44,20 +44,20 @@ window.app = function app(options, bootstrapped) {
"(/)tours(/)(:tour_id)": "show_tours",
"(/)user(/)": "show_user",
"(/)user(/)(:form_id)": "show_user_form",
"(/)workflow(/)": "show_workflows",
"(/)workflow/run(/)": "show_run",
"(/)pages(/)create(/)": "show_pages_create",
"(/)pages(/)edit(/)": "show_pages_edit",
"(/)pages(/)(:action_id)": "show_pages",
"(/)visualizations(/)edit(/)": "show_visualizations_edit",
"(/)visualizations/(:action_id)": "show_visualizations",
"(/)workflows/import_workflow": "show_import_workflow",
"(/)workflows/run(/)": "show_run",
"(/)workflows(/)list": "show_workflows",
"(/)workflows/list_published(/)": "show_workflows_published",
"(/)workflows/create(/)": "show_workflows_create",
"(/)histories(/)rename(/)": "show_histories_rename",
"(/)histories(/)permissions(/)": "show_histories_permissions",
"(/)histories(/)(:action_id)": "show_histories",
"(/)datasets(/)list(/)": "show_datasets",
"(/)workflow/import_workflow": "show_import_workflow",
"(/)custom_builds": "show_custom_builds",
"(/)datasets/edit": "show_dataset_edit_attributes",
"(/)datasets/error": "show_dataset_error"
@@ -66,7 +66,7 @@ var ToolPanel = Backbone.View.extend({
self.$("#internal-workflows").append(
self._templateWorkflowLink({
title: menu_entry.stored_workflow.name,
href: `workflow/run?id=${menu_entry.encoded_stored_workflow_id}`
href: `workflows/run?id=${menu_entry.encoded_stored_workflow_id}`
})
);
});
+1 -1
View File
@@ -39,7 +39,7 @@ var Collection = Backbone.Collection.extend({
title: _l("Workflow"),
tooltip: _l("Chain tools into workflows"),
disabled: !Galaxy.user.id,
url: "workflow"
url: "workflows/list"
});
//
@@ -127,7 +127,7 @@ var WorkflowItemView = Backbone.View.extend({
if (this.model.get("owner") === Galaxy.user.attributes.username) {
return `<ul class="dropdown-menu action-dpd"><li><a href="${Galaxy.root}workflow/editor?id=${
this.model.id
}">Edit</a></li><li><a href="${Galaxy.root}workflow/run?id=${this.model.id}">Run</a></li><li><a href="${
}">Edit</a></li><li><a href="${Galaxy.root}workflows/run?id=${this.model.id}">Run</a></li><li><a href="${
Galaxy.root
}workflow/sharing?id=${this.model.id}">Share</a></li><li><a href="${Galaxy.root}api/workflows/${
this.model.id
@@ -141,7 +141,7 @@ var WorkflowItemView = Backbone.View.extend({
Galaxy.root
}workflow/display_by_username_and_slug?username=${this.model.get("owner")}&slug=${this.model.get(
"slug"
)}">View</a></li><li><a href="${Galaxy.root}workflow/run?id=${
)}">View</a></li><li><a href="${Galaxy.root}workflows/run?id=${
this.model.id
}">Run</a></li><li><a id="copy-workflow" style="cursor: pointer;">Copy</a></li><li><a class="link-confirm-shared-${
this.model.id
@@ -305,9 +305,9 @@ var WorkflowListView = Backbone.View.extend({
_templateActionButtons: function() {
return `<ul class="manage-table-actions"><li><input class="search-wf form-control" type="text" autocomplete="off" placeholder="search for workflow..."></li><li><a class="action-button fa fa-plus wf-action" id="new-workflow" title="Create new workflow" href="${
Galaxy.root
}workflow/create"></a></li><li><a class="action-button fa fa-upload wf-action" id="import-workflow" title="Upload or import workflow" href="${
}workflows/create"></a></li><li><a class="action-button fa fa-upload wf-action" id="import-workflow" title="Upload or import workflow" href="${
Galaxy.root
}workflow/import_workflow"></a></li></ul>`;
}workflows/import_workflow"></a></li></ul>`;
},
/** Template for workflow table */
+5 -5
View File
@@ -110,9 +110,6 @@ def paste_app_factory(global_conf, **kwargs):
webapp.add_client_route('/tours/{tour_id}')
webapp.add_client_route('/user')
webapp.add_client_route('/user/{form_id}')
webapp.add_client_route('/workflow')
webapp.add_client_route('/workflows/list_published')
webapp.add_client_route('/workflows/create')
webapp.add_client_route('/visualizations/list_published')
webapp.add_client_route('/visualizations/list')
webapp.add_client_route('/visualizations/edit')
@@ -128,8 +125,11 @@ def paste_app_factory(global_conf, **kwargs):
webapp.add_client_route('/datasets/list')
webapp.add_client_route('/datasets/edit')
webapp.add_client_route('/datasets/error')
webapp.add_client_route('/workflow/run')
webapp.add_client_route('/workflow/import_workflow')
webapp.add_client_route('/workflows/list')
webapp.add_client_route('/workflows/list_published')
webapp.add_client_route('/workflows/create')
webapp.add_client_route('/workflows/run')
webapp.add_client_route('/workflows/import_workflow')
webapp.add_client_route('/custom_builds')
# ==== Done
@@ -365,7 +365,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
# Redirect to load galaxy frames.
return trans.show_ok_message(
message="""Workflow "%s" has been imported. <br>You can <a href="%s">start using this workflow</a> or %s."""
% (stored.name, web.url_for(controller='workflow'), referer_message), use_panels=True)
% (stored.name, web.url_for('workflows/list'), referer_message))
@web.expose
@web.require_login("use Galaxy workflows")
@@ -510,9 +510,12 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
'label' : 'Annotation',
'help' : 'A description of the workflow; annotation is shown alongside shared or published workflows.'
}]}
'''else:
else:
user = trans.get_user()
if workflow_name is not None:
workflow_name = payload.get('workflow_name')
workflow_annotation = payload.get('workflow_annotation')
if not workflow_name:
return self.message_exception(trans, 'Please provide a workflow name')
# Create the new stored workflow
stored_workflow = model.StoredWorkflow()
stored_workflow.name = workflow_name
@@ -530,14 +533,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
session = trans.sa_session
session.add(stored_workflow)
session.flush()
return self.editor(trans, id=trans.security.encode_id(stored_workflow.id))
else:
return form(url_for(controller="workflow", action="create"), "Create New Workflow", submit_text="Create", use_panels=True) \
.add_text("workflow_name", "Workflow Name", value="Unnamed workflow") \
.add_text("workflow_annotation",
"Workflow Annotation",
value="",
help="A description of the workflow; annotation is shown alongside shared or published workflows.")'''
return {'message':'Workflow %s has been created.' % workflow_name}
@web.json
def save_workflow_as(self, trans, workflow_name, workflow_data, workflow_annotation=""):
@@ -890,12 +886,12 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
id=repository_id,
message=message,
status=status))
redirect_url = url_for('/') + 'workflow?status=' + status + '&message=%s' % escape(message)
redirect_url = url_for('/') + 'workflows/list?status=' + status + '&message=%s' % escape(message)
return trans.response.send_redirect(redirect_url)
if cntrller == 'api':
return status, message
if status == 'error':
redirect_url = url_for('/') + 'workflow?status=' + status + '&message=%s' % escape(message)
redirect_url = url_for('/') + 'workflows/list?status=' + status + '&message=%s' % escape(message)
return trans.response.send_redirect(redirect_url)
else:
return {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long