Skip to content

Commit

Permalink
Resolve inconsistent routings names
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Nov 13, 2017
1 parent 32e0013 commit 63c61d2
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 35 deletions.
6 changes: 3 additions & 3 deletions client/galaxy/scripts/apps/analysis.js
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/apps/panels/tool-panel.js
Expand Up @@ -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}`
})
);
});
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/layout/menu.js
Expand Up @@ -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"
});

//
Expand Down
8 changes: 4 additions & 4 deletions client/galaxy/scripts/mvc/workflow/workflow.js
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 */
Expand Down
10 changes: 5 additions & 5 deletions lib/galaxy/webapps/galaxy/buildapp.py
Expand Up @@ -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')
Expand All @@ -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
Expand Down
22 changes: 9 additions & 13 deletions lib/galaxy/webapps/galaxy/controllers/workflow.py
Expand Up @@ -365,7 +365,7 @@ def imp(self, trans, id, **kwargs):
# 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")
Expand Down Expand Up @@ -510,9 +510,12 @@ def create(self, trans, payload=None, **kwd):
'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
Expand All @@ -530,14 +533,7 @@ def create(self, trans, payload=None, **kwd):
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=""):
Expand Down Expand Up @@ -890,12 +886,12 @@ def upload_import_workflow(self, trans, cntrller='workflow', **kwd):
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 {
Expand Down
2 changes: 1 addition & 1 deletion static/maps/layout/menu.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/maps/mvc/workflow/workflow.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

0 comments on commit 63c61d2

Please sign in to comment.