mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
history panel: panel was not showing deleted datasets when a dataset was purged (even when set to 'include deleted datasets') - fix by using purge_async; history panel: fix history-options menu checkbox with new font awesome class format; pack scripts
This commit is contained in:
@@ -32,6 +32,38 @@ var HDAEditView = HDABaseView.extend( LoggableMixin ).extend(
|
||||
];
|
||||
},
|
||||
|
||||
/** Set up js behaviors, event handlers for elements within the given container.
|
||||
* Overridden from hda-base.
|
||||
* @param {jQuery} $container jq object that contains the elements to process (defaults to this.$el)
|
||||
*/
|
||||
_setUpBehaviors : function( $container ){
|
||||
//TODO: ideally this would be a DELETE call to the api
|
||||
// using purge async for now
|
||||
HDABaseView.prototype._setUpBehaviors.call( this, $container );
|
||||
|
||||
// use purge_async with an ajax call
|
||||
var hdaView = this,
|
||||
purge_url = this.urls.purge,
|
||||
purge_link = $container.find( '#historyItemPurger-' + this.model.get( 'id' ) );
|
||||
if( purge_link ){
|
||||
//TODO: remove href from template
|
||||
purge_link.attr( 'href', [ "javascript", "void(0)" ].join( ':' ) );
|
||||
purge_link.click( function( event ){
|
||||
//TODO??: confirm?
|
||||
var ajaxPromise = jQuery.ajax( purge_url );
|
||||
ajaxPromise.success( function( message, status, responseObj ){
|
||||
hdaView.model.set( 'purged', true );
|
||||
});
|
||||
ajaxPromise.error( function( error, status, message ){
|
||||
//TODO: Exception messages are hidden within error page
|
||||
//!NOTE: that includes the 'Removal of datasets by users is not allowed in this Galaxy instance.'
|
||||
alert( '(' + error.status + ') Unable to purge this dataset:\n' + message );
|
||||
});
|
||||
});
|
||||
}
|
||||
//TODO: same with undelete_async
|
||||
},
|
||||
|
||||
// ......................................................................... RENDER WARNINGS
|
||||
/** Render any hda warnings including: is deleted, is purged, is hidden.
|
||||
* Overrides _render_warnings to include links to further actions (undelete, etc.)).
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-popupmenu-menu"]=b(function(f,s,q,l,x){q=q||f.helpers;var r="",i,h,d="function",c=this.escapeExpression,p=this;function o(B,A){var y="",z;y+="\n ";z=B.options;z=q.each.call(B,z,{hash:{},inverse:p.noop,fn:p.program(2,n,A)});if(z||z===0){y+=z}y+="\n";return y}function n(B,A){var y="",z;y+="\n ";z=B.divider;z=q["if"].call(B,z,{hash:{},inverse:p.program(5,k,A),fn:p.program(3,m,A)});if(z||z===0){y+=z}y+="\n ";return y}function m(z,y){return'\n <li class="divider"></li>\n '}function k(B,A){var y="",z;y+="\n ";z=B.header;z=q["if"].call(B,z,{hash:{},inverse:p.program(8,g,A),fn:p.program(6,j,A)});if(z||z===0){y+=z}y+="\n ";return y}function j(C,B){var z="",A,y;z+='\n <li class="head"><a href=""javascript:void(0);">';y=q.html;if(y){A=y.call(C,{hash:{}})}else{A=C.html;A=typeof A===d?A():A}if(A||A===0){z+=A}z+="</a></li>\n ";return z}function g(C,B){var z="",A,y;z+="\n ";z+='\n <li><a href="';A=C.href;A=q["if"].call(C,A,{hash:{},inverse:p.program(11,w,B),fn:p.program(9,e,B)});if(A||A===0){z+=A}z+='"\n ';A=C.href;A=q["if"].call(C,A,{hash:{},inverse:p.noop,fn:p.program(13,v,B)});if(A||A===0){z+=A}z+=' class="popupmenu-option">\n ';A=C.checked;A=q["if"].call(C,A,{hash:{},inverse:p.noop,fn:p.program(15,u,B)});if(A||A===0){z+=A}z+="\n ";y=q.html;if(y){A=y.call(C,{hash:{}})}else{A=C.html;A=typeof A===d?A():A}if(A||A===0){z+=A}z+="\n </a></li>\n ";return z}function e(B,A){var z,y;y=q.href;if(y){z=y.call(B,{hash:{}})}else{z=B.href;z=typeof z===d?z():z}return c(z)}function w(z,y){return"javascript:void(0);"}function v(C,B){var z="",A,y;z+='target="';y=q.target;if(y){A=y.call(C,{hash:{}})}else{A=C.target;A=typeof A===d?A():A}z+=c(A)+'"';return z}function u(z,y){return'<span class="ficon ok"></span>'}function t(z,y){return"\n <li>No Options.</li>\n"}r+='<ul id="';h=q.id;if(h){i=h.call(s,{hash:{}})}else{i=s.id;i=typeof i===d?i():i}r+=c(i)+'-menu" class="dropdown-menu">\n';i=s.options;i=i==null||i===false?i:i.length;i=q["if"].call(s,i,{hash:{},inverse:p.program(17,t,x),fn:p.program(1,o,x)});if(i||i===0){r+=i}r+="\n</ul>";return r})})();
|
||||
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-popupmenu-menu"]=b(function(f,s,q,l,x){q=q||f.helpers;var r="",i,h,d="function",c=this.escapeExpression,p=this;function o(B,A){var y="",z;y+="\n ";z=B.options;z=q.each.call(B,z,{hash:{},inverse:p.noop,fn:p.program(2,n,A)});if(z||z===0){y+=z}y+="\n";return y}function n(B,A){var y="",z;y+="\n ";z=B.divider;z=q["if"].call(B,z,{hash:{},inverse:p.program(5,k,A),fn:p.program(3,m,A)});if(z||z===0){y+=z}y+="\n ";return y}function m(z,y){return'\n <li class="divider"></li>\n '}function k(B,A){var y="",z;y+="\n ";z=B.header;z=q["if"].call(B,z,{hash:{},inverse:p.program(8,g,A),fn:p.program(6,j,A)});if(z||z===0){y+=z}y+="\n ";return y}function j(C,B){var z="",A,y;z+='\n <li class="head"><a href=""javascript:void(0);">';y=q.html;if(y){A=y.call(C,{hash:{}})}else{A=C.html;A=typeof A===d?A():A}if(A||A===0){z+=A}z+="</a></li>\n ";return z}function g(C,B){var z="",A,y;z+="\n ";z+='\n <li><a href="';A=C.href;A=q["if"].call(C,A,{hash:{},inverse:p.program(11,w,B),fn:p.program(9,e,B)});if(A||A===0){z+=A}z+='"\n ';A=C.href;A=q["if"].call(C,A,{hash:{},inverse:p.noop,fn:p.program(13,v,B)});if(A||A===0){z+=A}z+=' class="popupmenu-option">\n ';A=C.checked;A=q["if"].call(C,A,{hash:{},inverse:p.noop,fn:p.program(15,u,B)});if(A||A===0){z+=A}z+="\n ";y=q.html;if(y){A=y.call(C,{hash:{}})}else{A=C.html;A=typeof A===d?A():A}if(A||A===0){z+=A}z+="\n </a></li>\n ";return z}function e(B,A){var z,y;y=q.href;if(y){z=y.call(B,{hash:{}})}else{z=B.href;z=typeof z===d?z():z}return c(z)}function w(z,y){return"javascript:void(0);"}function v(C,B){var z="",A,y;z+='target="';y=q.target;if(y){A=y.call(C,{hash:{}})}else{A=C.target;A=typeof A===d?A():A}z+=c(A)+'"';return z}function u(z,y){return'<span class="fa-icon-ok"></span>'}function t(z,y){return"\n <li>No Options.</li>\n"}r+='<ul id="';h=q.id;if(h){i=h.call(s,{hash:{}})}else{i=s.id;i=typeof i===d?i():i}r+=c(i)+'-menu" class="dropdown-menu">\n';i=s.options;i=i==null||i===false?i:i.length;i=q["if"].call(s,i,{hash:{},inverse:p.program(17,t,x),fn:p.program(1,o,x)});if(i||i===0){r+=i}r+="\n</ul>";return r})})();
|
||||
@@ -96,7 +96,7 @@ function program13(depth0,data) {
|
||||
function program15(depth0,data) {
|
||||
|
||||
|
||||
return "<span class=\"ficon ok\"></span>";}
|
||||
return "<span class=\"fa-icon-ok\"></span>";}
|
||||
|
||||
function program17(depth0,data) {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{{!NOTE: changed from # to void fn }}
|
||||
<li><a href="{{#if href }}{{ href }}{{else}}javascript:void(0);{{/if}}"
|
||||
{{#if href }}target="{{ target }}"{{/if}} class="popupmenu-option">
|
||||
{{#if checked }}<span class="ficon ok"></span>{{/if}}
|
||||
{{#if checked }}<span class="fa-icon-ok"></span>{{/if}}
|
||||
{{{ html }}}
|
||||
</a></li>
|
||||
{{/if}}
|
||||
|
||||
@@ -124,7 +124,9 @@ ${ unquote_plus( h.to_json_string( url_dict ) ) }
|
||||
|
||||
url_dict = {
|
||||
# ................................................................ warning message links
|
||||
'purge' : h.url_for( controller='dataset', action='purge',
|
||||
#'purge' : h.url_for( controller='dataset', action='purge',
|
||||
# dataset_id=encoded_id_template ),
|
||||
'purge' : h.url_for( controller='dataset', action='purge_async',
|
||||
dataset_id=encoded_id_template ),
|
||||
#TODO: hide (via api)
|
||||
'unhide' : h.url_for( controller='dataset', action='unhide',
|
||||
@@ -143,7 +145,6 @@ ${ unquote_plus( h.to_json_string( url_dict ) ) }
|
||||
dataset_id=encoded_id_template ),
|
||||
|
||||
#TODO: via api
|
||||
#TODO: show deleted handled by history
|
||||
'delete' : h.url_for( controller='dataset', action='delete_async', dataset_id=encoded_id_template ),
|
||||
|
||||
# ................................................................ download links (and associated meta files),
|
||||
@@ -203,7 +204,6 @@ ${ unquote_plus( h.to_json_string( url_dict ) ) }
|
||||
<%def name="get_hdas( history_id, hdas )">
|
||||
<%
|
||||
#BUG: one inaccessible dataset will error entire list
|
||||
|
||||
if not hdas:
|
||||
return '[]'
|
||||
# rather just use the history.id (wo the datasets), but...
|
||||
@@ -256,7 +256,6 @@ ${h.js(
|
||||
"mvc/dataset/hda-model",
|
||||
"mvc/dataset/hda-base",
|
||||
"mvc/dataset/hda-edit",
|
||||
##"mvc/dataset/hda-readonly",
|
||||
|
||||
##"mvc/tags", "mvc/annotations"
|
||||
|
||||
@@ -302,9 +301,15 @@ galaxy_paths.set( 'history', ${get_history_url_templates()} );
|
||||
|
||||
$(function(){
|
||||
galaxyPageSetUp();
|
||||
//Galaxy.historyFrame = window;
|
||||
|
||||
var debugging = ( new PersistantStorage( '__history_panel' ).get( 'debugging' ) || false );
|
||||
//NOTE: for debugging on non-local instances (main/test)
|
||||
// 1. load history panel in own tab
|
||||
// 2. from console: new PersistantStorage( '__history_panel' ).set( 'debugging', true )
|
||||
// -> history panel and hdas will display console logs in console
|
||||
var debugging = false;
|
||||
if( jQuery.jStorage.get( '__history_panel' ) ){
|
||||
debugging = new PersistantStorage( '__history_panel' ).get( 'debugging' );
|
||||
}
|
||||
|
||||
// ostensibly, this is the App
|
||||
// LOAD INITIAL DATA IN THIS PAGE - since we're already sending it...
|
||||
|
||||
Reference in New Issue
Block a user