mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
fixed upload problem for integration tests
This commit is contained in:
@@ -24,9 +24,9 @@ export function getGalaxyInstance() {
|
||||
model_class: "User",
|
||||
id: "f2db41e1fa331b3e",
|
||||
attributes: {},
|
||||
isAdmin: function() {
|
||||
isAdmin: function () {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
root: "/",
|
||||
emit: {
|
||||
|
||||
@@ -48,7 +48,7 @@ import LoadingSpan from "components/LoadingSpan";
|
||||
import { mapState } from "vuex";
|
||||
import { BModal, BTabs, BTab } from "bootstrap-vue";
|
||||
|
||||
export default {
|
||||
const UploadModal = {
|
||||
components: {
|
||||
Collection,
|
||||
Composite,
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
LoadingSpan,
|
||||
BModal,
|
||||
BTabs,
|
||||
BTab
|
||||
BTab,
|
||||
},
|
||||
props: {
|
||||
modalStatic: {
|
||||
@@ -174,15 +174,9 @@ export default {
|
||||
}),
|
||||
|
||||
currentHistoryId() {
|
||||
// TODO: currentHistory is only in Vuex if beta is enabled
|
||||
// Remove when no longer in beta
|
||||
if ("betaHistory/currentHistoryId" in this.$store.getters) {
|
||||
return this.$store.getters["betaHistory/currentHistoryId"];
|
||||
} else {
|
||||
const Galaxy = getGalaxyInstance();
|
||||
const legacyId = Galaxy.currHistoryPanel?.model.get("id");
|
||||
return legacyId;
|
||||
}
|
||||
const Galaxy = getGalaxyInstance();
|
||||
const legacyId = Galaxy.currHistoryPanel?.model.get("id");
|
||||
return legacyId;
|
||||
},
|
||||
|
||||
historyAvailable() {
|
||||
@@ -341,4 +335,14 @@ export default {
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// Beta history patch
|
||||
const useBetaHistory = sessionStorage.getItem("useBetaHistory");
|
||||
if (useBetaHistory) {
|
||||
UploadModal.computed.currentHistoryId = function () {
|
||||
return this.$store.getters["betaHistory/currentHistoryId"];
|
||||
};
|
||||
}
|
||||
|
||||
export default UploadModal;
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Vue from "vue";
|
||||
import UploadModal from "./UploadModal";
|
||||
import { initializeUploadDefaults } from "./config";
|
||||
import store from "../../store";
|
||||
|
||||
export function mount(propsData = {}) {
|
||||
propsData = initializeUploadDefaults(propsData);
|
||||
@@ -10,6 +9,5 @@ export function mount(propsData = {}) {
|
||||
document.getElementsByTagName("body")[0].appendChild(vm);
|
||||
new instance({
|
||||
propsData: propsData,
|
||||
store,
|
||||
}).$mount(vm);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import Vue from "vue";
|
||||
import ToolBox from "../../components/Panels/ToolBox";
|
||||
import SidePanel from "../../components/Panels/SidePanel";
|
||||
import { mountVueComponent } from "../../utils/mountVueComponent";
|
||||
import store from "../../store";
|
||||
|
||||
const ToolPanel = Backbone.View.extend({
|
||||
initialize: function () {
|
||||
@@ -19,6 +20,7 @@ const ToolPanel = Backbone.View.extend({
|
||||
$("body").append(vm);
|
||||
const upload = new modalInstance({
|
||||
propsData: propsData,
|
||||
store,
|
||||
}).$mount(vm);
|
||||
|
||||
// attach upload entrypoint to Galaxy object
|
||||
|
||||
+12
-23
@@ -22,15 +22,13 @@ import { datasetsStore } from "./datasetsStore";
|
||||
import { jobStore } from "./jobStore";
|
||||
|
||||
// beta features
|
||||
import { historyStore as betaHistoryStore, historyPersist } from "components/History/model/historyStore";
|
||||
import { historyStore as betaHistoryStore } from "components/History/model/historyStore";
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
export function createStore() {
|
||||
const storeConfig = {
|
||||
plugins: [
|
||||
createCache(),
|
||||
],
|
||||
plugins: [createCache()],
|
||||
modules: {
|
||||
gridSearch: gridSearchStore,
|
||||
histories: historyStore,
|
||||
@@ -48,29 +46,20 @@ export function createStore() {
|
||||
},
|
||||
};
|
||||
|
||||
// TODO: Remove conditional loads when history beta is complete
|
||||
// Initialize store
|
||||
if (!config.testBuild) {
|
||||
storeConfig.plugins.push((store) => {
|
||||
store.dispatch("user/$init", { store });
|
||||
store.dispatch("config/$init", { store });
|
||||
});
|
||||
}
|
||||
|
||||
// beta history panel features features
|
||||
const useBetaHistory = sessionStorage.getItem("useBetaHistory");
|
||||
if (useBetaHistory) {
|
||||
storeConfig.modules.betaHistory = betaHistoryStore;
|
||||
storeConfig.plugins.push(historyPersist.plugin);
|
||||
}
|
||||
|
||||
// Do not run initialization ajax calls when unit testing
|
||||
if (!config.testBuild) {
|
||||
const userInitPlugin = (store) => {
|
||||
store.dispatch("user/$init", { store });
|
||||
store.dispatch("config/$init", { store });
|
||||
};
|
||||
storeConfig.plugins.push(userInitPlugin);
|
||||
|
||||
if (useBetaHistory) {
|
||||
const loadUserHistories = (store) => {
|
||||
store.dispatch("betaHistory/$init", { store });
|
||||
};
|
||||
storeConfig.plugins.push(loadUserHistories);
|
||||
}
|
||||
storeConfig.plugins.push((store) => {
|
||||
store.dispatch("betaHistory/$init", { store });
|
||||
});
|
||||
}
|
||||
|
||||
return new Vuex.Store(storeConfig);
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
// legacyNavigationPlugin,
|
||||
eventHubPlugin,
|
||||
localizationPlugin,
|
||||
vueRxShortcutPlugin
|
||||
vueRxShortcutPlugin,
|
||||
} from "components/plugins";
|
||||
|
||||
// Bootstrap components
|
||||
|
||||
Reference in New Issue
Block a user