Package GalaxyApp in extended bundle for bootstrapping outside the primary entrypoints; TODO: Refactor this to be import-based and keep a singleton

This commit is contained in:
Dannon Baker
2017-12-13 13:16:01 -05:00
parent 2d2726456c
commit 560b2e0b96
3 changed files with 23 additions and 21 deletions
+3 -1
View File
@@ -1,4 +1,5 @@
import _l from "utils/localization";
import GalaxyApp from "galaxy";
import WorkflowView from "mvc/workflow/workflow-view";
import Trackster from "viz/trackster";
import Circster from "viz/circster";
@@ -184,7 +185,8 @@ export const bundleEntries = {
Trackster,
StructureView,
HDAListItemEdit,
HDAModel
HDAModel,
GalaxyApp
};
window.bundleEntries = bundleEntries;
+9 -12
View File
@@ -24,19 +24,16 @@ ${ h.dumps( dictionary, indent=( 2 if trans.debug else 0 ) ) }
## 1) bootstrap kwargs (as above), 2) build Galaxy global var, 3) load 'app' by AMD (optional)
${ self.bootstrap( **kwargs ) }
<script type="text/javascript">
require([ 'require', 'galaxy' ], function( require, galaxy ){
//TODO: global...
window.Galaxy = new galaxy.default.GalaxyApp({
root : '${h.url_for( "/" )}',
config : ${ render_json( get_config_dict() )},
user : ${ render_json( get_user_dict() )},
session_csrf_token : '${ trans.session_csrf_token }'
}, window.bootstrapped );
window.Galaxy = new window.bundleEntries.GalaxyApp.GalaxyApp({
root : '${h.url_for( "/" )}',
config : ${ render_json( get_config_dict() )},
user : ${ render_json( get_user_dict() )},
session_csrf_token : '${ trans.session_csrf_token }'
}, window.bootstrapped );
%if app:
require([ '${app}' ]);
%endif
});
%if app:
require([ '${app}' ]);
%endif
</script>
</%def>
@@ -1,4 +1,3 @@
<%inherit file="/webapps/galaxy/base_panels.mako"/>
<%namespace file="/galaxy_client_app.mako" name="galaxy_client"/>
@@ -24,12 +23,16 @@
<%def name="javascript_app()">
<script type="text/javascript">
define( 'app', function(){
$(function(){bundleEntries.multiHistory(bootstrapped)});
});
define( 'app', function(){
bundleEntries.multiHistory(bootstrapped);
});
</script>
${ galaxy_client.load( app='app', current_history_id=current_history_id,
includingDeleted=include_deleted_histories, order=order, limit=limit ) }
##${ galaxy_client.load( app='app', histories=histories,
## includingDeleted=include_deleted_histories, order=order, limit=limit ) }
${galaxy_client.load(
app='app',
current_history_id=current_history_id,
includingDeleted=include_deleted_histories,
order=order,
limit=limit
)}
</%def>