mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-28 02:58:18 +08:00
Remove sample tracking manual external service transfer due to security concerns
This commit is contained in:
@@ -1,148 +0,0 @@
|
||||
<%inherit file="/base.mako"/>
|
||||
<%namespace file="/message.mako" import="render_msg" />
|
||||
<%namespace file="/requests/common/common.mako" import="render_sample_datasets" />
|
||||
<%namespace file="/requests/common/common.mako" import="common_javascripts" />
|
||||
|
||||
<%def name="javascripts()">
|
||||
${parent.javascripts()}
|
||||
${common_javascripts()}
|
||||
</%def>
|
||||
|
||||
${h.js( "libs/jquery/jquery-ui", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )}
|
||||
${h.css( "dynatree_skin/ui.dynatree" )}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#tree").ajaxComplete(function(event, XMLHttpRequest, ajaxOptions) {
|
||||
_log("debug", "ajaxComplete: %o", this); // dom element listening
|
||||
});
|
||||
// --- Initialize sample trees
|
||||
$("#tree").dynatree({
|
||||
title: "${scp_configs['data_location']}",
|
||||
minExpandLevel: 1, // 1: root node is not collapsible
|
||||
persist: false,
|
||||
checkbox: true,
|
||||
selectMode: 3,
|
||||
onPostInit: function(isReloading, isError) {
|
||||
//alert("reloading: "+isReloading+", error:"+isError);
|
||||
logMsg("onPostInit(%o, %o) - %o", isReloading, isError, this);
|
||||
// Re-fire onActivate, so the text is updated
|
||||
this.reactivate();
|
||||
},
|
||||
fx: { height: "toggle", duration: 200 },
|
||||
// initAjax is hard to fake, so we pass the children as object array:
|
||||
initAjax: {url: "${h.url_for( controller='requests_admin', action='open_folder' )}",
|
||||
dataType: "json",
|
||||
data: { request_id: "${trans.security.encode_id( request.id )}", external_service_id: "${trans.security.encode_id( external_service.id )}", key: "${scp_configs['data_location']}" },
|
||||
},
|
||||
onLazyRead: function(dtnode){
|
||||
dtnode.appendAjax({
|
||||
url: "${h.url_for( controller='requests_admin', action='open_folder' )}",
|
||||
dataType: "json",
|
||||
data: { request_id: "${trans.security.encode_id( request.id )}", external_service_id: "${trans.security.encode_id( external_service.id )}", key: dtnode.data.key },
|
||||
});
|
||||
},
|
||||
onSelect: function(select, dtnode) {
|
||||
// Display list of selected nodes
|
||||
var selNodes = dtnode.tree.getSelectedNodes();
|
||||
// convert to title/key array
|
||||
var selKeys = $.map(selNodes, function(node){
|
||||
return node.data.key;
|
||||
});
|
||||
document.select_datasets_to_transfer.selected_datasets_to_transfer.value = selKeys.join(",")
|
||||
},
|
||||
onActivate: function(dtnode) {
|
||||
var cell = $("#file_details");
|
||||
var selected_value;
|
||||
if (dtnode.data.key == 'root') {
|
||||
selected_value = "${scp_configs['data_location']}/";
|
||||
} else {
|
||||
selected_value = dtnode.data.key;
|
||||
};
|
||||
if (selected_value.charAt(selected_value.length-1) != '/') {
|
||||
// Make ajax call
|
||||
$.ajax( {
|
||||
type: "POST",
|
||||
url: "${h.url_for( controller='requests_admin', action='get_file_details' )}",
|
||||
dataType: "json",
|
||||
data: { request_id: "${trans.security.encode_id(request.id)}", external_service_id: "${trans.security.encode_id(external_service.id)}", folder_path: selected_value },
|
||||
success : function ( data ) {
|
||||
cell.html( '<label>'+data+'</label>' )
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cell.html( '' );
|
||||
};
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<%
|
||||
is_admin = cntrller == 'requests_admin' and trans.user_is_admin()
|
||||
can_transfer_datasets = is_admin and sample.untransferred_dataset_files and sample.library and sample.folder
|
||||
%>
|
||||
|
||||
<br/><br/>
|
||||
<ul class="manage-table-actions">
|
||||
<li><a class="action-button" href="${h.url_for( controller='external_service', action='view_external_service', id=trans.security.encode_id( external_service.id ) )}">External service configuration</a></li>
|
||||
%if can_transfer_datasets:
|
||||
<li><a class="action-button" href="${h.url_for( controller='requests_admin', action='manage_datasets', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">Transfer datasets</a></li>
|
||||
%endif
|
||||
<li><a class="action-button" href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}">Browse this request</a></li>
|
||||
</ul>
|
||||
|
||||
%if not sample:
|
||||
<br/>
|
||||
<font color="red"><b><i>Select a sample before selecting datasets to transfer</i></b></font>
|
||||
<br/>
|
||||
%endif
|
||||
|
||||
%if request.samples_without_library_destinations:
|
||||
<p>
|
||||
<font color="red"><b><i>Select a target data library and folder for a sample before selecting its datasets to transfer from the external service</i></b></font>
|
||||
</p>
|
||||
%endif
|
||||
|
||||
%if message:
|
||||
${render_msg( message, status )}
|
||||
%endif
|
||||
|
||||
<div class="toolForm">
|
||||
<div class="toolFormTitle">Select datasets to transfer from data directory configured for the external service</div>
|
||||
<form name="select_datasets_to_transfer" id="select_datasets_to_transfer" action="${h.url_for( controller='requests_admin', action='select_datasets_to_transfer', cntrller=cntrller, external_service_id=trans.security.encode_id( external_service.id ), request_id=trans.security.encode_id( request.id ))}" method="post" >
|
||||
<div class="form-row">
|
||||
<label>Sample:</label>
|
||||
${sample_id_select_field.get_html()}
|
||||
<div class="toolParamHelp" style="clear: both;">
|
||||
Select the sample that was sequenced to produce the datasets you want to transfer.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row" >
|
||||
<label>Select datasets from source data location defined in the external service configuration:</label>
|
||||
<div id="tree" >
|
||||
Loading...
|
||||
</div>
|
||||
<input id="selected_datasets_to_transfer" name="selected_datasets_to_transfer" type="hidden" size=40"/>
|
||||
<div class="toolParamHelp" style="clear: both;">
|
||||
<ul>
|
||||
<li>Click the <b>external service configuration</b> button and change the <b>Data directory</b> setting to redefine the source data location.</li>
|
||||
<li>Select a folder to select all of the individual files within that folder.</li>
|
||||
<li>Click the <b>Select datasets</b> button when desired dataset check boxes are checked.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div id="file_details" class="toolParamHelp" style="clear: both;background-color:#FAFAFA;"></div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<input type="submit" name="select_datasets_to_transfer_button" value="Select datasets"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
%if sample and sample.datasets:
|
||||
<% title = 'All selected datasets for "%s"' % sample.name %>
|
||||
<p/>
|
||||
${render_sample_datasets( 'requests_admin', sample, sample.datasets, title )}
|
||||
%endif
|
||||
@@ -333,7 +333,6 @@
|
||||
can_add_samples = is_unsubmitted
|
||||
can_delete_samples = not adding_new_samples and request.samples and ( ( is_admin and not is_complete ) or is_unsubmitted )
|
||||
can_edit_samples = request.samples and ( is_admin or not is_complete )
|
||||
can_select_datasets = is_admin and displayable_sample_widgets and ( is_submitted or is_complete )
|
||||
can_transfer_datasets = is_admin and request.samples and not request.is_rejected
|
||||
display_checkboxes = not adding_new_samples and ( is_complete or is_rejected or is_submitted )
|
||||
display_bar_code = request.samples and ( is_complete or is_rejected or is_submitted )
|
||||
@@ -407,7 +406,7 @@
|
||||
%elif sample:
|
||||
<tr>
|
||||
<td>
|
||||
%if sample.state and ( can_select_datasets or can_transfer_datasets ):
|
||||
%if sample.state and can_transfer_datasets:
|
||||
## A sample will have a state only after the request has been submitted.
|
||||
<%
|
||||
encoded_id = trans.security.encode_id( sample.id )
|
||||
@@ -419,14 +418,6 @@
|
||||
<a class="view-info" href="${h.url_for( controller='requests_common', action='view_sample', cntrller=cntrller, id=trans.security.encode_id( sample.id ) )}">${sample.name | h}</a>
|
||||
</div>
|
||||
<div popupmenu="sample-${sample.id}-popup">
|
||||
%if can_select_datasets:
|
||||
%for external_service in sample.request.type.get_external_services_for_manual_data_transfer( trans ):
|
||||
<%
|
||||
menu_item_label = "Select datasets to transfer using %s" % external_service.name
|
||||
%>
|
||||
<li><a class="action-button" href="${h.url_for( controller='requests_admin', action='select_datasets_to_transfer', external_service_id=trans.security.encode_id( external_service.id ), request_id=trans.security.encode_id( request.id ), sample_id=trans.security.encode_id( sample.id ) )}">${menu_item_label}</a></li>
|
||||
%endfor
|
||||
%endif
|
||||
%if sample.datasets and len( sample.datasets ) > len( transferred_dataset_files ) and sample.library and sample.folder:
|
||||
<li><a class="action-button" href="${h.url_for( controller='requests_admin', action='manage_datasets', sample_id=trans.security.encode_id( sample.id ) )}">Manage selected datasets</a></li>
|
||||
%elif sample.datasets and len( sample.datasets ) == len( transferred_dataset_files ):
|
||||
@@ -665,7 +656,6 @@
|
||||
is_admin = cntrller == 'requests_admin' and trans.user_is_admin()
|
||||
is_complete = sample.request.is_complete
|
||||
is_submitted = sample.request.is_submitted
|
||||
can_select_datasets = is_admin and ( is_complete or is_submitted )
|
||||
can_transfer_datasets = is_admin and sample.untransferred_dataset_files
|
||||
%>
|
||||
## The transfer status should update only when the request has been submitted or complete
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
can_add_samples = is_unsubmitted
|
||||
can_edit_request = ( is_admin and not is_complete ) or is_unsubmitted
|
||||
can_reject = is_admin and is_submitted
|
||||
can_select_datasets = is_admin and ( is_complete or is_submitted )
|
||||
can_submit_request = request.samples and is_unsubmitted
|
||||
%>
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
is_admin = cntrller == 'requests_admin' and trans.user_is_admin()
|
||||
is_complete = sample.request.is_complete
|
||||
is_submitted = sample.request.is_submitted
|
||||
can_select_datasets = is_admin and ( is_complete or is_submitted )
|
||||
can_transfer_datasets = is_admin and sample.untransferred_dataset_files and sample.library and sample.folder
|
||||
%>
|
||||
|
||||
@@ -24,9 +23,6 @@
|
||||
%endif
|
||||
<li><a class="action-button" id="sample-${sample.id}-popup" class="menubutton">Dataset Actions</a></li>
|
||||
<div popupmenu="sample-${sample.id}-popup">
|
||||
%if can_select_datasets:
|
||||
<li><a class="action-button" href="${h.url_for( controller='requests_admin', action='select_datasets_to_transfer', cntrller=cntrller, external_service_id=trans.security.encode_id( external_service.id ), request_id=trans.security.encode_id( sample.request.id ), sample_id=trans.security.encode_id( sample.id ) )}">Select more datasets</a></li>
|
||||
%endif
|
||||
<li><a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( sample.library.id ) )}">View target Data Library</a></li>
|
||||
<li><a class="action-button" href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Browse this request</a></li>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user